:root {
  --brand: #cc2038;
  --brand-dark: #a9152a;
  --brand-soft: #fff0f2;
  --brand-wash: #fff8f9;
  --ink: #17191d;
  --muted: #6d7480;
  --line: #e8e9ed;
  --line-strong: #d9dce2;
  --surface: #ffffff;
  --surface-alt: #f7f8fa;
  --surface-hover: #f2f3f5;
  --success: #1b8a59;
  --success-soft: #e9f7f0;
  --warning: #a66b00;
  --warning-soft: #fff5d8;
  --danger: #b51c31;
  --danger-soft: #fdecef;
  --info: #276fbf;
  --info-soft: #eaf3fd;
  --shadow-soft: 0 4px 16px rgba(22, 24, 29, .05);
  --shadow-modal: 0 28px 80px rgba(17, 18, 22, .22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface-alt);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; background: var(--surface-alt); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(204,32,56,.2); outline-offset: 2px; }

.app-frame { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 30; display: flex; flex-direction: column; padding: 18px 14px; background: #fff; border-right: 1px solid var(--line); }
.brand-block { display: flex; align-items: center; gap: 11px; padding: 4px 6px 18px; }
.brand-icon { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.brand-copy { min-width: 0; }
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { font-size: 15px; letter-spacing: -.02em; white-space: nowrap; }
.brand-copy span { margin-top: 2px; font-size: 11px; color: var(--muted); }

.nav-list { display: grid; gap: 4px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 10px; padding: 10px 11px; background: transparent; color: #424750; font-size: 13px; font-weight: 700; text-align: left; }
.nav-item:hover { background: var(--surface-hover); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-icon { width: 19px; height: 19px; flex: 0 0 19px; }
.nav-divider { height: 1px; margin: 8px 10px; background: var(--line); }

.sidebar-note { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--surface-alt); color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.sidebar-note strong, .sidebar-note span { display: block; }
.sidebar-note strong { color: #4d525a; font-size: 11px; margin-bottom: 3px; }
.sidebar-footer { padding: 13px 8px 0; }
.sidebar-footer img { display: block; width: 100%; max-height: 48px; object-fit: contain; object-position: left center; filter: saturate(.92); opacity: .9; }
.sidebar-backdrop { display: none; }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 72px; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 13px; }
.page-eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; }
.topbar h1 { margin: 2px 0 0; font-size: 20px; line-height: 1.1; letter-spacing: -.025em; }
.menu-button { display: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.quick-request { border: 0; border-radius: 10px; padding: 9px 13px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 5px 12px rgba(204,32,56,.16); }
.quick-request:hover { background: var(--brand-dark); }
.user-box { min-width: 155px; display: grid; grid-template-columns: 35px minmax(0, 1fr); align-items: center; gap: 9px; }
.user-avatar { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; background: #eef0f3; color: #4c5159; font-size: 11px; font-weight: 850; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy span { margin-top: 2px; color: var(--muted); font-size: 10.5px; }

.content-shell { max-width: 1420px; margin: 0 auto; padding: 20px 24px 40px; }
.flash { margin: 0 0 14px; padding: 11px 13px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.flash.success { background: var(--success-soft); color: #11623e; border: 1px solid #ccebdc; }
.flash.error { background: var(--danger-soft); color: #95182a; border: 1px solid #f3cad1; }

.loading-card, .panel, .metric-card, .compact-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-soft); }
.loading-card { padding: 28px; text-align: center; color: var(--muted); }
.panel { padding: 18px; }
.compact-card { padding: 14px; }

.dashboard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.dashboard-head h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.dashboard-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric-card { min-height: 92px; padding: 13px 14px; display: flex; align-items: center; gap: 12px; }
.metric-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 38px; }
.metric-icon svg { width: 19px; height: 19px; }
.metric-icon.red { background: var(--brand-soft); color: var(--brand); }
.metric-icon.green { background: var(--success-soft); color: var(--success); }
.metric-icon.amber { background: var(--warning-soft); color: var(--warning); }
.metric-icon.blue { background: var(--info-soft); color: var(--info); }
.metric-label { color: var(--muted); font-size: 10.5px; font-weight: 750; }
.metric-value { margin-top: 2px; font-size: 22px; line-height: 1; font-weight: 900; letter-spacing: -.035em; }
.metric-sub { margin-top: 4px; color: var(--muted); font-size: 10.5px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .75fr); gap: 14px; align-items: start; }
.dashboard-stack { display: grid; gap: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.section-head h2, .section-head h3 { margin: 0; font-size: 15px; letter-spacing: -.015em; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.section-link { border: 0; padding: 4px; background: transparent; color: var(--brand); font-size: 11px; font-weight: 800; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.toolbar-title { min-width: 118px; text-align: center; font-size: 13px; }

.primary, .secondary, .danger, .ghost { border: 0; border-radius: 9px; padding: 8px 11px; font-size: 11.5px; font-weight: 800; }
.primary { background: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-dark); }
.secondary { background: var(--brand-soft); color: var(--brand-dark); }
.ghost { background: #f2f3f5; color: var(--ink); }
.danger { background: var(--danger-soft); color: var(--danger); }
.icon-button { border: 0; background: transparent; font-size: 22px; line-height: 1; }

.calendar-panel { padding: 0; overflow: hidden; }
.calendar-header { padding: 14px 15px 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.calendar-header h2 { margin: 0; font-size: 15px; }
.calendar-subtitle { margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.calendar-wrap { overflow-x: auto; }
.calendar { min-width: 720px; background: #fff; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekdays div { padding: 7px 8px; background: #fafbfc; color: var(--muted); border-right: 1px solid var(--line); font-size: 10px; font-weight: 800; text-align: center; }
.calendar-weekdays div:last-child { border-right: 0; }
.day-cell { min-height: 78px; padding: 7px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: #fff; transition: background .15s ease; }
.day-cell:nth-child(7n) { border-right: 0; }
.day-cell.outside { background: #fbfbfc; color: #b0b4bb; }
.day-cell.has-events { cursor: pointer; }
.day-cell.has-events:hover { background: #fcf7f8; }
.day-cell.today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.day-number { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 10.5px; font-weight: 850; }
.event { display: block; padding: 3px 5px; border-radius: 5px; margin: 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9.5px; font-weight: 750; line-height: 1.25; }
.event.approved { background: #ddf5e8; color: #12643e; }
.event.submitted { background: #fff0c6; color: #765000; }
.event.reviewer_approved { background: #ffe3e7; color: #9b172b; }
.event.block { background: #fbdde2; color: #9f192d; }
.event.intensive { background: #e7eefb; color: #285b9d; }
.event.course { background: #eef0f4; color: #50555d; }
.more-events { color: var(--muted); font-size: 9px; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9.5px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }

.side-list { display: grid; gap: 2px; }
.side-row { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.side-row:first-child { border-top: 0; padding-top: 1px; }
.side-accent { width: 4px; height: 30px; border-radius: 4px; background: var(--brand); }
.side-accent.approved { background: var(--success); }
.side-accent.submitted { background: #e6a400; }
.side-accent.reviewer_approved { background: var(--brand); }
.side-main { min-width: 0; }
.side-main strong, .side-main span { display: block; }
.side-main strong { font-size: 11.5px; }
.side-main span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.side-chevron { color: #a0a4ab; font-size: 17px; }
.notice { padding: 11px 12px; border-radius: 10px; background: var(--brand-wash); border: 1px solid #f6dfe3; }
.notice strong { display: block; color: var(--brand-dark); font-size: 11.5px; }
.notice p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }

.two-col { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 14px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stack { display: grid; gap: 10px; }

form { display: grid; gap: 11px; }
.field { display: grid; gap: 5px; }
.field label { color: #4b5058; font-size: 10.5px; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 10px; background: #fff; color: var(--ink); font-size: 12px; }
.field textarea { min-height: 74px; resize: vertical; }
.inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 2px; }
.form-hint { margin: -2px 0 3px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }

.request-list { display: grid; gap: 8px; }
.request-card { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #fff; }
.request-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.request-title { font-size: 12.5px; font-weight: 850; }
.request-meta { margin-top: 3px; color: var(--muted); font-size: 10px; }
.request-note { margin: 8px 0 0; color: #4e535a; font-size: 10.5px; white-space: pre-wrap; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 7px; font-size: 9.5px; font-weight: 850; white-space: nowrap; }
.badge.submitted { background: var(--warning-soft); color: #795300; }
.badge.reviewer_approved { background: var(--brand-soft); color: var(--brand-dark); }
.badge.approved { background: var(--success-soft); color: #12633f; }
.badge.rejected { background: var(--danger-soft); color: #95182a; }
.badge.cancelled { background: #eceef1; color: #666b73; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.empty { padding: 22px 15px; text-align: center; color: var(--muted); background: #fafbfc; border: 1px dashed var(--line-strong); border-radius: 11px; font-size: 11.5px; }

.queue-table { width: 100%; border-collapse: collapse; }
.queue-table th, .queue-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.queue-table th { background: #fafbfc; color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .03em; }
.queue-table td { font-size: 11px; }
.queue-table tr:last-child td { border-bottom: 0; }
.queue-actions { display: flex; flex-wrap: wrap; gap: 5px; }

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.admin-card h3 { margin: 0 0 10px; font-size: 13px; }
.mini-list { display: grid; gap: 0; margin-top: 12px; max-height: 260px; overflow: auto; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 8px 0; font-size: 10.5px; }
.mini-row:first-child { border-top: 0; padding-top: 0; }
.mini-row .muted { margin-top: 2px; color: var(--muted); font-size: 9.5px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(16,18,22,.42); }
.modal { position: relative; width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 18px; background: #fff; border-radius: 15px; box-shadow: var(--shadow-modal); }
.modal-close { position: absolute; top: 11px; right: 12px; }
.modal-content h3 { margin: 0 38px 13px 0; font-size: 16px; }
.modal-events { display: grid; gap: 8px; }
.modal-event { padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.modal-event strong { display: block; font-size: 12px; }
.modal-event span { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; }

.error-screen { max-width: 650px; margin: 44px auto; padding: 26px; text-align: center; }
.error-screen h2 { color: var(--brand); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f1f2f4; padding: 3px 6px; border-radius: 5px; }

@media (max-width: 1080px) {
  .app-frame { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 16px 10px; }
  .brand-block { justify-content: center; padding-inline: 0; }
  .brand-copy, .nav-item span, .sidebar-note, .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-frame { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: 230px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 10px 0 35px rgba(0,0,0,.12); }
  .sidebar.open { transform: translateX(0); }
  .sidebar .brand-copy, .sidebar .nav-item span, .sidebar .sidebar-note, .sidebar .sidebar-footer { display: block; }
  .sidebar .nav-item { justify-content: flex-start; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(16,18,22,.28); }
  .sidebar-backdrop.show { display: block; }
  .menu-button { display: grid; place-items: center; }
  .topbar { padding: 10px 13px; min-height: 64px; }
  .topbar h1 { font-size: 17px; }
  .page-eyebrow { display: none; }
  .quick-request { display: none; }
  .user-box { min-width: 0; grid-template-columns: 34px; }
  .user-copy { display: none; }
  .content-shell { padding: 14px 12px 28px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .metric-card { min-height: 80px; padding: 10px; gap: 8px; }
  .metric-icon { display: none; }
  .metric-value { font-size: 19px; }
  .dashboard-grid, .two-col, .admin-grid { grid-template-columns: 1fr; }
  .calendar { min-width: 640px; }
  .queue-table { min-width: 700px; }
  .table-scroll { overflow-x: auto; }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 68px; }
  .inline-fields, .three-col { grid-template-columns: 1fr; }
}

/* V3: mobile-first refinements */
.mobile-nav,
.mobile-request,
.mobile-event-dots,
.mobile-agenda { display: none; }

@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .content-shell { padding-bottom: 92px; }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(62px, 1fr);
    align-items: stretch;
    min-height: 62px;
    padding: 5px max(6px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    background: rgba(255,255,255,.97);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 28px rgba(22,24,29,.08);
    backdrop-filter: blur(14px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .mobile-nav-item {
    min-width: 62px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #707681;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 5px 4px;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
  }
  .mobile-nav-item.active { color: var(--brand); background: var(--brand-soft); }
  .mobile-nav-icon { width: 19px; height: 19px; }

  .mobile-request {
    position: fixed;
    right: 14px;
    bottom: calc(75px + env(safe-area-inset-bottom));
    z-index: 54;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 11px 15px;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 28px rgba(181,28,49,.28);
    font-size: 12px;
    font-weight: 850;
  }

  .topbar { min-height: 58px; padding: 8px 11px; }
  .menu-button { width: 36px; height: 36px; }
  .topbar h1 { font-size: 16px; }
  .user-avatar { width: 32px; height: 32px; }
  .user-box { grid-template-columns: 32px; }

  .dashboard-head { margin-bottom: 10px; }
  .dashboard-head h2 { font-size: 18px; }
  .dashboard-head p { font-size: 11px; line-height: 1.4; }

  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .metric-card { min-height: 72px; padding: 9px; border-radius: 12px; }
  .metric-label { font-size: 9px; }
  .metric-value { font-size: 18px; }
  .metric-sub { font-size: 8.5px; line-height: 1.25; }

  .panel { padding: 13px; border-radius: 12px; }
  .compact-card { padding: 12px; border-radius: 12px; }
  .section-head { margin-bottom: 9px; }
  .section-head h2, .section-head h3 { font-size: 14px; }

  .calendar-panel { padding: 0; }
  .calendar-header { padding: 11px 11px 8px; align-items: flex-start; }
  .calendar-header h2 { font-size: 14px; }
  .calendar-subtitle { font-size: 9px; max-width: 210px; line-height: 1.35; }
  .toolbar { gap: 4px; }
  .toolbar .ghost, .toolbar .secondary { padding: 6px 8px; font-size: 10px; }

  .calendar-wrap { overflow: visible; }
  .calendar { min-width: 0; width: 100%; }
  .calendar-weekdays div { padding: 6px 1px; font-size: 9px; }
  .day-cell { min-height: 51px; padding: 5px 3px; }
  .day-number { margin-bottom: 2px; font-size: 9.5px; }
  .desktop-events { display: none; }
  .mobile-event-dots { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; min-height: 8px; }
  .event-dot { width: 6px; height: 6px; border-radius: 50%; background: #c8ccd2; }
  .event-dot.approved { background: var(--success); }
  .event-dot.submitted { background: #e6a400; }
  .event-dot.reviewer_approved { background: var(--brand); }
  .event-dot.block { background: var(--danger); }
  .event-dot.intensive { background: var(--info); }
  .event-dot.course { background: #7d8490; }

  .legend { gap: 7px 10px; padding: 8px 10px; font-size: 8.5px; line-height: 1.2; }

  .mobile-agenda { display: block; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
  .mobile-agenda-head { margin-bottom: 5px; color: #4a4f57; font-size: 10px; font-weight: 850; }
  .mobile-agenda-list { display: grid; }
  .mobile-agenda-row {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    display: grid;
    grid-template-columns: 4px minmax(0,1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 8px 1px;
    text-align: left;
    color: var(--ink);
  }
  .mobile-agenda-row:first-child { border-top: 0; }
  .mobile-agenda-accent { width: 4px; height: 30px; border-radius: 4px; background: #adb2ba; }
  .mobile-agenda-accent.approved { background: var(--success); }
  .mobile-agenda-accent.submitted { background: #e6a400; }
  .mobile-agenda-accent.reviewer_approved { background: var(--brand); }
  .mobile-agenda-accent.block { background: var(--danger); }
  .mobile-agenda-accent.intensive { background: var(--info); }
  .mobile-agenda-accent.course { background: #7d8490; }
  .mobile-agenda-copy { min-width: 0; }
  .mobile-agenda-copy strong,
  .mobile-agenda-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-agenda-copy strong { font-size: 10.5px; }
  .mobile-agenda-copy small { margin-top: 2px; color: var(--muted); font-size: 9px; }
  .mobile-agenda-chevron { color: #9ba0a8; font-size: 18px; }
  .mobile-agenda-empty { padding: 11px; border-radius: 9px; background: #fafbfc; color: var(--muted); font-size: 10px; text-align: center; }

  .two-col { gap: 10px; }
  .field input, .field select, .field textarea { min-height: 42px; font-size: 16px; }
  .field textarea { min-height: 86px; }
  .primary, .secondary, .danger, .ghost { min-height: 38px; }

  .queue-table { min-width: 620px; }
  .request-card { padding: 11px; }
  .request-title { font-size: 12px; }

  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 82vh; border-radius: 18px 18px 0 0; padding: 18px 15px calc(18px + env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-card { min-height: 70px; }
  .metric-sub { display: none; }
  .inline-fields, .three-col { grid-template-columns: 1fr; }
  .calendar-subtitle { display: none; }
  .legend { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
}


/* V4: vereinfachte Verwaltung für Planungseinträge und Tageslimits */
.admin-card-wide { grid-column: 1 / -1; }
.planning-form-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(180px, .8fr) minmax(150px, .65fr) minmax(150px, .65fr); gap: 10px; }
.toggle-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin-top: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; cursor: pointer; }
.toggle-row input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--brand); }
.toggle-row span { display: grid; gap: 2px; }
.toggle-row strong { font-size: 11px; }
.toggle-row small { color: var(--muted); font-size: 9.5px; }
.limit-week-toolbar { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(160px, .7fr) auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.limit-apply { margin-bottom: 1px; white-space: nowrap; }
.day-limit-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 8px; }
.day-limit-card { display: grid; gap: 4px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.day-limit-name { font-size: 10.5px; font-weight: 850; }
.day-limit-date { color: var(--muted); font-size: 9px; }
.day-limit-card input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; font-size: 18px; font-weight: 850; text-align: center; }
.day-limit-card small { color: var(--muted); font-size: 8.5px; text-align: center; }
.limit-help { margin-top: 10px; padding: 9px 11px; border-radius: 9px; background: #fafbfc; color: var(--muted); font-size: 9.5px; }

@media (max-width: 980px) {
  .planning-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .day-limit-grid { grid-template-columns: repeat(5, minmax(105px, 1fr)); overflow-x: auto; padding-bottom: 3px; }
}

@media (max-width: 760px) {
  .admin-card-wide { grid-column: auto; }
  .planning-form-grid, .limit-week-toolbar { grid-template-columns: 1fr; }
  .limit-apply { width: 100%; }
  .day-limit-grid { grid-template-columns: repeat(5, minmax(92px, 1fr)); overflow-x: auto; scroll-snap-type: x proximity; }
  .day-limit-card { scroll-snap-align: start; padding: 9px; }
  .day-limit-card input { min-height: 40px; font-size: 16px; }
}

/* V5: Rollen, Rechte & Jahreswechsel */
.permission-grid { display: grid; gap: 8px; margin-top: 10px; }
.permission-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; cursor: pointer; }
.permission-item input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); flex: 0 0 auto; }
.permission-item span { display: grid; gap: 2px; }
.permission-item strong { font-size: 10.5px; }
.permission-item small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.info-strip { margin-top: 10px; padding: 10px 12px; border: 1px solid #eed8dc; border-radius: 10px; background: #fff8f9; color: #6f4a50; font-size: 9.5px; line-height: 1.45; }
.transition-last { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.employee-list .mini-row { align-items: center; }
.employee-list .secondary { min-width: 92px; }

@media (max-width: 760px) {
  .permission-item { padding: 9px; }
  .employee-list .mini-row { align-items: flex-start; }
  .employee-list .secondary { min-width: 0; }
}

/* V6: professionelle Verwaltungsbereiche + Planungskonflikte */
.flash.warning { background: #fff7df; color: #7a5900; border: 1px solid #f2dea1; }
.admin-page-head { align-items: center; }
.admin-role-pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 32px;
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--muted); font-size: 10px; font-weight: 850; white-space: nowrap;
}
.admin-section-nav {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px;
  margin-bottom: 12px; padding: 6px; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255,255,255,.78); box-shadow: 0 4px 16px rgba(25,28,34,.035);
}
.admin-section-tab {
  min-width: 0; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 8px;
  padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: #4d535d;
  text-align: left; cursor: pointer; transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.admin-section-tab:hover { background: #f7f8fa; color: var(--ink); }
.admin-section-tab.active { background: #fff; color: var(--brand); box-shadow: 0 3px 12px rgba(25,28,34,.08); }
.admin-section-icon { width: 19px; height: 19px; }
.admin-section-tab span { min-width: 0; display: grid; gap: 1px; }
.admin-section-tab strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.admin-section-tab small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.admin-workspace { min-width: 0; }
.admin-workspace .admin-card {
  padding: 18px; border-radius: 14px; box-shadow: 0 5px 22px rgba(25,28,34,.035);
}
.admin-workspace .admin-card-wide { grid-column: auto; }
.admin-focus-card { max-width: none; }
.admin-list-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: #343941;
}
.admin-list-heading strong { font-size: 11px; }
.admin-list-heading span {
  min-width: 24px; padding: 3px 7px; border-radius: 999px; background: #f1f3f5;
  color: var(--muted); font-size: 9px; font-weight: 850; text-align: center;
}
.planning-ok {
  margin-bottom: 13px; padding: 9px 11px; border: 1px solid #cfe9dc; border-radius: 10px;
  background: #f3fbf7; color: #31664c; font-size: 10px; font-weight: 700;
}
.planning-conflict-panel {
  margin-bottom: 14px; padding: 12px; border: 1px solid #f1d6a6; border-radius: 12px;
  background: #fffaf0;
}
.planning-conflict-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.planning-conflict-title strong { color: #7d5500; font-size: 11px; }
.planning-conflict-title span { color: #8b7650; font-size: 9px; }
.planning-conflict-list { display: grid; gap: 6px; }
.planning-conflict-row {
  display: grid; grid-template-columns: 7px minmax(0, 1fr); gap: 8px; align-items: start;
  padding: 7px 8px; border-radius: 8px; background: rgba(255,255,255,.72);
}
.planning-conflict-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: #e6a400; }
.planning-conflict-row strong, .planning-conflict-row span { display: block; }
.planning-conflict-row strong { font-size: 10px; }
.planning-conflict-row span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.planning-conflict-more { margin-top: 7px; color: #8b7650; font-size: 9px; font-weight: 750; }
.modal-lead { margin: -4px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.conflict-dialog-list { display: grid; gap: 7px; max-height: 260px; overflow: auto; }
.conflict-dialog-row { padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfc; }
.conflict-dialog-row strong, .conflict-dialog-row span, .conflict-dialog-row small { display: block; }
.conflict-dialog-row strong { font-size: 11px; }
.conflict-dialog-row span { margin-top: 2px; color: #4e545d; font-size: 10px; }
.conflict-dialog-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

@media (max-width: 1180px) {
  .admin-section-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .admin-page-head { align-items: flex-start; }
  .admin-role-pill { display: none; }
  .admin-section-nav {
    display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
    padding: 5px; gap: 5px; border-radius: 12px;
  }
  .admin-section-tab {
    flex: 0 0 auto; min-width: 128px; grid-template-columns: 22px minmax(0, 1fr); scroll-snap-align: start;
    padding: 8px 9px;
  }
  .admin-section-icon { width: 17px; height: 17px; }
  .admin-section-tab strong { font-size: 9.5px; }
  .admin-section-tab small { font-size: 7.5px; }
  .admin-workspace .admin-card { padding: 13px; }
  .planning-conflict-title { display: grid; gap: 2px; }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   V8 – Professional RF App UI
   ========================================================= */
:root {
  --brand: #f04750;
  --brand-dark: #c9333f;
  --brand-soft: #fff0f2;
  --brand-wash: #fff8f9;
  --ink: #202124;
  --muted: #70757f;
  --surface-alt: #f6f6f7;
  --line: #ececef;
  --line-strong: #dadce1;
  --shadow-soft: 0 10px 34px rgba(32,33,36,.055);
  --shadow-card: 0 1px 2px rgba(32,33,36,.03), 0 10px 30px rgba(32,33,36,.035);
  font-family: "Avenir Next", "Montserrat", "Century Gothic", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body { background: #f7f7f8; }
.app-frame { grid-template-columns: 260px minmax(0,1fr); }
.sidebar { padding: 18px 14px 16px; background: rgba(255,255,255,.97); border-right: 1px solid #ededf0; }
.brand-block { display: block; padding: 0 6px 18px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.brand-main-logo { width: 100%; height: 78px; object-fit: contain; object-position: left center; mix-blend-mode: multiply; }
.brand-appline { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.brand-icon { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; box-shadow: none; }
.brand-copy strong { font-size: 13px; letter-spacing: -.02em; }
.brand-copy span { font-size: 10px; }
.sidebar-footer-copy { margin-top: auto; padding: 12px 8px 3px; color: var(--muted); font-size: 9.5px; border-top: 1px solid var(--line); }
.sidebar-footer-copy span,.sidebar-footer-copy strong { display:block; }
.sidebar-footer-copy strong { color: #3f4146; margin-top: 2px; font-size:10.5px; }
.nav-list { gap: 3px; }
.nav-item { border-radius: 11px; padding: 10px 12px; font-size: 12.5px; font-weight: 750; transition: .16s ease; }
.nav-item.active { background: linear-gradient(90deg,#fff0f3,#fff8f9); color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.nav-item:hover { transform: translateX(1px); }

.topbar { min-height: 70px; padding: 10px 24px; background: rgba(255,255,255,.88); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(229,229,232,.9); }
.topbar-left { display:flex; align-items:center; gap:10px; }
.mobile-brand-icon { display:none; width:34px; height:34px; border-radius:10px; }
.page-eyebrow { color: var(--brand); font-size: 9.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.topbar h1 { margin-top:2px; font-size: 18px; font-weight: 800; letter-spacing: -.025em; }
.topbar-actions { gap: 9px; }
.quick-request { border-radius: 11px; padding: 9px 13px; box-shadow: 0 7px 18px rgba(213,29,59,.14); }
.notification-button { position:relative; display:grid; place-items:center; width:38px; height:38px; border:1px solid var(--line); border-radius:11px; background:#fff; color:#4c5057; }
.notification-button:hover { background:#fafafa; color:var(--brand); }
.topbar-icon { width:19px; height:19px; }
.notification-badge { position:absolute; top:-5px; right:-5px; min-width:18px; height:18px; display:grid; place-items:center; padding:0 4px; border:2px solid #fff; border-radius:999px; background:var(--brand); color:#fff; font-size:8px; font-weight:900; }
.user-box { border:1px solid var(--line); border-radius:12px; padding:5px 8px 5px 5px; background:#fff; }
.user-avatar { background: linear-gradient(145deg,#34363b,#5d6067); }

.dev-auth-badge { display:inline-flex; align-items:center; margin-left:5px; padding:2px 5px; border-radius:999px; background:#fff1d6; color:#9b6200; font-size:7px; font-style:normal; font-weight:900; letter-spacing:.04em; text-transform:uppercase; vertical-align:1px; }

.content-shell { max-width: 1440px; padding: 22px 24px 42px; }
.dashboard-head,.page-intro { margin-bottom:14px; }
.dashboard-head h2,.page-intro h2 { font-size: 24px; letter-spacing:-.035em; }
.dashboard-head p,.page-intro p { max-width:720px; }
.panel,.compact-card,.admin-card,.metric-card,.calendar-panel { border:1px solid #ececef; border-radius:16px; box-shadow: var(--shadow-card); }
.metric-grid { gap:10px; }
.metric-card { min-height:96px; padding:14px; }
.metric-icon { width:38px; height:38px; border-radius:11px; }
.metric-value { font-size:24px; letter-spacing:-.035em; }
.section-head h3 { font-size:13.5px; letter-spacing:-.01em; }
.primary,.secondary,.danger,.ghost { border-radius:10px; padding:9px 12px; }
.primary { box-shadow:0 7px 16px rgba(213,29,59,.12); }

.page-intro { display:flex; justify-content:space-between; align-items:flex-end; gap:18px; }
.page-intro h2 { margin:6px 0 4px; }
.page-intro p { margin:0; color:var(--muted); font-size:12px; line-height:1.55; }
.eyebrow-chip { display:inline-flex; align-items:center; border-radius:999px; padding:4px 7px; background:var(--brand-soft); color:var(--brand); font-size:8px; font-weight:900; letter-spacing:.1em; }
.premium-action { padding-inline:15px; }

.notification-panel { position:fixed; z-index:90; top:76px; right:18px; width:min(390px,calc(100vw - 28px)); max-height:calc(100vh - 94px); overflow:hidden; border:1px solid var(--line); border-radius:18px; background:#fff; box-shadow:0 24px 70px rgba(24,26,31,.18); }
.notification-panel-head { display:flex; justify-content:space-between; align-items:center; padding:15px 16px 12px; border-bottom:1px solid var(--line); }
.notification-panel-head span,.notification-panel-head strong { display:block; }
.notification-panel-head span { color:var(--brand); font-size:8px; font-weight:900; letter-spacing:.1em; text-transform:uppercase; }
.notification-panel-head strong { margin-top:3px; font-size:14px; }
.notification-list { max-height:520px; overflow:auto; padding:7px; }
.notification-row { width:100%; display:grid; grid-template-columns:34px 1fr; gap:10px; align-items:start; border:0; border-radius:12px; padding:10px; background:transparent; text-align:left; }
.notification-row:hover { background:#f8f8f9; }
.notification-row.unread { background:#fff5f7; }
.notification-row-icon { width:32px; height:32px; display:grid; place-items:center; border-radius:10px; background:#f2f3f5; color:var(--brand); }
.notification-row-copy strong,.notification-row-copy span,.notification-row-copy small { display:block; }
.notification-row-copy strong { font-size:11.5px; }
.notification-row-copy span { margin-top:3px; color:#5c6169; font-size:10.5px; line-height:1.4; }
.notification-row-copy small { margin-top:5px; color:#999da4; font-size:9px; }
.notification-read-all { width:100%; border:0; border-top:1px solid var(--line); padding:11px; background:#fff; color:var(--brand); font-size:10.5px; font-weight:800; }
.mini-icon { width:16px; height:16px; }

.feed-layout { display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:14px; align-items:start; }
.feed-stream { display:grid; gap:11px; }
.feed-card { position:relative; padding:17px 18px; border:1px solid var(--line); border-radius:16px; background:#fff; box-shadow:var(--shadow-card); overflow:hidden; }
.feed-card.important:before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--brand); }
.feed-card-top,.feed-card-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.feed-meta { display:flex; align-items:center; gap:9px; }
.feed-avatar { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; background:#f1f2f4; color:#545860; font-size:10px; font-weight:900; }
.feed-meta strong,.feed-meta span { display:block; }
.feed-meta strong { font-size:11px; }
.feed-meta span { margin-top:2px; color:var(--muted); font-size:9px; }
.feed-tags { display:flex; gap:5px; }
.mini-tag { border-radius:999px; padding:4px 7px; background:#f1f2f4; color:#5c6168; font-size:8.5px; font-weight:850; }
.danger-tag { background:var(--brand-soft); color:var(--brand-dark); }
.feed-card h3 { margin:14px 0 6px; font-size:16px; letter-spacing:-.02em; }
.feed-card p { margin:0; color:#4e5259; font-size:11.5px; line-height:1.65; }
.feed-card-footer { margin-top:15px; padding-top:11px; border-top:1px solid var(--line); color:var(--muted); font-size:9.5px; }
.feed-actions { display:flex; align-items:center; gap:8px; }
.read-ok { color:var(--success); font-weight:800; }
.text-danger { border:0; background:none; color:var(--brand); font-size:9.5px; font-weight:800; }
.feed-side-card { position:sticky; top:92px; padding:18px; border:1px solid var(--line); border-radius:16px; background:linear-gradient(145deg,#fff,#fbfbfc); box-shadow:var(--shadow-card); }
.feed-side-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:13px; background:var(--brand-soft); color:var(--brand); }
.side-card-icon { width:21px; height:21px; }
.feed-side-card h3 { margin:13px 0 6px; font-size:13.5px; }
.feed-side-card p { margin:0; color:var(--muted); font-size:10.5px; line-height:1.55; }
.premium-empty { min-height:220px; display:grid; place-items:center; align-content:center; gap:5px; }
.premium-empty strong,.premium-empty span { display:block; }

.chat-page { min-height:calc(100vh - 135px); display:grid; grid-template-columns:310px minmax(0,1fr); border:1px solid var(--line); border-radius:18px; overflow:hidden; background:#fff; box-shadow:var(--shadow-card); }
.chat-list-panel { min-width:0; border-right:1px solid var(--line); background:#fbfbfc; }
.chat-list-head { display:flex; justify-content:space-between; align-items:center; padding:15px 14px 10px; }
.chat-list-head h2 { margin:4px 0 0; font-size:18px; letter-spacing:-.03em; }
.round-add { width:34px; height:34px; border:0; border-radius:11px; background:var(--brand); color:#fff; font-size:20px; line-height:1; }
.chat-search { display:grid; grid-template-columns:18px 1fr; gap:7px; align-items:center; margin:0 12px 10px; padding:8px 10px; border:1px solid var(--line); border-radius:11px; background:#fff; color:#8d9198; }
.chat-search input { border:0; outline:0; min-width:0; background:transparent; font-size:10.5px; }
.chat-thread-list { padding:0 7px 10px; }
.chat-thread { width:100%; display:grid; grid-template-columns:40px minmax(0,1fr) auto; gap:9px; align-items:center; border:0; border-radius:12px; padding:9px; background:transparent; text-align:left; }
.chat-thread:hover { background:#f2f3f5; }
.chat-thread.active { background:#fff0f3; }
.chat-thread-avatar { width:38px; height:38px; display:grid; place-items:center; border-radius:13px; background:linear-gradient(145deg,#efeff1,#dfe1e5); color:#4a4d52; font-size:10px; font-weight:900; }
.chat-thread-avatar.large { width:40px; height:40px; }
.chat-thread-copy { min-width:0; }
.chat-thread-copy strong,.chat-thread-copy span { display:block; }
.chat-thread-copy strong { font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-thread-copy span { margin-top:3px; color:var(--muted); font-size:9.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-thread-side { display:grid; justify-items:end; gap:5px; color:#9b9ea4; font-size:8.5px; }
.chat-thread-side b { min-width:17px; height:17px; display:grid; place-items:center; border-radius:999px; padding:0 4px; background:var(--brand); color:#fff; font-size:8px; }
.chat-conversation { min-width:0; display:grid; grid-template-rows:auto minmax(0,1fr) auto; background:#fff; }
.chat-conversation-head { display:flex; align-items:center; gap:10px; padding:12px 15px; border-bottom:1px solid var(--line); }
.chat-conversation-head strong,.chat-conversation-head span { display:block; }
.chat-conversation-head strong { font-size:12px; }
.chat-conversation-head span { margin-top:2px; color:var(--muted); font-size:9.5px; }
.chat-messages { min-height:420px; max-height:calc(100vh - 275px); overflow:auto; padding:20px; background:linear-gradient(180deg,#fcfcfd,#fff); }
.chat-message-row { display:flex; margin:7px 0; }
.chat-message-row.mine { justify-content:flex-end; }
.chat-bubble { max-width:min(74%,620px); padding:9px 11px 6px; border-radius:14px 14px 14px 5px; background:#f0f1f3; color:#303238; font-size:11px; line-height:1.5; }
.chat-message-row.mine .chat-bubble { border-radius:14px 14px 5px 14px; background:var(--brand); color:#fff; }
.chat-bubble small { display:block; margin-top:4px; text-align:right; opacity:.67; font-size:8px; }
.chat-composer { display:grid; grid-template-columns:minmax(0,1fr) 40px; gap:8px; align-items:end; padding:11px 12px; border-top:1px solid var(--line); }
.chat-composer textarea { max-height:130px; resize:none; border:1px solid var(--line-strong); border-radius:13px; padding:10px 11px; outline:none; font-size:11px; }
.chat-send { width:40px; height:40px; display:grid; place-items:center; border:0; border-radius:12px; background:var(--brand); color:#fff; }
.send-icon { width:18px; height:18px; }
.chat-empty-state { place-self:center; max-width:340px; padding:30px; text-align:center; }
.chat-empty-state img { width:74px; height:74px; border-radius:20px; }
.chat-empty-state h3 { margin:14px 0 6px; font-size:17px; }
.chat-empty-state p { margin:0 0 15px; color:var(--muted); font-size:10.5px; line-height:1.55; }
.chat-first-message,.chat-list-empty { color:var(--muted); font-size:10.5px; text-align:center; padding:30px 10px; }
.person-picker-search input { width:100%; border:1px solid var(--line-strong); border-radius:11px; padding:10px 11px; }
.person-picker { display:grid; gap:3px; margin-top:10px; max-height:430px; overflow:auto; }
.person-picker-row { display:grid; grid-template-columns:40px 1fr auto; gap:10px; align-items:center; border:0; border-radius:12px; padding:8px; background:transparent; text-align:left; }
.person-picker-row:hover { background:#f5f5f6; }
.person-picker-row strong,.person-picker-row small { display:block; }
.person-picker-row strong { font-size:11px; }
.person-picker-row small { margin-top:2px; color:var(--muted); font-size:9.5px; }
.person-picker-row i { color:#a2a5aa; font-size:20px; font-style:normal; }

.transfer-card { border-color:#f1e3e6; background:linear-gradient(145deg,#fff,#fffafb); }
.task-count { min-width:27px; height:27px; display:grid; place-items:center; border-radius:10px; background:var(--brand-soft); color:var(--brand); font-weight:900; font-size:11px; }
.transfer-list { display:grid; }
.transfer-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-top:1px solid var(--line); }
.transfer-row:first-child { border-top:0; }
.transfer-row strong,.transfer-row span { display:block; }
.transfer-row strong { font-size:10.5px; }
.transfer-row span { margin-top:3px; color:var(--muted); font-size:9.5px; }
.task-done-state { padding:10px 0 2px; color:var(--success); font-size:10.5px; font-weight:750; }
.empty-state-mini { padding:18px 10px; color:var(--muted); text-align:center; font-size:10.5px; }
.modal-lead { margin:-5px 0 14px; color:var(--muted); font-size:10.5px; line-height:1.55; }

@media (max-width:1080px) {
  .app-frame { grid-template-columns:82px minmax(0,1fr); }
  .brand-main-logo,.brand-copy,.sidebar-footer-copy { display:none; }
  .brand-appline { justify-content:center; margin:0; }
  .brand-icon { width:40px; height:40px; }
  .feed-layout { grid-template-columns:1fr; }
  .feed-side-card { position:static; }
}

@media (max-width:760px) {
  body { padding-bottom:67px; }
  .sidebar { width:250px; }
  .sidebar .brand-main-logo,.sidebar .brand-copy,.sidebar .sidebar-footer-copy { display:block; }
  .brand-appline { justify-content:flex-start; }
  .topbar { min-height:60px; padding:8px 12px; }
  .mobile-brand-icon { display:block; }
  .topbar-left { gap:8px; }
  .topbar h1 { font-size:16px; }
  .notification-button { width:36px; height:36px; }
  .content-shell { padding:14px 11px 26px; }
  .page-intro { align-items:flex-start; flex-direction:column; }
  .page-intro .premium-action { width:100%; }
  .dashboard-head h2,.page-intro h2 { font-size:21px; }
  .notification-panel { top:66px; right:8px; width:calc(100vw - 16px); max-height:calc(100vh - 138px); }
  .feed-card { padding:14px; border-radius:14px; }
  .feed-card-top,.feed-card-footer { align-items:flex-start; }
  .feed-card-footer { flex-direction:column; }
  .chat-page { min-height:calc(100vh - 145px); grid-template-columns:1fr; border-radius:14px; }
  .chat-list-panel { border-right:0; }
  .chat-conversation { display:none; }
  .chat-page.has-active .chat-list-panel { display:none; }
  .chat-page.has-active .chat-conversation { display:grid; }
  .chat-messages { min-height:calc(100vh - 285px); max-height:calc(100vh - 285px); }
  .chat-bubble { max-width:85%; }
  .transfer-row { align-items:flex-start; flex-direction:column; }
  .transfer-row .secondary { width:100%; }
}
.chat-back { display:none; width:32px; height:32px; border:0; border-radius:10px; background:#f2f3f5; color:#4b4f55; }
@media (max-width:760px) { .chat-back { display:grid; place-items:center; } }
.setup-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.setup-tile,.setup-link-card { width:100%; display:grid; grid-template-columns:46px minmax(0,1fr) auto; gap:12px; align-items:center; border:1px solid var(--line); border-radius:16px; padding:17px; background:#fff; box-shadow:var(--shadow-card); text-align:left; transition:.16s ease; }
.setup-tile:hover,.setup-link-card:hover { transform:translateY(-1px); border-color:#e2d4d8; box-shadow:0 14px 32px rgba(32,33,36,.07); }
.setup-tile-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:13px; background:var(--brand-soft); color:var(--brand); }
.setup-icon { width:21px; height:21px; }
.setup-tile-copy strong,.setup-tile-copy small,.setup-link-card strong,.setup-link-card small { display:block; }
.setup-tile-copy strong,.setup-link-card strong { font-size:12px; color:var(--ink); }
.setup-tile-copy small,.setup-link-card small { margin-top:4px; color:var(--muted); font-size:9.5px; line-height:1.45; }
.setup-tile i,.setup-link-card i { color:#aaaeb4; font-size:20px; font-style:normal; }
.setup-detail-head { display:flex; align-items:center; gap:14px; margin-bottom:14px; }
.setup-detail-head h2 { margin:4px 0 0; font-size:22px; letter-spacing:-.03em; }
.setup-detail { max-width:1100px; }
.setup-section-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.chip-list { display:flex; flex-wrap:wrap; gap:7px; margin:13px 0; }
.department-chip { display:inline-flex; padding:6px 9px; border-radius:999px; background:#f2f3f5; color:#555a61; font-size:9.5px; font-weight:800; }
.feature-status { display:flex; align-items:center; gap:7px; margin-top:14px; color:#4f5359; font-size:10px; }
.status-dot { width:8px; height:8px; border-radius:50%; background:#b8bbc1; }
.status-dot.success { background:var(--success); }
.status-dot.warning { background:#e4a109; }
.compact-toggle { padding:9px 10px; }
@media (max-width:980px) { .setup-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) { .setup-grid,.setup-section-grid { grid-template-columns:1fr; } .setup-detail-head { align-items:flex-start; } }
.group-create-link { width:100%; margin-bottom:10px; border:1px solid #f0d7dc; border-radius:11px; padding:10px; background:#fff7f8; color:var(--brand); font-size:10.5px; font-weight:800; text-align:left; }
.group-member-picker { max-height:360px; overflow:auto; display:grid; gap:3px; padding:4px 0; }
.group-member-row { display:grid; grid-template-columns:18px 38px 1fr; gap:9px; align-items:center; padding:7px; border-radius:11px; }
.group-member-row:hover { background:#f6f6f7; }
.group-member-row strong,.group-member-row small { display:block; }
.group-member-row strong { font-size:10.5px; }.group-member-row small { margin-top:2px; color:var(--muted); font-size:9px; }

/* =========================================================
   V9 – Responsive UX pass: readable on phone, calm on desktop
   ========================================================= */
:root {
  --content-max: 1680px;
  --text-sm: 12.5px;
  --text-md: 14px;
  --text-lg: 16px;
  font-family: "Avenir Next", "Montserrat", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { font-size: 16px; }
body { font-size: var(--text-md); line-height: 1.45; color: var(--ink); }
.content-shell { max-width: var(--content-max); padding: clamp(18px, 2vw, 34px) clamp(18px, 2.2vw, 38px) 48px; }
.app-frame { grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { padding: 18px 14px; }
.brand-main-logo { height: 88px; object-fit: contain; object-position: left center; }
.brand-appline { margin-top: 10px; }
.brand-copy strong { font-size: 14px; }
.brand-copy span { font-size: 11.5px; line-height: 1.35; }
.nav-item { min-height: 44px; font-size: 13.5px; font-weight: 700; }
.sidebar-footer-copy { font-size: 10.5px; }
.sidebar-footer-copy strong { font-size: 11.5px; }

.topbar { min-height: 72px; padding-inline: clamp(18px, 2vw, 34px); }
.page-eyebrow { font-size: 10px; }
.topbar h1 { font-size: 19px; }
.user-copy strong { font-size: 12.5px; }
.user-copy span { font-size: 11px; }
.quick-request { min-height: 40px; font-size: 12.5px; }

.dashboard-head h2,.page-intro h2 { font-size: clamp(24px, 2vw, 30px); font-weight: 760; }
.dashboard-head p,.page-intro p { font-size: 13px; line-height: 1.55; }
.dashboard-head-v9 .eyebrow-chip { margin-bottom: 7px; }
.metric-grid { gap: 12px; }
.metric-card { min-height: 104px; padding: 16px; }
.metric-label { font-size: 12px; }
.metric-value { font-size: 25px; font-weight: 800; }
.metric-sub { font-size: 11.5px; line-height: 1.35; }
.metric-icon { width: 42px; height: 42px; flex-basis: 42px; }
.panel { padding: 20px; }
.compact-card { padding: 17px; }
.section-head h2 { font-size: 17px; }
.section-head h3 { font-size: 14.5px; }
.section-head p,.muted,.calendar-subtitle { font-size: 11.5px; line-height: 1.45; }
.section-link { font-size: 11.5px; }

.dashboard-grid-v9 { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .72fr); gap: 16px; }
.dashboard-side-v9 { min-width: 0; }

/* Dashboard timeline – intentionally not a full calendar */
.upcoming-overview { overflow: hidden; }
.upcoming-head { margin-bottom: 13px; }
.upcoming-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(88px, 1fr);
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 10px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.upcoming-day {
  min-width: 88px;
  min-height: 88px;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 3px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.upcoming-day:disabled { cursor: default; opacity: .72; }
.upcoming-day.has-events { border-color: #efcfd4; background: #fffafb; }
.upcoming-day.today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.upcoming-weekday { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.upcoming-day strong { font-size: 14px; letter-spacing: -.02em; }
.upcoming-day small { color: var(--muted); font-size: 10px; }
.upcoming-dots { min-height: 10px; display: flex; gap: 3px; align-items: center; }
.upcoming-list { display: grid; border-top: 1px solid var(--line); padding-top: 5px; }
.upcoming-row {
  width: 100%; display: grid; grid-template-columns: 4px minmax(0,1fr) auto; gap: 10px; align-items: center;
  border: 0; border-bottom: 1px solid var(--line); padding: 10px 2px; background: transparent; text-align: left;
}
.upcoming-row:last-child { border-bottom: 0; }
.upcoming-row strong,.upcoming-row small { display: block; }
.upcoming-row strong { font-size: 12.5px; }
.upcoming-row small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.upcoming-row i { color: #9aa0a6; font-size: 18px; font-style: normal; }
.upcoming-empty { padding: 16px 4px 4px; color: var(--muted); font-size: 12px; }

/* Calendar only on its own page */
.calendar-page { padding: 0; }
.calendar-header-v9 { padding: 16px 18px; gap: 14px; }
.calendar-header-v9 h2 { font-size: 18px; }
.calendar-actions-v9 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.calendar-view-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f5f6f7; }
.calendar-view-switch button { min-height: 34px; border: 0; border-radius: 8px; padding: 7px 12px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 800; }
.calendar-view-switch button.active { background: #fff; color: var(--brand); box-shadow: 0 2px 7px rgba(32,33,36,.08); }
.calendar-page .calendar { min-width: 0; }
.calendar-page .day-cell { appearance: none; width: 100%; min-height: 104px; border-left: 0; border-bottom: 0; text-align: left; color: inherit; font: inherit; }
.calendar-page .day-cell:not(.has-events) { cursor: default; }
.calendar-page .day-cell:focus-visible { position: relative; z-index: 2; }
.calendar-agenda-view { display: none; padding: 6px 16px 16px; }
.calendar-page.view-agenda .calendar-month-view { display: none; }
.calendar-page.view-agenda .calendar-agenda-view { display: block; }
.calendar-page.view-month .calendar-month-view { display: block; }
.calendar-page.view-month .calendar-agenda-view { display: none; }
.calendar-page .mobile-agenda-list { display: grid; }
.calendar-page .mobile-agenda-row {
  width:100%; display:grid; grid-template-columns:4px minmax(0,1fr) auto; gap:11px; align-items:center;
  border:0; border-top:1px solid var(--line); padding:12px 2px; background:transparent; text-align:left;
}
.calendar-page .mobile-agenda-row:first-child { border-top:0; }
.calendar-page .mobile-agenda-copy strong { font-size:13px; }
.calendar-page .mobile-agenda-copy small { margin-top:3px; font-size:11.5px; color:var(--muted); }
.calendar-page .mobile-agenda-head { padding: 8px 0; font-size: 12px; font-weight: 800; color: #484c53; }

/* Readability */
.field label { font-size: 12px; }
.field input,.field select,.field textarea { min-height: 42px; padding: 10px 11px; font-size: 13.5px; }
.field textarea { min-height: 88px; }
.form-hint { font-size: 11.5px; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { font-size: 10.5px; line-height: 1.4; }
.primary,.secondary,.danger,.ghost { min-height: 40px; font-size: 12px; font-weight: 800; }
.queue-table th { font-size: 10px; }
.queue-table td { font-size: 12.5px; }
.badge { font-size: 10.5px; }
.request-title { font-size: 13.5px; }
.request-meta,.request-note { font-size: 11.5px; }
.side-main strong { font-size: 12.5px; }
.side-main span { font-size: 11px; }
.notice strong { font-size: 12.5px; }
.notice p { font-size: 11.5px; }
.admin-section-tab strong { font-size: 11.5px; }
.admin-section-tab small { font-size: 9.5px; }
.admin-card h3 { font-size: 14px; }
.mini-row { font-size: 11.5px; }
.mini-row .muted { font-size: 10.5px; }

/* Feed + chat readable without looking oversized */
.feed-card h3 { font-size: 17px; }
.feed-card p { font-size: 13px; line-height: 1.6; }
.feed-meta strong { font-size: 12px; }
.feed-meta span,.feed-card-footer { font-size: 10.5px; }
.chat-thread-copy strong { font-size: 12.5px; }
.chat-thread-copy span { font-size: 11px; }
.chat-conversation-head strong { font-size: 13px; }
.chat-conversation-head span { font-size: 11px; }
.chat-bubble { font-size: 13px; line-height: 1.48; }
.chat-composer textarea { font-size: 14px; }

@media (min-width: 1500px) {
  .content-shell { max-width: 1760px; }
  .dashboard-grid-v9 { grid-template-columns: minmax(0, 1.8fr) 340px; }
  .upcoming-rail { grid-auto-columns: minmax(96px, 1fr); }
}

@media (max-width: 1180px) {
  .app-frame { grid-template-columns: 82px minmax(0,1fr); }
  .brand-main-logo,.brand-copy,.sidebar-footer-copy { display:none; }
  .brand-appline { justify-content:center; margin:0; }
  .brand-icon { width:40px; height:40px; }
  .dashboard-grid-v9 { grid-template-columns: 1fr; }
  .dashboard-side-v9 { grid-template-columns: repeat(2,minmax(0,1fr)); display:grid; gap:12px; }
}

@media (max-width: 760px) {
  :root { --text-md: 15px; }
  html { font-size: 16px; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); font-size: 15px; }
  .app-frame { display: block; }
  .content-shell { padding: 14px 12px 96px; }
  .topbar { min-height: 62px; padding: 8px 11px; }
  .mobile-brand-icon { display: block; width: 36px; height: 36px; }
  .topbar h1 { font-size: 17px; line-height: 1.15; }
  .user-box { border: 0; padding: 0; background: transparent; }
  .user-avatar { width: 36px; height: 36px; font-size: 11px; }
  .notification-button { width: 38px; height: 38px; }

  .dashboard-head,.page-intro { margin-bottom: 12px; }
  .dashboard-head h2,.page-intro h2 { font-size: 23px; line-height: 1.1; }
  .dashboard-head p,.page-intro p { font-size: 13px; line-height: 1.5; }
  .eyebrow-chip { font-size: 9px; padding: 4px 7px; }

  .metric-grid {
    display: flex;
    overflow-x: auto;
    gap: 9px;
    margin: 0 -2px 13px;
    padding: 2px 2px 5px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .metric-grid::-webkit-scrollbar { display:none; }
  .metric-card { flex: 0 0 168px; min-height: 92px; padding: 13px; scroll-snap-align: start; }
  .metric-icon { display: grid; width: 34px; height: 34px; flex-basis:34px; }
  .metric-label { font-size: 11px; }
  .metric-value { font-size: 22px; }
  .metric-sub { font-size: 10.5px; }

  .dashboard-grid-v9,.dashboard-side-v9,.two-col,.admin-grid,.setup-section-grid { display:grid; grid-template-columns:1fr; gap:11px; }
  .panel { padding: 15px; border-radius: 15px; }
  .compact-card { padding: 14px; border-radius: 15px; }
  .section-head { align-items:flex-start; }
  .section-head h2 { font-size:17px; }
  .section-head h3 { font-size:14.5px; }
  .section-head p { font-size:11.5px; }
  .section-link { min-height: 36px; font-size: 11.5px; }

  .upcoming-overview { padding: 15px 0 8px; }
  .upcoming-overview .section-head { padding: 0 14px; }
  .upcoming-rail { grid-auto-columns: 92px; padding: 2px 14px 11px; }
  .upcoming-day { min-width: 92px; min-height: 88px; padding: 10px; }
  .upcoming-list { margin: 0 14px; }
  .upcoming-row strong { font-size: 13px; }
  .upcoming-row small { font-size: 11.5px; line-height:1.35; }

  /* Calendar defaults to list on phone, month remains available */
  .calendar-page { border-radius: 15px; }
  .calendar-header-v9 { padding: 14px; align-items:flex-start; flex-direction:column; }
  .calendar-header-v9 h2 { font-size: 18px; }
  .calendar-actions-v9 { width: 100%; justify-content: space-between; gap: 8px; }
  .calendar-view-switch { flex:1; }
  .calendar-view-switch button { flex:1; min-height: 38px; font-size:12px; }
  .calendar-actions-v9 .toolbar { flex: 0 0 auto; }
  .calendar-actions-v9 .toolbar .secondary { display:none; }
  .calendar-page .calendar { width:100%; min-width:0; }
  .calendar-weekdays div { padding: 7px 2px; font-size: 10.5px; }
  .calendar-page .day-cell { min-height: 58px; padding: 6px 4px; }
  .calendar-page .day-number { font-size: 11.5px; }
  .calendar-page .desktop-events { display:none; }
  .calendar-page .mobile-event-dots { display:flex; flex-wrap:wrap; gap:2px; margin-top:6px; }
  .event-dot { width:6px; height:6px; border-radius:50%; }
  .calendar-agenda-view { padding: 4px 13px 14px; }
  .calendar-page .mobile-agenda-row { padding: 12px 1px; }
  .calendar-page .mobile-agenda-copy strong { font-size:13.5px; }
  .calendar-page .mobile-agenda-copy small { font-size:11.5px; white-space:normal; line-height:1.4; }
  .legend { gap:8px 11px; padding:10px 13px; font-size:10.5px; }

  .field { gap:6px; }
  .field label { font-size: 12.5px; }
  .field input,.field select,.field textarea { min-height: 46px; padding: 11px 12px; font-size: 16px; border-radius: 11px; }
  .field textarea { min-height: 96px; }
  .form-hint { font-size: 12px; }
  .inline-fields { gap: 9px; }
  .toggle-row { padding: 10px; }
  .toggle-row strong { font-size: 12.5px; }
  .toggle-row small { font-size: 11px; }
  .form-actions { display:grid; grid-template-columns:1fr; }
  .form-actions button { width:100%; min-height:46px; }
  .primary,.secondary,.danger,.ghost { min-height:42px; font-size:12.5px; }

  /* Tables become readable request cards instead of tiny horizontal spreadsheets */
  .table-scroll { overflow: visible; }
  .queue-table,.queue-table tbody,.queue-table tr,.queue-table td { display:block; width:100%; }
  .queue-table thead { display:none; }
  .queue-table { min-width:0; border-collapse:separate; }
  .queue-table tr { margin-bottom:10px; padding:12px; border:1px solid var(--line); border-radius:13px; background:#fff; }
  .queue-table td { display:grid; grid-template-columns:100px minmax(0,1fr); gap:10px; align-items:center; padding:5px 0; border:0; font-size:12.5px; }
  .queue-table td::before { content:attr(data-label); color:var(--muted); font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; }
  .queue-table td:last-child { display:block; padding-top:10px; }
  .queue-table td:last-child::before { display:none; }
  .queue-actions { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
  .queue-actions button { width:100%; }

  .request-title { font-size: 13.5px; line-height:1.4; }
  .request-meta,.request-note { font-size: 11.5px; line-height:1.45; }

  .admin-section-nav { display:flex; overflow-x:auto; grid-template-columns:none; padding:5px; gap:4px; scroll-snap-type:x proximity; }
  .admin-section-tab { flex:0 0 148px; min-height:58px; padding:8px 9px; scroll-snap-align:start; }
  .admin-section-tab strong { font-size:11px; }
  .admin-section-tab small { font-size:9px; }
  .admin-card { padding:14px; }
  .admin-card h3 { font-size:14.5px; }
  .mini-row { align-items:flex-start; }

  .feed-card { padding: 14px; }
  .feed-card h3 { font-size: 17px; }
  .feed-card p { font-size: 13px; }
  .feed-meta strong { font-size:12.5px; }
  .feed-meta span { font-size:10.5px; }

  .chat-page { min-height:calc(100dvh - 142px); border-radius:14px; }
  .chat-thread { padding:10px; }
  .chat-thread-copy strong { font-size:13px; }
  .chat-thread-copy span { font-size:11.5px; }
  .chat-messages { min-height:calc(100dvh - 285px); max-height:calc(100dvh - 285px); padding:14px 10px; }
  .chat-bubble { max-width:88%; font-size:13.5px; padding:10px 12px 7px; }
  .chat-composer textarea { font-size:16px; min-height:44px; }

  .modal-backdrop { align-items:end; padding:0; }
  .modal { width:100%; max-height:92dvh; border-radius:20px 20px 0 0; padding:18px 15px calc(18px + env(safe-area-inset-bottom)); }
  .modal-content h3 { font-size:18px; }
  .modal-event strong { font-size:13px; }
  .modal-event span { font-size:11.5px; }

  .mobile-nav { min-height:64px; }
  .mobile-nav-item { font-size:11px; font-weight:750; }
  .mobile-nav-icon { width:20px; height:20px; }
  .mobile-request { right:12px; bottom:calc(70px + env(safe-area-inset-bottom)); min-height:44px; padding:0 14px; font-size:12px; }
}

@media (max-width: 430px) {
  .topbar-left > div:last-child { min-width:0; }
  .topbar h1 { max-width: 165px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .metric-card { flex-basis: 156px; }
  .inline-fields { grid-template-columns:1fr; }
  .queue-table td { grid-template-columns:86px minmax(0,1fr); }
  .queue-actions { grid-template-columns:1fr; }
  .calendar-actions-v9 { align-items:stretch; flex-direction:column; }
  .calendar-actions-v9 .toolbar { display:grid; grid-template-columns:1fr 1fr; width:100%; }
  .calendar-actions-v9 .toolbar .ghost { width:100%; }
}

/* Shared status markers used by V9 timeline and agenda on every viewport */
.upcoming-dots .event-dot,.calendar-agenda-view .event-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:#c8ccd2; }
.event-dot.approved { background:var(--success); }
.event-dot.submitted { background:#e6a400; }
.event-dot.reviewer_approved { background:var(--brand); }
.event-dot.block { background:var(--danger); }
.event-dot.intensive { background:var(--info); }
.event-dot.course { background:#7d8490; }
.mobile-agenda-accent { width:4px; height:34px; border-radius:4px; background:#adb2ba; }
.mobile-agenda-accent.approved { background:var(--success); }
.mobile-agenda-accent.submitted { background:#e6a400; }
.mobile-agenda-accent.reviewer_approved { background:var(--brand); }
.mobile-agenda-accent.block { background:var(--danger); }
.mobile-agenda-accent.intensive { background:var(--info); }
.mobile-agenda-accent.course { background:#7d8490; }

/* =========================================================
   V10 – klare Informationsarchitektur + echtes Responsive UI
   ========================================================= */
:root {
  --app-max: 1540px;
  --radius-card: 16px;
  --text-base: 14px;
  --text-small: 12px;
  --text-tiny: 11px;
  font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
}

html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
body { font-size: var(--text-base); color: var(--ink); }
.app-frame, .workspace, .content-shell, #app { min-width: 0; max-width: 100%; }

/* Branding: eine starke Markenfläche statt doppelter Logos */
.app-frame { grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { padding: 18px 14px 16px; }
.brand-block { display: grid; gap: 8px; justify-items: start; padding: 2px 8px 18px; }
.brand-main-logo { display: block !important; width: min(100%, 190px); height: 72px; object-fit: contain; object-position: left center; mix-blend-mode: multiply; }
.brand-product { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .02em; }
.brand-appline, .brand-copy { display: none !important; }
.sidebar-footer-copy { font-size: 10.5px; }

.topbar { min-height: 64px; padding: 10px 22px; }
.topbar-left { min-width: 0; }
.topbar-title-wrap { min-width: 0; }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 780; line-height: 1.1; letter-spacing: -.025em; }
.page-eyebrow, .quick-request { display: none !important; }

.content-shell { width: 100%; max-width: var(--app-max); margin: 0 auto; padding: 22px 24px 42px; }

/* Grundgrößen: lesbar, aber nicht übergroß */
.nav-item { font-size: 13px; }
.section-head h2, .section-head h3 { font-size: 15px; }
.section-head p { font-size: 11.5px; line-height: 1.45; }
.field label { font-size: 12.5px; }
.field input, .field select, .field textarea { font-size: 14px; min-width: 0; }
.primary, .secondary, .danger, .ghost { font-size: 12.5px; }

/* Dashboard: kein zweites Seiten-Heading, sondern sofort Inhalt */
.dashboard-head { display: none; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  overflow: visible;
}
.metric-card { min-height: 88px; padding: 14px 15px; }
.metric-label { font-size: 11.5px; }
.metric-value { font-size: 24px; }
.metric-sub { font-size: 11px; }

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr);
  gap: 14px;
  align-items: start;
}
.dashboard-layout-balanced > * { min-width: 0; }
.dashboard-primary-card { min-width: 0; }
.dashboard-work-group + .dashboard-work-group { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.dashboard-work-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dashboard-work-title strong { font-size: 12px; }
.dashboard-work-title span { min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-alt); color: var(--muted); font-size: 11px; font-weight: 850; }
.compact-empty { padding: 16px 12px; }

/* Nächste 14 Tage: echte Liste statt horizontalem Mini-Kalender */
.upcoming-list-card { min-width: 0; }
.upcoming-list-clean { display: grid; }
.upcoming-row-clean {
  width: 100%; min-width: 0; display: grid; grid-template-columns: 48px 4px minmax(0, 1fr) 18px;
  gap: 10px; align-items: center; padding: 10px 0; border: 0; border-top: 1px solid var(--line);
  background: transparent; text-align: left; color: var(--ink);
}
.upcoming-row-clean:first-child { border-top: 0; }
.upcoming-row-clean:hover { background: #fbfbfc; }
.upcoming-date-box { width: 48px; display: grid; justify-items: center; gap: 1px; padding: 6px 4px; border-radius: 10px; background: var(--surface-alt); }
.upcoming-date-box strong { font-size: 15px; line-height: 1; }
.upcoming-date-box small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.upcoming-accent { width: 4px; height: 32px; border-radius: 999px; background: #cfd3d8; }
.upcoming-accent.approved { background: var(--success); }
.upcoming-accent.submitted { background: #e2a500; }
.upcoming-accent.reviewer_approved, .upcoming-accent.block { background: var(--brand); }
.upcoming-accent.intensive { background: var(--info); }
.upcoming-copy { min-width: 0; }
.upcoming-copy strong, .upcoming-copy small { display: block; overflow: hidden; text-overflow: ellipsis; }
.upcoming-copy strong { font-size: 12.5px; white-space: nowrap; }
.upcoming-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; white-space: normal; }
.row-chevron { color: #a6abb2; font-size: 18px; }
.upcoming-rail, .upcoming-list { display: none !important; }

/* Verwaltung = tägliche Vorgänge */
.operations-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.operation-summary-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-align: left;
  box-shadow: var(--shadow-soft);
}
.operation-summary-card:hover { border-color: #e1d9dc; }
.operation-summary-card.active { border-color: #f0cbd0; background: var(--brand-wash); }
.operation-summary-card span { font-size: 12.5px; font-weight: 750; }
.operation-summary-card strong { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-alt); font-size: 17px; }
.operation-summary-card.active strong { background: var(--brand-soft); color: var(--brand); }
.operations-panel { min-width: 0; }

/* Setup = Stammdaten und Regeln */
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; max-width: 1180px; }
.setup-tile, .setup-link-card { min-height: 96px; padding: 16px; border-radius: 15px; box-shadow: var(--shadow-soft); }
.setup-tile-copy strong { font-size: 13.5px; }
.setup-tile-copy small { margin-top: 4px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.setup-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.setup-detail-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.setup-section-stack { display: grid; gap: 14px; }
.setup-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-card { border-radius: 15px; padding: 16px; }
.admin-card h3 { font-size: 14.5px; }
.permission-item strong { font-size: 12px; }
.permission-item small { font-size: 10.5px; line-height: 1.4; }

/* Keine seitliche Scrollpflicht */
.table-scroll, .calendar-wrap { max-width: 100%; }
.calendar-page .calendar { width: 100%; max-width: 100%; }

/* Der Urlaub-Button lebt ausschließlich im Urlaub-Bereich */
.mobile-request { display: none !important; }

@media (min-width: 761px) and (max-width: 1180px) {
  .app-frame { grid-template-columns: 218px minmax(0, 1fr); }
  .sidebar { padding: 16px 12px; }
  .brand-main-logo { display: block !important; width: 170px; height: 64px; }
  .brand-product, .nav-item span, .sidebar-footer-copy { display: block !important; }
  .nav-item { justify-content: flex-start; padding: 10px 11px; }
  .dashboard-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); font-size: 15px; }
  .app-frame { display: block; }
  .workspace { width: 100%; min-width: 0; }

  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); height: 100dvh;
    padding: 18px 14px; transform: translateX(-105%); transition: transform .2s ease; z-index: 60;
  }
  .sidebar.open { transform: translateX(0); }
  .brand-main-logo { display: block !important; width: 190px; height: 72px; }
  .brand-product { display: block !important; }
  .sidebar .nav-item span, .sidebar .sidebar-footer-copy { display: block !important; }
  .sidebar .nav-item { justify-content: flex-start; }
  .sidebar-backdrop.show { display: block; z-index: 55; }

  .topbar { min-height: 58px; padding: 7px 10px; gap: 8px; }
  .menu-button { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; }
  .mobile-brand-icon { display: block; width: 34px; height: 34px; flex: 0 0 34px; }
  .topbar h1 { max-width: 42vw; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { gap: 6px; }
  .notification-button { width: 36px; height: 36px; flex: 0 0 36px; }
  .user-box { min-width: 0; grid-template-columns: 34px; border: 0; padding: 0; background: transparent; }
  .user-copy { display: none; }
  .user-avatar { width: 34px; height: 34px; }

  .content-shell { width: 100%; padding: 13px 11px 84px; overflow: hidden; }
  .panel, .compact-card, .admin-card { border-radius: 14px; padding: 14px; }

  /* Keine horizontalen KPI-Karussells */
  .metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 11px; padding: 0; overflow: visible; }
  .metric-card { min-width: 0; min-height: 86px; padding: 11px; gap: 8px; }
  .metric-icon { width: 32px; height: 32px; flex: 0 0 32px; }
  .metric-label { font-size: 10.5px; line-height: 1.25; }
  .metric-value { font-size: 21px; }
  .metric-sub { font-size: 10px; line-height: 1.25; }

  .dashboard-layout, .dashboard-layout-balanced, .two-col, .admin-grid, .setup-section-grid { grid-template-columns: 1fr; gap: 10px; }
  .section-head { align-items: center; gap: 8px; }
  .section-head h2, .section-head h3 { font-size: 14.5px; }
  .section-head p { font-size: 11px; }
  .section-link { font-size: 11.5px; white-space: nowrap; }

  .upcoming-row-clean { grid-template-columns: 44px 4px minmax(0, 1fr) 14px; gap: 8px; padding: 10px 0; }
  .upcoming-date-box { width: 44px; }
  .upcoming-copy strong { font-size: 13px; white-space: normal; }
  .upcoming-copy small { font-size: 11.5px; }

  /* Tabellen werden zu Cards, niemals seitlich scrollen */
  .table-scroll { overflow: visible !important; width: 100%; }
  .queue-table, .queue-table tbody, .queue-table tr, .queue-table td { display: block; width: 100%; max-width: 100%; }
  .queue-table { min-width: 0 !important; border-collapse: separate; }
  .queue-table thead { display: none; }
  .queue-table tr { margin-bottom: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .queue-table td { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; padding: 5px 0; border: 0; font-size: 12.5px; overflow-wrap: anywhere; }
  .queue-table td::before { content: attr(data-label); color: var(--muted); font-size: 10.5px; font-weight: 800; }
  .queue-table td:last-child { display: block; padding-top: 9px; }
  .queue-table td:last-child::before { display: none; }
  .queue-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .queue-actions > * { min-width: 0; width: 100%; }

  /* Setup-Kacheln und Verwaltung ohne horizontales Tab-Scrolling */
  .operations-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .operation-summary-card { min-width: 0; min-height: 58px; padding: 10px 11px; }
  .operation-summary-card span { font-size: 11.5px; }
  .operation-summary-card strong { min-width: 30px; height: 30px; font-size: 15px; }
  .setup-grid { grid-template-columns: 1fr; gap: 9px; }
  .setup-tile { min-height: 82px; grid-template-columns: 42px minmax(0, 1fr) 14px; gap: 10px; padding: 13px; }
  .setup-tile-icon { width: 40px; height: 40px; }
  .setup-tile-copy strong { font-size: 13px; }
  .setup-tile-copy small { font-size: 11px; }
  .setup-detail-head { align-items: center; }
  .setup-detail-head h2 { font-size: 18px; }

  .inline-fields, .three-col, .planning-form-grid, .limit-week-toolbar, .day-limit-grid { grid-template-columns: 1fr !important; }
  .field input, .field select, .field textarea { width: 100%; min-width: 0; font-size: 16px; min-height: 46px; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
  .form-actions button { width: 100%; min-height: 44px; }
  .mini-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .mini-row > button { width: 100%; }
  .permission-item { padding: 10px; }
  .permission-item strong { font-size: 12.5px; }
  .permission-item small { font-size: 11px; }

  /* Kalender: Liste ist Standard; Monatsansicht passt trotzdem in die Breite */
  .calendar-wrap { overflow: hidden !important; }
  .calendar-page .calendar { min-width: 0 !important; width: 100% !important; }
  .calendar-page .day-cell { min-width: 0; min-height: 54px; padding: 5px 3px; }
  .calendar-weekdays div { min-width: 0; padding: 6px 1px; font-size: 10px; }
  .calendar-header-v9 { padding: 12px; }
  .calendar-actions-v9 { width: 100%; flex-wrap: wrap; }
  .calendar-view-switch { width: 100%; }
  .calendar-view-switch button { flex: 1; }

  /* Chat/Feed dürfen die Viewport-Breite nie sprengen */
  .feed-layout, .chat-page, .chat-list-panel, .chat-conversation, .chat-thread, .feed-card { min-width: 0; max-width: 100%; }
  .chat-page { width: 100%; overflow: hidden; }
  .chat-bubble { overflow-wrap: anywhere; }

  .mobile-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-flow: unset; grid-auto-columns: unset;
    width: 100%; overflow: hidden; padding-inline: 4px;
  }
  .mobile-nav-item { min-width: 0; width: 100%; padding: 5px 2px; font-size: 10.5px; }
  .mobile-nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 82px; padding: 10px; }
  .metric-icon { display: none; }
  .operations-summary { grid-template-columns: 1fr; }
  .topbar h1 { max-width: 34vw; }
}

/* =========================================================
   V11 – ruhige Typografie, rollenbasierte UX, moderner Kalender
   ========================================================= */
:root {
  --brand: #ef4451;
  --brand-dark: #c92f3f;
  --brand-soft: #fff0f2;
  --ink: #202226;
  --muted: #747a84;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body { font-weight: 400; letter-spacing: 0; }
h1,h2,h3,h4,.topbar h1,.dashboard-head h2,.page-intro h2 { font-weight: 700 !important; letter-spacing: -.02em; }
strong { font-weight: 650; }
button,.nav-item,.mobile-nav-item,.metric-label,.badge,.field label { font-weight: 600; }
.nav-item { font-size: 13.5px; }
.topbar h1 { font-size: 19px; }
.section-head h2 { font-size: 18px; }
.section-head h3 { font-size: 15px; }
.section-head p,.form-hint,.muted { font-weight: 400; }
.user-box { cursor: pointer; border-radius: 12px; padding: 5px 7px; transition: background .15s ease; }
.user-box:hover { background: var(--surface-hover); }
.user-avatar,.chat-thread-avatar,.profile-avatar { overflow: hidden; }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Urlaub – bewusst wie ein Konto, nicht wie Dashboard-Spielerei */
.dashboard-section { margin-bottom: 14px; }
.clean-head { margin-bottom: 10px; }
.vacation-stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.vacation-stat {
  min-width: 0; padding: 14px 15px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-soft);
}
.vacation-stat span,.vacation-stat strong,.vacation-stat small { display:block; }
.vacation-stat span { color: var(--muted); font-size: 11px; font-weight: 600; }
.vacation-stat strong { margin-top: 4px; font-size: 24px; line-height: 1; font-weight: 700; color: var(--ink); }
.vacation-stat small { margin-top: 6px; color: var(--muted); font-size: 10.5px; font-weight: 400; }

/* Chefin / Verwaltung: nur operative Hinweise, keine großen Misch-Kacheln */
.workflow-bar {
  display:flex; align-items:center; gap:8px; margin-bottom:12px; padding:8px; background:#fff; border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-soft);
}
.workflow-bar-title { padding:0 7px; color:var(--muted); font-size:11px; font-weight:600; }
.workflow-bar button { display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:150px; padding:9px 11px; border:0; border-radius:10px; background:var(--surface-alt); color:var(--ink); }
.workflow-bar button:hover { background:var(--brand-soft); }
.workflow-bar button span { font-size:11.5px; }
.workflow-bar button strong { min-width:25px; height:25px; display:grid; place-items:center; border-radius:8px; background:#fff; color:var(--brand); font-size:13px; }

/* Moderner Kalender: kompakter Monat + Tagesdetails */
.calendar-page-v11 { display:grid; gap:12px; }
.calendar-toolbar-v11 { display:flex; justify-content:space-between; align-items:center; gap:14px; }
.calendar-title-v11 { display:flex; align-items:center; gap:12px; }
.calendar-title-v11 h2 { margin:0; font-size:22px; }
.calendar-nav-v11 { display:flex; gap:6px; }
.icon-only { width:36px; height:36px; padding:0; display:grid; place-items:center; }
.modern-calendar-layout { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(250px,.65fr); gap:12px; align-items:start; }
.modern-month-card { padding:12px; overflow:hidden; }
.modern-weekdays,.modern-month-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.modern-weekdays { color:var(--muted); font-size:10px; font-weight:600; text-align:center; padding:0 3px 6px; }
.modern-weekdays div { padding:5px 0; }
.modern-month-grid { gap:4px; }
.modern-day {
  position:relative; min-width:0; min-height:62px; display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between;
  padding:7px; border:1px solid transparent; border-radius:11px; background:#fafbfc; color:var(--ink); text-align:left;
}
.modern-day:hover { background:#f5f6f8; }
.modern-day.outside { opacity:.38; background:transparent; }
.modern-day.today { box-shadow:inset 0 0 0 1px rgba(239,68,81,.45); }
.modern-day.selected { border-color:rgba(239,68,81,.5); background:var(--brand-soft); }
.modern-day-number { font-size:11px; font-weight:650; }
.modern-day-dots { display:flex; gap:3px; min-height:7px; align-items:center; }
.modern-day small { align-self:flex-end; color:var(--muted); font-size:8.5px; }
.event-dot { width:6px; height:6px; border-radius:50%; display:inline-block; background:#b8bdc5; }
.event-dot.approved { background:var(--success); }
.event-dot.submitted { background:#e3a700; }
.event-dot.reviewer_approved,.event-dot.block { background:var(--brand); }
.event-dot.intensive { background:var(--info); }
.calendar-day-panel { min-height:325px; padding:16px; }
.calendar-day-panel-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-bottom:12px; border-bottom:1px solid var(--line); }
.calendar-day-panel-head span { font-size:13px; font-weight:650; }
.calendar-day-panel-head strong { min-width:28px; height:28px; display:grid; place-items:center; border-radius:9px; background:var(--surface-alt); font-size:12px; }
.calendar-day-events { display:grid; gap:0; }
.calendar-day-event { display:grid; grid-template-columns:4px minmax(0,1fr); gap:9px; padding:12px 0; border-bottom:1px solid var(--line); }
.calendar-day-event:last-child { border-bottom:0; }
.calendar-day-event strong,.calendar-day-event small { display:block; }
.calendar-day-event strong { font-size:12px; font-weight:650; }
.calendar-day-event small { margin-top:3px; color:var(--muted); font-size:10.5px; }
.calendar-day-empty { padding:24px 0; color:var(--muted); font-size:11.5px; }
.calendar-legend-v11 { display:flex; flex-wrap:wrap; gap:10px 13px; margin-top:10px; color:var(--muted); font-size:9.5px; }
.calendar-legend-v11 span { display:inline-flex; align-items:center; gap:5px; }
.calendar-legend-v11 i { width:7px; height:7px; border-radius:50%; background:#bbb; }
.calendar-legend-v11 i.approved { background:var(--success); }
.calendar-legend-v11 i.submitted { background:#e3a700; }
.calendar-legend-v11 i.reviewer_approved,.calendar-legend-v11 i.block { background:var(--brand); }
.calendar-legend-v11 i.intensive { background:var(--info); }
.calendar-page-v11.view-agenda .calendar-month-view { display:none; }
.calendar-page-v11.view-month .calendar-agenda-view { display:none; }

/* Profil */
.profile-modal { display:grid; gap:16px; }
.profile-hero { display:flex; align-items:center; gap:14px; }
.profile-avatar { width:72px; height:72px; flex:0 0 72px; display:grid; place-items:center; border-radius:50%; background:#eef0f3; color:#5f6570; font-size:20px; font-weight:650; }
.profile-hero h3 { margin:0; font-size:18px; }
.profile-hero p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.profile-data { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.profile-data div { padding:11px 12px; border:1px solid var(--line); border-radius:11px; background:var(--surface-alt); }
.profile-data span,.profile-data strong { display:block; }
.profile-data span { color:var(--muted); font-size:10px; }
.profile-data strong { margin-top:3px; font-size:11.5px; overflow-wrap:anywhere; }
.profile-photo-actions { display:flex; flex-wrap:wrap; gap:8px; }
.profile-upload-label { display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.profile-help { margin:0; color:var(--muted); font-size:10.5px; line-height:1.45; }

/* Chat mit Bildern */
.chat-attach { width:38px; height:38px; display:grid; place-items:center; flex:0 0 38px; border:0; border-radius:10px; background:var(--surface-alt); color:#626873; }
.chat-attach:hover { background:var(--brand-soft); color:var(--brand); }
.chat-message-image { display:block; width:min(320px,70vw); max-height:360px; object-fit:cover; border-radius:10px; margin-bottom:7px; }
.chat-bubble:has(.chat-message-image) { padding:6px; }

@media (max-width: 900px) {
  .vacation-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .modern-calendar-layout { grid-template-columns:1fr; }
  .calendar-day-panel { min-height:0; }
}

@media (max-width: 760px) {
  body { font-size:14px; font-weight:400; }
  .topbar h1 { font-size:18px !important; font-weight:700 !important; }
  .mobile-nav-item { font-size:10px !important; font-weight:600 !important; }
  .nav-item { font-weight:600; }
  .section-head h2,.section-head h3 { font-weight:700 !important; }
  .queue-table td::before { font-weight:600; }
  .badge { font-weight:600; }
  .primary,.secondary,.ghost { font-weight:650; }
  .vacation-stat { padding:12px; }
  .vacation-stat strong { font-size:21px; }
  .workflow-bar { display:grid; grid-template-columns:1fr; gap:5px; padding:7px; }
  .workflow-bar-title { padding:4px 6px 2px; }
  .workflow-bar button { width:100%; min-width:0; }
  .calendar-toolbar-v11 { align-items:stretch; flex-direction:column; gap:9px; }
  .calendar-title-v11 { justify-content:space-between; }
  .calendar-title-v11 h2 { font-size:19px; }
  .calendar-view-switch { width:100%; }
  .calendar-view-switch button { flex:1; min-height:38px; }
  .modern-month-card { padding:8px; }
  .modern-month-grid { gap:2px; }
  .modern-day { min-height:49px; padding:5px 4px; border-radius:8px; }
  .modern-day-number { font-size:10.5px; }
  .event-dot { width:5px; height:5px; }
  .calendar-legend-v11 { padding:0 2px; }
  .profile-data { grid-template-columns:1fr; }
  .profile-photo-actions { display:grid; grid-template-columns:1fr; }
  .profile-photo-actions > * { width:100%; }
  .chat-message-image { width:min(270px,68vw); max-height:300px; }
}

@media (max-width: 390px) {
  .vacation-stat-grid { gap:7px; }
  .vacation-stat span { font-size:10px; }
  .vacation-stat strong { font-size:19px; }
  .vacation-stat small { font-size:9.5px; }
}

/* =========================================================
   V12 – Medienpool / Team Cloud
   ========================================================= */
.media-hero { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:12px; }
.media-hero-copy { max-width:760px; }
.media-hero-copy h2 { margin:5px 0 4px; font-size:24px; font-weight:700; letter-spacing:-.025em; }
.media-hero-copy p { margin:0; color:var(--muted); font-size:12.5px; line-height:1.55; }
.button-icon { width:17px; height:17px; vertical-align:-3px; margin-right:6px; }
.media-upload-main { white-space:nowrap; min-height:40px; }

.media-storage { margin-bottom:12px; display:grid; gap:9px; }
.media-storage-copy { display:flex; align-items:end; justify-content:space-between; gap:14px; }
.media-storage-copy strong { font-size:14px; font-weight:650; }
.media-storage-copy span { color:var(--muted); font-size:10.5px; text-align:right; }
.media-storage-track { height:7px; overflow:hidden; border-radius:999px; background:#eef0f3; }
.media-storage-track i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--brand),#ff7a78); }
.media-storage-meta { display:flex; justify-content:space-between; gap:10px; color:var(--muted); font-size:10px; }

.media-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; padding:12px; }
.media-search { min-width:240px; flex:1; display:flex; align-items:center; gap:8px; border:1px solid var(--line); background:var(--surface-alt); border-radius:11px; padding:0 11px; }
.media-search input { width:100%; min-height:38px; border:0; outline:0; background:transparent; color:var(--ink); }
.media-filter-row { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
.media-filter { border:1px solid var(--line); border-radius:999px; background:#fff; color:#5f6570; padding:7px 10px; font-size:10.5px; font-weight:600; }
.media-filter.active { border-color:rgba(239,68,81,.24); background:var(--brand-soft); color:var(--brand); }

.media-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.media-card { padding:0; overflow:hidden; min-width:0; }
.media-preview { position:relative; aspect-ratio:16/10; background:#f0f2f4; overflow:hidden; }
.media-preview > img,.media-preview > video { width:100%; height:100%; object-fit:cover; display:block; background:#15171a; }
.media-kind-badge { position:absolute; top:9px; left:9px; padding:4px 7px; border-radius:999px; background:rgba(22,24,28,.74); color:#fff; font-size:8.5px; font-weight:650; letter-spacing:.08em; backdrop-filter:blur(7px); }
.media-file-placeholder { height:100%; display:grid; place-items:center; align-content:center; gap:6px; color:#686f79; background:linear-gradient(135deg,#f7f8fa,#eceff2); }
.media-placeholder-icon { width:36px; height:36px; }
.media-file-placeholder strong { font-size:13px; font-weight:650; }
.media-file-placeholder span { font-size:9px; letter-spacing:.08em; }
.media-card-body { padding:13px; display:grid; gap:10px; }
.media-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.media-title-row h3 { margin:0; font-size:13.5px; font-weight:650; line-height:1.25; overflow-wrap:anywhere; }
.media-title-row p { margin:3px 0 0; color:var(--muted); font-size:9.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:190px; }
.media-status { flex:0 0 auto; padding:4px 7px; border-radius:999px; font-size:8.5px; font-weight:600; background:#eef0f3; color:#636a74; }
.media-status.status-new { background:var(--info-soft); color:var(--info); }
.media-status.status-in_progress { background:var(--warning-soft); color:#8a5a00; }
.media-status.status-used { background:var(--success-soft); color:var(--success); }
.media-status.status-archived { background:#eef0f3; color:#69707a; }
.media-note { margin:0; color:#555c66; font-size:10.5px; line-height:1.45; }
.media-badges { display:flex; flex-wrap:wrap; gap:5px; }
.media-badges span { padding:4px 7px; border-radius:999px; background:#f3f4f6; color:#626974; font-size:8.5px; font-weight:550; }
.media-badges .ok { background:var(--success-soft); color:var(--success); }
.media-badges .warn { background:var(--warning-soft); color:#8a5a00; }
.media-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; color:var(--muted); font-size:9.5px; border-top:1px solid var(--line); padding-top:9px; }
.media-meta > span:first-child { display:flex; align-items:center; min-width:0; }
.media-uploader-avatar { width:22px; height:22px; flex:0 0 22px; margin-right:6px; border-radius:50%; display:grid; place-items:center; overflow:hidden; background:#eef0f3; color:#555c66; font-size:7.5px; font-weight:650; }
.media-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.media-download { text-decoration:none; display:inline-flex; align-items:center; justify-content:center; }
.media-status-select { min-height:33px; padding:6px 28px 6px 9px; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--ink); font-size:10px; }
.media-empty { grid-column:1/-1; min-height:260px; display:grid; place-items:center; align-content:center; text-align:center; gap:8px; }
.media-empty h3 { margin:0; font-size:17px; }
.media-empty p { margin:0 0 5px; color:var(--muted); font-size:11px; }
.media-empty-icon { width:54px; height:54px; display:grid; place-items:center; border-radius:16px; background:var(--brand-soft); color:var(--brand); }
.media-empty-svg { width:26px; height:26px; }

.media-upload-modal { display:grid; gap:14px; }
.modal-title-block h3 { margin:5px 0 3px; font-size:18px; }
.modal-title-block p { margin:0; color:var(--muted); font-size:11px; line-height:1.5; }
.media-dropzone { min-height:150px; display:grid; place-items:center; align-content:center; gap:5px; padding:18px; border:1.5px dashed #d7dbe1; border-radius:14px; background:#fafbfc; text-align:center; cursor:pointer; }
.media-dropzone:hover { border-color:rgba(239,68,81,.45); background:var(--brand-wash); }
.media-drop-icon { width:28px; height:28px; color:var(--brand); }
.media-dropzone strong { font-size:13px; font-weight:650; }
.media-dropzone span { color:var(--muted); font-size:10.5px; }
.media-dropzone small { color:#9aa0a9; font-size:9.5px; }
.media-selected-files { display:grid; gap:5px; }
.media-selected-files > div { display:grid; grid-template-columns:22px minmax(0,1fr) auto; align-items:center; gap:7px; padding:8px 9px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.media-selected-files strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10.5px; font-weight:600; }
.media-selected-files small { color:var(--muted); font-size:9.5px; }
.media-upload-progress { padding:10px; border-radius:10px; background:#f7f8fa; }
.upload-progress-copy { display:flex; justify-content:space-between; gap:10px; margin-bottom:7px; font-size:10px; }
.upload-progress-copy strong { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.upload-progress-copy span { color:var(--muted); }
.upload-progress-track { height:7px; overflow:hidden; border-radius:999px; background:#e9ebee; }
.upload-progress-track i { display:block; height:100%; border-radius:inherit; background:var(--brand); transition:width .2s ease; }

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

@media (max-width: 760px) {
  .media-hero { align-items:stretch; flex-direction:column; padding:15px; }
  .media-hero-copy h2 { font-size:20px; }
  .media-hero-copy p { font-size:12px; }
  .media-upload-main { width:100%; }
  .media-storage-copy { align-items:flex-start; flex-direction:column; gap:3px; }
  .media-storage-copy span { text-align:left; }
  .media-toolbar { align-items:stretch; flex-direction:column; }
  .media-search { min-width:0; width:100%; }
  .media-filter-row { flex-wrap:nowrap; overflow-x:auto; justify-content:flex-start; scrollbar-width:none; padding-bottom:2px; }
  .media-filter-row::-webkit-scrollbar { display:none; }
  .media-filter { flex:0 0 auto; }
  .media-grid { grid-template-columns:1fr; }
  .media-preview { aspect-ratio:16/9; }
  .media-title-row p { max-width:230px; }
  .media-actions { display:grid; grid-template-columns:1fr; }
  .media-actions > * { width:100%; }
  .media-meta { align-items:flex-start; flex-direction:column; }
  .media-upload-modal-root .modal { width:min(100%,680px); }
}


/* V12.1 – Video preview hotfix */
.media-video-modal-root .modal-card { width:min(980px, calc(100vw - 32px)); }
.media-video-modal { display:grid; gap:16px; }
.media-video-stage { background:#0f1114; border-radius:18px; overflow:hidden; aspect-ratio:16/9; display:grid; place-items:center; }
.media-video-stage video { width:100%; height:100%; object-fit:contain; background:#0f1114; }
.media-video-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.media-video-footer > div { display:grid; gap:3px; min-width:0; }
.media-video-footer strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.media-video-footer span,.media-video-hint { color:var(--muted); font-size:.92rem; }
.media-video-hint { margin:0; line-height:1.5; }
@media (max-width:720px) {
  .media-video-modal-root .modal-card { width:100%; max-width:none; }
  .media-video-stage { border-radius:14px; }
  .media-video-footer { align-items:stretch; flex-direction:column; }
  .media-video-footer .primary { width:100%; text-align:center; }
}

/* V12.2 media upload queue + cross-device video fallback */
.media-dropzone.drag-active { border-color:var(--brand); background:var(--brand-wash); }
.media-selected-files > .media-selected-row { grid-template-columns:22px minmax(0,1fr) auto 28px; }
.media-selected-remove { width:28px; height:28px; border:0; border-radius:8px; background:#f5f6f8; color:#6f7680; font-size:18px; line-height:1; cursor:pointer; }
.media-selected-remove:hover { background:#feecee; color:var(--brand); }
.upload-result-summary { display:grid; gap:6px; }
.upload-result-summary span { color:var(--muted); font-size:.88rem; line-height:1.35; }
.media-video-unsupported { width:min(560px,calc(100% - 32px)); padding:22px; border-radius:16px; background:#fff; color:#20242a; display:grid; gap:10px; text-align:center; }
.media-video-unsupported[hidden] { display:none; }
.media-video-unsupported span { color:var(--muted); line-height:1.45; }
.media-video-unsupported .secondary { justify-self:center; }

/* =========================================================
   V13 – UX, Dashboard, Kalender, Chat & Mobile polish
   ========================================================= */

/* calmer typography */
body { font-weight: 400; }
.nav-item, .mobile-nav-item, .primary, .secondary, .danger, .ghost, .section-link, .field label, .badge { font-weight: 600 !important; }
.topbar h1, h1, h2, h3, h4 { font-weight: 700 !important; }
.user-avatar, .chat-thread-avatar, .metric-value, .request-title { font-weight: 700 !important; }
.muted, .request-meta, .field small, .toggle-row small, .setup-tile-copy small, .setup-link-card small { font-weight: 400 !important; }

/* universal overflow protection */
.content-shell, #app, .panel, .admin-card, form, .field, .inline-fields, .three-col,
.setup-detail, .setup-section-stack, .setup-section-grid, .planning-form-grid, .limit-week-toolbar,
.chat-page, .chat-list-panel, .chat-conversation, .rf-calendar-layout, .rf-calendar-card, .rf-day-panel {
  min-width: 0;
  max-width: 100%;
}
input, select, textarea, button { max-width: 100%; min-width: 0; }
.field input, .field select, .field textarea { min-width: 0; }

/* dashboard */
.dash-shell { display:grid; gap:14px; }
.dash-hero { padding: 4px 2px 2px; }
.dash-welcome { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.dash-welcome span { color:var(--muted); font-size:18px; }
.dash-welcome strong { font-size:28px; letter-spacing:-.035em; font-weight:700; }
.dash-hero p { margin:6px 0 0; color:var(--muted); font-size:13px; }
.dash-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-items:start; }
.dash-card { min-width:0; padding:17px; background:#fff; border:1px solid var(--line); border-radius:17px; box-shadow:var(--shadow-soft); }
.dash-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.dash-card-head h3 { margin:0; font-size:15px; font-weight:700; }
.dash-card-head button, .dash-card-head span { border:0; background:transparent; color:var(--brand); font-size:11.5px; font-weight:600; }
.dash-actions-card { padding:14px 17px; }
.dash-task-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.dash-task-item { display:flex; align-items:center; gap:10px; padding:11px 12px; border:1px solid var(--line); border-radius:13px; background:var(--surface-alt); }
.dash-task-item > span { width:34px; height:34px; display:grid; place-items:center; flex:0 0 34px; border-radius:10px; color:var(--brand); background:var(--brand-soft); }
.dash-task-icon { width:17px; height:17px; }
.dash-task-item strong, .dash-task-item small { display:block; }
.dash-task-item strong { font-size:18px; font-weight:700; line-height:1; }
.dash-task-item small { margin-top:3px; color:var(--muted); font-size:10.5px; }
.dash-today-list { display:grid; gap:8px; }
.dash-today-row { display:grid; grid-template-columns:5px minmax(0,1fr); gap:10px; align-items:center; padding:9px 0; border-top:1px solid var(--line); }
.dash-today-row:first-child { border-top:0; padding-top:0; }
.dash-today-row i { width:5px; height:34px; border-radius:999px; background:#9ca2ab; }
.dash-today-row i.approved{background:var(--success)} .dash-today-row i.submitted{background:#e2a500} .dash-today-row i.reviewer_approved{background:var(--brand)} .dash-today-row i.block{background:#d7374e} .dash-today-row i.intensive{background:#4d7fc6}
.dash-today-row strong,.dash-today-row span { display:block; }
.dash-today-row strong { font-size:12.5px; }
.dash-today-row span { margin-top:2px; color:var(--muted); font-size:10.5px; }
.dash-empty { padding:18px 4px; color:var(--muted); font-size:12px; line-height:1.45; }
.dash-weather { min-height:88px; display:flex; align-items:center; gap:14px; }
.dash-weather-temp { font-size:40px; line-height:1; letter-spacing:-.05em; font-weight:650; }
.dash-weather strong,.dash-weather span { display:block; }
.dash-weather strong { font-size:13px; }
.dash-weather span { margin-top:4px; color:var(--muted); font-size:11px; }
.dash-weather.unavailable > div:first-child { width:42px; height:42px; display:grid; place-items:center; color:#818792; background:var(--surface-alt); border-radius:12px; }
.dash-weather-icon { width:22px; height:22px; }
.dash-feed-list { display:grid; gap:1px; }
.dash-feed-row { width:100%; display:grid; grid-template-columns:4px minmax(0,1fr) auto; gap:10px; align-items:center; padding:9px 0; border:0; border-top:1px solid var(--line); background:transparent; text-align:left; }
.dash-feed-row:first-child { border-top:0; padding-top:0; }
.dash-feed-row > span { width:4px; height:30px; border-radius:999px; background:#c9cdd3; }
.dash-feed-row > span.important { background:var(--brand); }
.dash-feed-row strong,.dash-feed-row small { display:block; }
.dash-feed-row strong { font-size:12px; }
.dash-feed-row small { margin-top:2px; color:var(--muted); font-size:10px; }
.dash-feed-row b { color:#a0a5ad; font-size:17px; font-weight:400; }
.dash-media-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.dash-media-card { min-width:0; border:0; background:transparent; text-align:left; padding:0; }
.dash-media-thumb { aspect-ratio:1/1; border-radius:11px; overflow:hidden; display:grid; place-items:center; background:#f1f2f4; color:#777e88; }
.dash-media-thumb img { width:100%; height:100%; object-fit:cover; }
.dash-media-icon { width:22px; height:22px; }
.dash-media-thumb span { margin-top:3px; font-size:9px; }
.dash-media-card strong,.dash-media-card small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dash-media-card strong { margin-top:6px; font-size:10.5px; }
.dash-media-card small { margin-top:2px; color:var(--muted); font-size:9.5px; }
.dash-vacation-card .metric-grid { margin:0; grid-template-columns:repeat(4,minmax(0,1fr)); }
.dash-vacation-card .metric-card { min-height:76px; box-shadow:none; border-color:var(--line); padding:10px; }
.dash-vacation-card .metric-icon { display:none; }
.dash-vacation-card .metric-label { font-size:9.5px; }
.dash-vacation-card .metric-value { font-size:20px; }
.dash-vacation-card .metric-sub { display:none; }

/* operations */
.ops-board-head { margin-bottom:12px; }
.ops-board-head h2 { margin:0; font-size:24px; }
.ops-board-head p { margin:5px 0 0; color:var(--muted); font-size:12px; }
.ops-board { display:grid; gap:14px; }
.ops-board-card { padding:16px; }
.ops-board-card .dash-card-head > span { min-width:28px; height:28px; display:grid; place-items:center; border-radius:9px; background:var(--surface-alt); color:var(--muted); }
.ops-list { display:grid; gap:9px; }
.ops-request-card { border:1px solid var(--line); border-radius:13px; padding:12px; background:#fff; }
.ops-request-main { display:grid; grid-template-columns:minmax(150px,1.1fr) minmax(170px,1fr) auto; gap:12px; align-items:center; }
.ops-request-person strong,.ops-request-person span,.ops-request-range strong,.ops-request-range span { display:block; }
.ops-request-person strong,.ops-request-range strong { font-size:12px; }
.ops-request-person span,.ops-request-range span { margin-top:3px; color:var(--muted); font-size:10px; }
.ops-request-note,.ops-internal-note { margin-top:10px; padding:9px 10px; border-radius:10px; background:var(--surface-alt); }
.ops-internal-note { background:#fff8e8; border:1px solid #f3dfad; }
.ops-request-note span,.ops-internal-note span { display:flex; align-items:center; gap:5px; color:var(--muted); font-size:9.5px; font-weight:600; }
.ops-request-note p,.ops-internal-note p { margin:4px 0 0; font-size:11px; line-height:1.45; }
.ops-request-actions { margin-top:10px; display:flex; justify-content:flex-end; gap:7px; }

/* calendar */
.rf-calendar-page { display:grid; gap:12px; }
.rf-calendar-toolbar { display:flex; align-items:end; justify-content:space-between; gap:14px; }
.rf-calendar-kicker { color:var(--brand); font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.08em; }
.rf-calendar-toolbar h2 { margin:4px 0 0; font-size:25px; letter-spacing:-.035em; }
.rf-calendar-nav { display:flex; gap:6px; }
.rf-calendar-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:12px; align-items:start; }
.rf-calendar-card { padding:12px; }
.rf-cal-weekdays,.rf-cal-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.rf-cal-weekdays > div { padding:7px 0 9px; text-align:center; color:#8b9098; font-size:10px; font-weight:600; }
.rf-cal-grid { gap:4px; }
.rf-cal-day { position:relative; min-width:0; min-height:82px; border:1px solid transparent; border-radius:11px; padding:8px; display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between; background:#fafbfc; color:var(--ink); }
.rf-cal-day:hover { background:#f6f6f8; }
.rf-cal-day.outside { opacity:.35; }
.rf-cal-day.today { border-color:#f4b6bf; background:#fff7f8; }
.rf-cal-day.selected { border-color:var(--brand); background:#fff; box-shadow:0 3px 13px rgba(204,32,56,.08); }
.rf-cal-day.blocked::after { content:''; position:absolute; right:6px; top:6px; width:6px; height:6px; border-radius:50%; background:var(--brand); }
.rf-cal-number { width:28px; height:28px; display:grid; place-items:center; border-radius:9px; font-size:11px; font-weight:600; }
.rf-cal-day.today .rf-cal-number { background:var(--brand); color:#fff; }
.rf-cal-dots { min-height:9px; display:flex; gap:3px; align-items:center; }
.rf-cal-day small { color:var(--muted); font-size:8.5px; }
.event-dot { width:7px; height:7px; border-radius:50%; background:#a5abb3; }
.event-dot.approved{background:var(--success)} .event-dot.submitted{background:#e2a500} .event-dot.reviewer_approved{background:var(--brand)} .event-dot.block{background:#d7374e} .event-dot.intensive{background:#4d7fc6} .event-dot.course{background:#8a91a0}
.rf-cal-legend { display:flex; flex-wrap:wrap; gap:8px 12px; margin-top:10px; padding-top:9px; border-top:1px solid var(--line); color:var(--muted); font-size:9.5px; }
.rf-cal-legend span { display:inline-flex; align-items:center; gap:5px; }
.rf-cal-legend i { width:7px; height:7px; border-radius:50%; }
.rf-cal-legend i.approved{background:var(--success)} .rf-cal-legend i.submitted{background:#e2a500} .rf-cal-legend i.reviewer_approved{background:var(--brand)} .rf-cal-legend i.block{background:#d7374e} .rf-cal-legend i.intensive{background:#4d7fc6}
.rf-day-panel { padding:14px; position:sticky; top:88px; }
.rf-day-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-bottom:10px; border-bottom:1px solid var(--line); }
.rf-day-head span,.rf-day-head strong { display:block; }
.rf-day-head span { color:var(--muted); font-size:9.5px; text-transform:uppercase; letter-spacing:.06em; }
.rf-day-head strong { margin-top:3px; font-size:13px; }
.rf-day-head b { width:27px; height:27px; display:grid; place-items:center; border-radius:9px; background:var(--surface-alt); color:var(--muted); font-size:11px; }
.rf-day-events { display:grid; gap:7px; margin-top:10px; }
.rf-day-event { display:grid; grid-template-columns:4px minmax(0,1fr); gap:9px; align-items:center; padding:7px 0; }
.rf-day-event > i { width:4px; height:32px; border-radius:999px; background:#9ca2ab; }
.rf-day-event > i.approved{background:var(--success)} .rf-day-event > i.submitted{background:#e2a500} .rf-day-event > i.reviewer_approved{background:var(--brand)} .rf-day-event > i.block{background:#d7374e} .rf-day-event > i.intensive{background:#4d7fc6}
.rf-day-event strong,.rf-day-event small { display:block; }
.rf-day-event strong { font-size:11.5px; }
.rf-day-event small { margin-top:2px; color:var(--muted); font-size:9.5px; }
.rf-day-empty { color:var(--muted); font-size:11px; padding:12px 0; }

/* setup tiles */
.setup-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.setup-tile { min-height:120px; grid-template-columns:48px minmax(0,1fr); grid-template-rows:auto auto; align-content:start; position:relative; }
.setup-tile > i { position:absolute; right:14px; top:14px; }
.setup-tile-icon { width:46px; height:46px; }
.setup-tile-copy strong { font-size:14px; font-weight:650; }
.setup-tile-copy small { font-size:11px; font-weight:400; }

/* chat */
.chat-page { height:calc(100dvh - 125px); min-height:540px; }
.chat-conversation { min-height:0; }
.chat-messages { min-height:0; max-height:none; overflow:auto; }
.chat-composer { grid-template-columns:40px minmax(0,1fr) 42px; align-items:center; }
.chat-composer textarea { width:100%; min-height:42px; max-height:110px; }
.chat-back { flex:0 0 36px; width:36px; height:36px; }

/* media upload progress */
.upload-progress-copy { display:flex; justify-content:space-between; gap:10px; align-items:center; font-size:11px; }
.upload-progress-track { height:7px; margin-top:7px; overflow:hidden; border-radius:999px; background:#e6e8ec; }
.upload-progress-track i { display:block; height:100%; border-radius:999px; background:var(--brand); transition:width .15s linear; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns:1fr; }
  .rf-calendar-layout { grid-template-columns:1fr; }
  .rf-day-panel { position:static; }
  .setup-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .content-shell { padding:14px 14px calc(92px + env(safe-area-inset-bottom)); }
  .topbar { min-height:66px; padding:10px 14px; }
  .topbar h1 { font-size:19px; font-weight:650 !important; }
  .mobile-brand-icon { width:42px; height:42px; }
  .dash-shell { gap:11px; }
  .dash-hero { padding:1px 1px 2px; }
  .dash-welcome span { font-size:15px; }
  .dash-welcome strong { font-size:23px; font-weight:650; }
  .dash-hero p { font-size:12px; line-height:1.45; }
  .dash-grid { grid-template-columns:1fr; gap:10px; }
  .dash-card { padding:14px; border-radius:15px; }
  .dash-card-head h3 { font-size:14px; }
  .dash-task-row { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .dash-task-item { display:grid; grid-template-columns:1fr; justify-items:start; gap:6px; padding:10px; }
  .dash-task-item > span { width:30px; height:30px; }
  .dash-task-item strong { font-size:17px; }
  .dash-task-item small { font-size:9.5px; }
  .dash-media-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
  .dash-media-card strong { font-size:9.5px; }
  .dash-media-card small { display:none; }
  .dash-vacation-card .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }

  .ops-board-head h2 { font-size:21px; }
  .ops-request-main { grid-template-columns:1fr auto; }
  .ops-request-range { grid-column:1/-1; }
  .ops-request-actions { justify-content:stretch; }
  .ops-request-actions button { flex:1; }

  .rf-calendar-toolbar { align-items:center; }
  .rf-calendar-toolbar h2 { font-size:22px; }
  .rf-calendar-kicker { display:none; }
  .rf-calendar-card { padding:8px; }
  .rf-cal-weekdays > div { font-size:9.5px; }
  .rf-cal-grid { gap:2px; }
  .rf-cal-day { min-height:56px; border-radius:9px; padding:5px; }
  .rf-cal-number { width:23px; height:23px; border-radius:7px; font-size:10px; }
  .event-dot { width:6px; height:6px; }
  .rf-cal-legend { font-size:8.7px; gap:7px 10px; }
  .rf-day-panel { margin-top:0; }

  .setup-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .setup-tile { min-height:126px; padding:13px; grid-template-columns:1fr; grid-template-rows:auto auto; gap:9px; }
  .setup-tile-icon { width:42px; height:42px; }
  .setup-tile-copy strong { font-size:12.5px; }
  .setup-tile-copy small { font-size:10px; line-height:1.35; }
  .setup-tile > i { right:11px; top:11px; }

  .inline-fields, .three-col, .planning-form-grid, .limit-week-toolbar { grid-template-columns:1fr !important; }
  .admin-card, .panel { overflow:hidden; }
  .field input, .field select, .field textarea { width:100% !important; min-width:0 !important; max-width:100% !important; }
  input[type="date"] { display:block; min-width:0; width:100%; }
  .toggle-row { min-width:0; }

  .chat-page { height:calc(100dvh - 138px); min-height:0; border-radius:13px; }
  .chat-list-panel, .chat-conversation { height:100%; }
  .chat-conversation { grid-template-rows:auto minmax(0,1fr) auto; }
  .chat-messages { min-height:0 !important; max-height:none !important; height:auto; padding:12px 10px; }
  .chat-composer { position:sticky; bottom:0; grid-template-columns:40px minmax(0,1fr) 42px; gap:7px; padding:9px; background:#fff; }
  .chat-composer textarea { min-height:42px; font-size:16px; }
  .chat-conversation-head { padding:10px; }
  .chat-conversation-head strong { font-size:13px; font-weight:650; }
  .chat-conversation-head span { font-size:10.5px; }
}

@media (max-width: 380px) {
  .setup-grid { grid-template-columns:1fr; }
  .dash-task-row { grid-template-columns:1fr; }
  .dash-media-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

/* =========================================================
   V14 – Dashboard, Setup, Kalender, Refresh & Release Notes
   ========================================================= */
.notification-badge[hidden] { display:none !important; }
.refresh-button,.notification-button { position:relative; width:38px; height:38px; display:grid; place-items:center; border:1px solid var(--line); border-radius:11px; background:#fff; color:#525862; }
.refresh-button:hover,.notification-button:hover { background:var(--surface-hover); color:var(--ink); }
.refresh-button.is-refreshing svg { animation:rf-spin .75s linear infinite; }
@keyframes rf-spin { to { transform:rotate(360deg); } }

/* Dashboard */
.dash-hero { padding:2px 2px 4px; }
.dash-welcome { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px; }
.dash-welcome span { color:var(--muted); font-size:18px; font-weight:400; }
.dash-welcome strong { font-size:29px; font-weight:680; letter-spacing:-.04em; }
.dash-weather-hero { position:relative; overflow:hidden; min-height:132px; display:grid; grid-template-columns:74px minmax(0,1fr) auto; align-items:center; gap:18px; padding:20px 22px; border:1px solid #e8e9ed; border-radius:20px; background:linear-gradient(135deg,#fff 0%,#fbfcff 55%,#f4f7fb 100%); box-shadow:0 10px 28px rgba(31,34,39,.06); }
.dash-weather-hero::after { content:''; position:absolute; width:180px; height:180px; right:-65px; top:-75px; border-radius:50%; background:radial-gradient(circle,rgba(239,68,81,.11),rgba(239,68,81,0) 70%); pointer-events:none; }
.weather-symbol { width:64px; height:64px; display:grid; place-items:center; border-radius:18px; background:#fff; box-shadow:0 8px 22px rgba(31,34,39,.08); color:var(--brand); }
.weather-icon { width:34px; height:34px; }
.dash-weather-hero.sunny .weather-symbol { color:#e39a00; background:#fff9e8; }
.dash-weather-hero.rainy .weather-symbol,.dash-weather-hero.cloudy .weather-symbol,.dash-weather-hero.foggy .weather-symbol { color:#4e759e; background:#eef5fb; }
.dash-weather-hero.stormy .weather-symbol { color:#7657b6; background:#f3effd; }
.dash-weather-hero.snowy .weather-symbol { color:#4c8bc1; background:#eff8ff; }
.weather-main { min-width:0; }
.weather-label { display:block; color:var(--muted); font-size:11px; font-weight:600; }
.weather-main > div { margin-top:5px; display:flex; align-items:baseline; gap:12px; }
.weather-main strong { font-size:38px; line-height:1; font-weight:660; letter-spacing:-.05em; }
.weather-main span:last-child { color:#3f444c; font-size:15px; font-weight:500; }
.weather-meta { display:grid; gap:5px; justify-items:end; color:var(--muted); }
.weather-meta span { display:flex; align-items:center; gap:6px; font-size:11px; }
.weather-meta small { font-size:9.5px; }
.weather-meta-icon { width:15px; height:15px; }
.dash-grid-main { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
.dash-task-item { border:1px solid var(--line); cursor:pointer; text-align:left; }
.dash-task-item:hover { border-color:#f2c7cc; background:#fff8f9; }

/* Kalender – eindeutige Statusfarben */
.event-dot.approved,.rf-cal-legend i.approved,.rf-day-event > i.approved,.dash-today-row i.approved { background:#17865a !important; }
.event-dot.submitted,.rf-cal-legend i.submitted,.rf-day-event > i.submitted,.dash-today-row i.submitted { background:#e2a000 !important; }
.event-dot.reviewer_approved,.rf-cal-legend i.reviewer_approved,.rf-day-event > i.reviewer_approved,.dash-today-row i.reviewer_approved { background:#7657d8 !important; }
.event-dot.block,.rf-cal-legend i.block,.rf-day-event > i.block,.dash-today-row i.block { background:#d9364b !important; }
.event-dot.intensive,.rf-cal-legend i.intensive,.rf-day-event > i.intensive,.dash-today-row i.intensive { background:#2e79c8 !important; }
.rf-cal-day.blocked::after { background:#d9364b !important; }

/* Setup – Back button bleibt sichtbar */
.setup-detail-head { position:sticky; top:76px; z-index:8; margin:-4px 0 14px; padding:8px 0; background:linear-gradient(var(--surface-alt) 78%,rgba(247,248,250,0)); }
.setup-detail-head .secondary { box-shadow:0 4px 14px rgba(31,34,39,.05); }

/* Mitarbeiterverwaltung */
.employee-setup { display:grid; gap:14px; }
.employee-setup-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.employee-action-card { width:100%; display:grid; grid-template-columns:46px minmax(0,1fr) auto; gap:12px; align-items:center; padding:16px; border:1px solid var(--line); border-radius:16px; background:#fff; text-align:left; box-shadow:var(--shadow-soft); }
.employee-action-card:hover { border-color:#efc9ce; background:#fffafb; }
.employee-action-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:13px; color:var(--brand); background:var(--brand-soft); }
.employee-action-card strong,.employee-action-card small { display:block; }
.employee-action-card strong { font-size:13.5px; font-weight:650; }
.employee-action-card small { margin-top:4px; color:var(--muted); font-size:10.5px; line-height:1.4; }
.employee-action-card i { color:#a0a5ad; font-style:normal; font-size:20px; }
.employee-directory-card { overflow:visible; }
.employee-count,.planning-section-count { min-width:30px; height:30px; display:grid; place-items:center; border-radius:10px; background:var(--surface-alt); color:var(--muted); font-size:11px; font-weight:650; }
.employee-directory { display:grid; gap:2px; }
.employee-directory-row { display:grid; grid-template-columns:44px minmax(0,1fr) auto; gap:12px; align-items:center; padding:11px 0; border-top:1px solid var(--line); }
.employee-directory-row:first-child { border-top:0; }
.employee-directory-avatar { width:42px; height:42px; border-radius:50%; display:grid; place-items:center; overflow:hidden; background:#eef0f3; color:#59606a; font-size:11px; font-weight:650; }
.employee-directory-copy { min-width:0; }
.employee-directory-copy strong,.employee-directory-copy span,.employee-directory-copy small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.employee-directory-copy strong { font-size:12.5px; }
.employee-directory-copy span { margin-top:2px; color:#525861; font-size:10.5px; }
.employee-directory-copy small { margin-top:3px; color:var(--muted); font-size:9.5px; }
.rights-panel { border-color:#eadde0; }

/* Planung & Sperrzeiten */
.planning-admin-stack { display:grid; gap:14px; }
.planning-section { overflow:visible; }
.planning-section-count.warn { color:#8b5c00; background:#fff4d6; }
.planning-entry-list { display:grid; gap:2px; }
.planning-create-section { border-color:#eadde0; }
.planning-alert-section .planning-ok { margin:0; }
.planning-conflict-panel { margin:0; }

/* Abwesenheitslimits */
.limits-modern { max-width:980px; overflow:visible; }
.limits-week-card { display:grid; grid-template-columns:minmax(150px,.75fr) minmax(210px,1fr) minmax(320px,1.25fr); gap:14px; align-items:end; margin-bottom:14px; padding:14px; border:1px solid var(--line); border-radius:15px; background:var(--surface-alt); }
.limits-week-title span,.limits-week-title strong { display:block; }
.limits-week-title span { color:var(--muted); font-size:9.5px; text-transform:uppercase; letter-spacing:.06em; }
.limits-week-title strong { margin-top:4px; font-size:13px; }
.limits-base-control { display:grid; grid-template-columns:auto minmax(150px,190px); gap:6px 10px; align-items:center; }
.limits-base-control > span { grid-column:1/-1; color:var(--muted); font-size:10.5px; font-weight:600; }
.limit-stepper { display:grid; grid-template-columns:38px minmax(56px,74px) 38px; align-items:center; border:1px solid var(--line-strong); border-radius:11px; overflow:hidden; background:#fff; }
.limit-stepper button { height:40px; border:0; background:#f6f7f9; color:#444a52; font-size:20px; font-weight:400; }
.limit-stepper button:hover { background:var(--brand-soft); color:var(--brand); }
.limit-stepper input { width:100%; min-width:0; height:40px; padding:0 4px; border:0 !important; border-radius:0 !important; text-align:center; font-size:16px; font-weight:650; background:#fff; }
.limit-stepper input::-webkit-inner-spin-button,.limit-stepper input::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.limit-apply { min-height:40px; }
.day-limit-grid.modern { display:grid; gap:7px; grid-template-columns:1fr; overflow:visible; }
.limit-day-row { display:grid; grid-template-columns:minmax(130px,1fr) auto 92px; gap:12px; align-items:center; padding:11px 12px; border:1px solid var(--line); border-radius:13px; background:#fff; }
.limit-day-copy strong,.limit-day-copy span { display:block; }
.limit-day-copy strong { font-size:12px; }
.limit-day-copy span { margin-top:2px; color:var(--muted); font-size:9.5px; }
.limit-day-unit { color:var(--muted); font-size:9.5px; text-align:right; }
.limit-help.modern { display:flex; align-items:center; gap:10px; padding:10px 12px; }
.limit-help.modern strong { color:#aa2638; white-space:nowrap; }

/* Feed – weniger erklärend, mehr App */
.feed-layout { grid-template-columns:minmax(0,1fr) !important; max-width:980px; }
.feed-side-card { display:none !important; }
.feed-page-intro p { max-width:620px; }

/* Was gibt's Neues */
.whats-new-modal-root .modal { max-width:520px; }
.whats-new { display:grid; gap:12px; }
.whats-new-icon { width:52px; height:52px; display:grid; place-items:center; border-radius:15px; background:var(--brand-soft); color:var(--brand); }
.whats-new-svg { width:26px; height:26px; }
.whats-new h3 { margin:0; font-size:22px; }
.whats-new > p { margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
.whats-new-list { display:grid; gap:8px; }
.whats-new-list > div { display:grid; grid-template-columns:24px minmax(0,1fr); gap:8px; align-items:start; padding:9px 10px; border-radius:11px; background:var(--surface-alt); }
.whats-new-list i { width:22px; height:22px; display:grid; place-items:center; border-radius:50%; background:#e8f6ef; color:#15784f; font-size:11px; font-style:normal; }
.whats-new-list span { padding-top:2px; font-size:11px; line-height:1.45; }

/* Upload – multiple selection: file input has no native validation; queue drives validation */
.media-selected-files:empty { display:none; }

@media (max-width: 980px) {
  .dash-grid-main { grid-template-columns:1fr; }
  .limits-week-card { grid-template-columns:1fr 1fr; }
  .limits-base-control { grid-column:1/-1; grid-template-columns:minmax(150px,190px) 1fr; }
  .limits-base-control > span { grid-column:1/-1; }
}

@media (max-width: 760px) {
  .refresh-button,.notification-button { width:38px; height:38px; }
  .topbar-actions { gap:5px; }
  .user-box { min-width:0; }
  .dash-welcome span { font-size:15px; }
  .dash-welcome strong { font-size:24px; }
  .dash-weather-hero { min-height:118px; grid-template-columns:56px minmax(0,1fr); gap:12px; padding:15px; border-radius:17px; }
  .weather-symbol { width:52px; height:52px; border-radius:15px; }
  .weather-icon { width:28px; height:28px; }
  .weather-main strong { font-size:31px; }
  .weather-main span:last-child { font-size:13px; }
  .weather-meta { grid-column:2; grid-row:2; justify-items:start; display:flex; gap:12px; }
  .weather-meta small { display:none; }
  .dash-task-row { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dash-task-item { min-width:0; }

  .setup-detail-head { top:65px; margin:-7px -2px 10px; padding:8px 2px 10px; }
  .employee-setup-actions { grid-template-columns:1fr; }
  .employee-action-card { grid-template-columns:42px minmax(0,1fr) auto; padding:13px; }
  .employee-directory-row { grid-template-columns:42px minmax(0,1fr); gap:10px; padding:12px 0; }
  .employee-directory-row .employee-edit { grid-column:1/-1; width:100%; }
  .employee-directory-copy strong,.employee-directory-copy span,.employee-directory-copy small { white-space:normal; overflow:visible; }

  .planning-admin-stack { gap:10px; }
  .planning-section { padding:14px; }
  .planning-form-grid { grid-template-columns:1fr !important; }

  .limits-week-card { grid-template-columns:1fr; padding:12px; }
  .limits-base-control { grid-column:auto; grid-template-columns:1fr; }
  .limit-stepper.limit-base-stepper { width:100%; grid-template-columns:44px minmax(0,1fr) 44px; }
  .limit-apply { width:100%; }
  .limit-day-row { grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:10px; }
  .limit-day-unit { display:none; }
  .limit-stepper { grid-template-columns:38px 58px 38px; }
  .limit-help.modern { display:grid; gap:3px; }

  .rf-cal-legend { font-size:9px; }
  .whats-new h3 { font-size:20px; }
}

@media (max-width: 410px) {
  .topbar-left { gap:6px; }
  .mobile-brand-icon { width:38px; height:38px; }
  .topbar h1 { max-width:31vw; font-size:16.5px !important; }
  .refresh-button,.notification-button { width:36px; height:36px; }
  .user-avatar { width:34px; height:34px; }
  .dash-task-row { grid-template-columns:1fr; }
  .weather-main > div { gap:8px; }
}

/* =========================================================
   V15 – UX-Fixes, Polls, Standortwetter, Setup-Hubs
   ========================================================= */

/* Urlaub */
.vacation-metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.vacation-metric { min-width:0; padding:14px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.vacation-metric span,.vacation-metric strong,.vacation-metric small { display:block; }
.vacation-metric span { color:var(--muted); font-size:10.5px; font-weight:600; }
.vacation-metric strong { margin-top:5px; font-size:25px; line-height:1; font-weight:650; letter-spacing:-.035em; }
.vacation-metric small { margin-top:6px; color:var(--muted); font-size:9.5px; }

/* Wetter – fahrrelevante Informationen */
.dash-weather-hero { grid-template-columns:74px minmax(0,1fr) minmax(210px,auto); }
.weather-main > div:first-of-type { display:flex; }
.weather-driving { margin-top:9px; display:inline-flex !important; align-items:center; gap:7px !important; width:auto; max-width:100%; padding:6px 9px; border-radius:999px; background:#eef7f1; color:#176f4b; font-size:10.5px; font-weight:600; }
.weather-driving.warn { background:#fff4d8; color:#895b00; }
.weather-driving.danger { background:#fdecef; color:#a61d31; }
.weather-driving-icon { width:15px; height:15px; flex:0 0 15px; }
.weather-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 14px; color:#5f6670; font-size:10px; }
.weather-facts span { white-space:nowrap; }
.weather-facts b { color:#25282d; font-weight:650; }
.weather-location-button { position:absolute; right:16px; bottom:12px; border:0; border-radius:9px; padding:6px 9px; background:rgba(255,255,255,.8); color:#59606a; font-size:9.5px; font-weight:600; box-shadow:0 3px 10px rgba(31,34,39,.05); }
.weather-location-active { position:absolute; right:16px; bottom:12px; color:#5b626b; font-size:9px; }

/* Kalenderfarben – klar voneinander getrennt */
.event-dot.approved,.rf-cal-legend i.approved,.rf-day-event > i.approved,.dash-today-row i.approved { background:#1c8b58 !important; }
.event-dot.submitted,.rf-cal-legend i.submitted,.rf-day-event > i.submitted,.dash-today-row i.submitted { background:#e5a100 !important; }
.event-dot.reviewer_approved,.rf-cal-legend i.reviewer_approved,.rf-day-event > i.reviewer_approved,.dash-today-row i.reviewer_approved { background:#7c55d9 !important; }
.event-dot.block,.rf-cal-legend i.block,.rf-day-event > i.block,.dash-today-row i.block { background:#d92e45 !important; }
.event-dot.intensive,.rf-cal-legend i.intensive,.rf-day-event > i.intensive,.dash-today-row i.intensive { background:#2478c8 !important; }
.event-dot.course,.rf-cal-legend i.course,.rf-day-event > i.course,.dash-today-row i.course { background:#20a0a0 !important; }

/* Team Feed + Abstimmungen */
.feed-layout,.feed-stream,.feed-card,.feed-compose-form,.feed-compose-form .field,.feed-compose-form .inline-fields { min-width:0; max-width:100%; width:100%; }
.feed-card { overflow:hidden; }
.feed-card p { overflow-wrap:anywhere; }
.feed-compose-modal-root .modal { width:min(100%,680px); }
.feed-compose-form input,.feed-compose-form select,.feed-compose-form textarea { width:100%; min-width:0; max-width:100%; }
.feed-poll { display:grid; gap:9px; margin-top:13px; padding:12px; border:1px solid var(--line); border-radius:14px; background:var(--surface-alt); }
.feed-poll-head { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.feed-poll-head span { font-size:10px; font-weight:650; color:#4b515a; }
.feed-poll-head small,.feed-poll-note { color:var(--muted); font-size:9.5px; }
.feed-poll-options { display:grid; gap:7px; }
.feed-poll-option { width:100%; min-width:0; display:grid; gap:6px; padding:10px 11px; border:1px solid #e2e4e8; border-radius:11px; background:#fff; color:var(--ink); text-align:left; }
.feed-poll-option.selected { border-color:#ef9eaa; box-shadow:inset 0 0 0 1px #ef9eaa; }
.poll-option-main { display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0; }
.poll-option-main b { overflow:hidden; text-overflow:ellipsis; font-size:11px; font-weight:600; }
.poll-option-main em { flex:0 0 auto; color:var(--muted); font-size:9.5px; font-style:normal; }
.poll-bar { height:5px; overflow:hidden; border-radius:999px; background:#eceef1; }
.poll-bar i { display:block; height:100%; border-radius:999px; background:var(--brand); }
.poll-voters { display:block; overflow-wrap:anywhere; color:#636a74; font-size:9px; }
.poll-tag { background:#eef3ff !important; color:#365f9f !important; }
.poll-builder-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin:3px 0 8px; }
.poll-builder-head strong { font-size:11px; }
.poll-builder-options { display:grid; gap:7px; margin-bottom:10px; }
.poll-builder-row { display:grid; grid-template-columns:minmax(0,1fr) 38px; gap:7px; }
.poll-builder-row input { width:100%; min-width:0; }

/* Medienauswahl – iPhone robuster */
.media-picker-block { display:grid; gap:12px; padding:15px; border:1px dashed #cfd3da; border-radius:15px; background:#fafbfc; }
.media-picker-copy { display:grid; grid-template-columns:42px minmax(0,1fr); gap:11px; align-items:center; }
.media-picker-copy .media-drop-icon { width:34px; height:34px; color:var(--brand); }
.media-picker-copy strong,.media-picker-copy span,.media-picker-copy small { display:block; }
.media-picker-copy strong { font-size:12px; }
.media-picker-copy span { margin-top:3px; color:#555d67; font-size:10.5px; }
.media-picker-copy small { margin-top:3px; color:var(--muted); font-size:9.5px; }
.media-picker-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.media-picker-actions button { min-height:42px; }
.visually-hidden-file { position:fixed !important; left:-10000px !important; top:-10000px !important; width:1px !important; height:1px !important; opacity:.001 !important; pointer-events:none !important; }
.media-ios-note { margin:0; padding:9px 10px; border-radius:10px; background:#fff5dc; color:#775000; font-size:9.5px; line-height:1.45; }

/* Chat – Gruppen klar, Eingabe immer erreichbar */
.chat-thread-copy strong { display:flex; align-items:center; gap:7px; min-width:0; }
.chat-type-badge { display:inline-flex; align-items:center; flex:0 0 auto; padding:2px 6px; border-radius:999px; font-size:7.5px; font-style:normal; font-weight:650; }
.chat-type-badge.group { background:#eaf2fd; color:#356a9f; }
.chat-type-badge.direct { background:#f0f2f4; color:#626973; }
.group-avatar { color:#3b6fa0; background:#eef5fb; }
.chat-conversation { overflow:hidden; }
.chat-composer { z-index:4; }

/* Setup – Unterbereiche statt alles gleichzeitig */
.setup-detail-head { background:var(--surface-alt) !important; border-bottom:1px solid rgba(232,233,237,.88); }
.employee-hub-intro,.planning-hub-intro { padding:2px 2px 4px; }
.employee-hub-intro h3,.planning-hub-intro h3 { margin:0; font-size:16px; font-weight:650; }
.employee-hub-intro p,.planning-hub-intro p { margin:4px 0 0; color:var(--muted); font-size:10.5px; line-height:1.45; }
.employee-hub-cards,.planning-hub-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.employee-hub-card,.planning-hub-card { min-width:0; display:grid; grid-template-columns:42px minmax(0,1fr) auto; gap:10px; align-items:center; padding:14px; border:1px solid var(--line); border-radius:15px; background:#fff; box-shadow:var(--shadow-soft); text-align:left; }
.employee-hub-card:hover,.planning-hub-card:hover { border-color:#efcbd0; background:#fffafb; }
.employee-hub-card > span,.planning-hub-card > span { width:40px; height:40px; display:grid; place-items:center; border-radius:12px; background:var(--brand-soft); color:var(--brand); }
.employee-hub-icon,.planning-hub-icon { width:21px; height:21px; }
.employee-hub-card strong,.employee-hub-card small,.planning-hub-card strong,.planning-hub-card small { display:block; }
.employee-hub-card strong,.planning-hub-card strong { font-size:11.5px; font-weight:650; }
.employee-hub-card small,.planning-hub-card small { margin-top:3px; color:var(--muted); font-size:9.5px; line-height:1.35; }
.employee-hub-card > i,.planning-hub-card > i { color:#a3a8b0; font-style:normal; font-size:18px; }
.planning-hub-card.has-warning { border-color:#efcf86; background:#fffaf0; }
.subview-back { justify-self:start; border:0; border-radius:9px; padding:7px 10px; background:var(--brand-soft); color:var(--brand-dark); font-size:10.5px; font-weight:600; }
.rights-panel,.employee-directory-card,.planning-section { overflow:visible !important; }

/* Formulare grundsätzlich innerhalb der Cards halten */
.admin-card form,.panel form,.modal form,.field,.inline-fields,.three-col,.planning-form-grid,.limit-week-card,.limit-day-row { min-width:0; max-width:100%; }
.field input,.field select,.field textarea,.inline-fields > *,.three-col > * { min-width:0; max-width:100%; }

@media (max-width: 980px) {
  .vacation-metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .employee-hub-cards,.planning-hub-cards { grid-template-columns:1fr; }
}

@media (max-width: 760px) {
  .dash-weather-hero { grid-template-columns:52px minmax(0,1fr); gap:10px; padding:14px 14px 42px; }
  .weather-facts { grid-column:1/-1; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 9px; padding-top:2px; }
  .weather-facts span { white-space:normal; font-size:9.5px; }
  .weather-driving { font-size:9.5px; white-space:normal; border-radius:11px; }
  .weather-location-button,.weather-location-active { right:13px; bottom:11px; }

  .vacation-metric-grid { gap:8px; }
  .vacation-metric { padding:12px; }
  .vacation-metric strong { font-size:22px; }

  .feed-compose-modal-root .modal { width:100%; max-width:none; }
  .feed-card-top,.feed-card-footer,.poll-option-main { min-width:0; }
  .feed-card-footer { gap:8px; }
  .poll-builder-row { grid-template-columns:minmax(0,1fr) 36px; }

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

  .chat-page { height:calc(100dvh - 190px) !important; min-height:0 !important; }
  .chat-list-panel,.chat-conversation { min-height:0; }
  .chat-conversation { grid-template-rows:auto minmax(0,1fr) auto; }
  .chat-composer { position:relative !important; bottom:auto !important; padding:8px; border-top:1px solid var(--line); background:#fff; }
  .chat-messages { overflow:auto !important; overscroll-behavior:contain; }
  .chat-thread-copy strong { flex-wrap:wrap; gap:4px 6px; }

  .setup-detail-head { top:66px !important; margin:-14px -14px 12px !important; padding:10px 14px !important; }
  .setup-detail-head h2 { min-width:0; overflow-wrap:anywhere; }
  .employee-hub-card,.planning-hub-card { grid-template-columns:40px minmax(0,1fr) auto; padding:12px; }
  .employee-hub-card strong,.planning-hub-card strong { font-size:12px; }
  .employee-hub-card small,.planning-hub-card small { font-size:10px; }
  .rights-panel { padding:14px; }

  .limit-day-row { width:100%; }
  .limit-stepper { max-width:144px; justify-self:end; }
}

@media (max-width: 390px) {
  .weather-facts { grid-template-columns:1fr 1fr; }
  .vacation-metric strong { font-size:20px; }
  .chat-page { height:calc(100dvh - 184px) !important; }
}
@media (max-width: 760px) {
  .chat-page { height:calc(100dvh - 230px) !important; min-height:420px !important; }
}
@media (max-width: 390px) {
  .chat-page { height:calc(100dvh - 222px) !important; min-height:400px !important; }
}

/* =========================================================
   V16 – Mobile Feinschliff: Wetter, Formulare, Feed, Setup
   ========================================================= */
html, body { overflow-x: hidden; }
#app, .content-shell, .two-col, .panel, .dashboard-section, .setup-detail, .setup-section-stack,
.employee-setup, .employee-hub-cards, .planning-hub-cards, .feed-compose-form { min-width:0; max-width:100%; }

/* Wetter: Werte auf dem Handy nicht mehr als Mini-Text */
.weather-facts { align-self:stretch; }
.weather-fact { min-width:0; display:grid; gap:2px; padding:8px 10px; border:1px solid rgba(223,226,232,.9); border-radius:11px; background:rgba(255,255,255,.72); }
.weather-fact small { color:#747b85; font-size:9.5px; font-weight:500; line-height:1.2; }
.weather-fact strong { color:#262a30; font-size:12px; font-weight:650; line-height:1.25; white-space:nowrap; }
.weather-label { font-weight:600; }
.weather-location-active { font-size:9.5px; font-weight:550; }

/* Urlaub: Safari-Datefelder dürfen niemals aus der Card herauswachsen */
#requestForm, #vacationCorrectionForm { width:100%; min-width:0; max-width:100%; overflow:hidden; }
#requestForm .field, #vacationCorrectionForm .field, #requestForm .inline-fields, #vacationCorrectionForm .inline-fields { width:100%; min-width:0; max-width:100%; }
#requestForm input, #requestForm select, #requestForm textarea,
#vacationCorrectionForm input, #vacationCorrectionForm select, #vacationCorrectionForm textarea { width:100% !important; min-width:0 !important; max-width:100% !important; }
input[type="date"] { box-sizing:border-box; -webkit-appearance:none; appearance:none; overflow:hidden; }

/* Team-Feed-Composer: Checkbox und Text bleiben sauber links ausgerichtet */
.feed-compose-form .toggle-row { width:100%; min-width:0; display:grid; grid-template-columns:24px minmax(0,1fr); align-items:start; gap:10px; }
.feed-compose-form .toggle-row input { width:18px; height:18px; margin:2px 0 0; }
.feed-compose-form .toggle-row span { width:100%; min-width:0; display:grid; gap:3px; text-align:left; }
.feed-compose-form .toggle-row strong,.feed-compose-form .toggle-row small { width:100%; text-align:left; }
.feed-compose-form .form-hint { margin:2px 0 8px; max-width:100%; overflow-wrap:anywhere; }
.feed-compose-form .poll-builder-row { width:100%; min-width:0; }
.feed-compose-form .poll-builder-row > * { min-width:0; max-width:100%; }
.feed-compose-modal-root .modal-content { min-width:0; }

/* Uploadstatus direkt am Button sichtbar */
.media-upload-modal .form-actions button.is-uploading { position:relative; opacity:.92; cursor:progress; }
.media-upload-modal .form-actions button.is-uploading::after { content:''; width:12px; height:12px; margin-left:8px; display:inline-block; vertical-align:-2px; border:2px solid rgba(255,255,255,.45); border-top-color:#fff; border-radius:50%; animation:rfSpin .7s linear infinite; }
@keyframes rfSpin { to { transform:rotate(360deg); } }

/* Setup: keine negativen Versätze mehr; Unterseiten stehen immer sauber im Raster */
.setup-detail { width:100%; min-width:0; max-width:100%; }
.setup-detail-head { width:100%; min-width:0; max-width:100%; margin:0 0 14px !important; padding:8px 0 !important; }
.setup-detail-head h2 { min-width:0; margin:0; }
.employee-setup,.planning-setup { width:100%; min-width:0; display:grid; gap:12px; }
.employee-hub-intro,.planning-hub-intro { width:100%; min-width:0; }
.employee-hub-cards,.planning-hub-cards { width:100%; min-width:0; }
.employee-hub-card,.planning-hub-card { width:100%; max-width:100%; }
.subview-back { margin:0 0 2px; }
.rights-panel,.employee-directory-card,.planning-section,.setup-section-grid > *, .setup-section-stack > * { width:100%; min-width:0; max-width:100%; }
.permission-grid,.permission-item { min-width:0; max-width:100%; }
.permission-item { width:100%; }

@media (max-width:760px) {
  .content-shell { width:100%; max-width:100%; padding-left:14px; padding-right:14px; }
  .panel,.admin-card,.dashboard-section { width:100%; min-width:0; max-width:100%; }

  .dash-weather-hero { grid-template-columns:54px minmax(0,1fr); padding:14px 14px 44px; }
  .weather-facts { grid-column:1/-1; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .weather-fact { padding:9px 10px; }
  .weather-fact small { font-size:10.5px; }
  .weather-fact strong { font-size:13px; }
  .weather-location-active,.weather-location-button { bottom:12px; }

  .two-col { width:100%; grid-template-columns:minmax(0,1fr) !important; }
  #requestForm .inline-fields,#vacationCorrectionForm .inline-fields { grid-template-columns:minmax(0,1fr) !important; }
  input[type="date"] { width:100% !important; min-width:0 !important; max-width:100% !important; }

  .feed-compose-modal-root .modal { overflow-x:hidden; }
  .feed-compose-form { width:100%; overflow-x:hidden; }
  .feed-compose-form .inline-fields { grid-template-columns:minmax(0,1fr) !important; }
  .feed-compose-form .toggle-row { padding:11px 12px; }
  .feed-compose-form .toggle-row strong { font-size:13px; }
  .feed-compose-form .toggle-row small { font-size:11.5px; line-height:1.4; }

  .setup-detail-head { position:sticky; top:82px !important; z-index:9; margin:0 0 12px !important; padding:8px 0 !important; background:var(--surface-alt) !important; }
  .setup-detail-head .secondary { flex:0 0 auto; }
  .setup-detail-head h2 { font-size:18px; line-height:1.2; }
  .employee-hub-intro h3,.planning-hub-intro h3 { font-size:17px; }
  .employee-hub-intro p,.planning-hub-intro p { font-size:11.5px; }
  .employee-hub-card,.planning-hub-card { grid-template-columns:42px minmax(0,1fr) 18px; gap:11px; padding:13px; }
  .employee-hub-card strong,.planning-hub-card strong { font-size:13px; color:var(--ink); }
  .employee-hub-card small,.planning-hub-card small { font-size:11px; line-height:1.35; }
  .employee-hub-card > i,.planning-hub-card > i { justify-self:end; }
  .rights-panel,.employee-directory-card,.planning-section { overflow:hidden !important; }

  .media-upload-modal .form-actions { position:sticky; bottom:0; z-index:3; padding-top:8px; background:linear-gradient(rgba(255,255,255,0),#fff 28%); }
  .media-upload-modal .form-actions button { width:100%; min-height:50px; }
}

/* =========================================================
   V17 – Dashboard/Medien/Setup Feinschliff
   ========================================================= */

/* Wetterwerte wirken wie Informationen – nicht wie Eingabefelder */
.weather-facts { gap:8px 12px; }
.weather-fact {
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
  padding:7px 2px;
  border:0;
  border-radius:0;
  background:transparent;
}
.weather-fact + .weather-fact { border-top:0; }
.weather-fact-icon {
  width:30px;
  height:30px;
  flex:0 0 30px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:rgba(72,130,183,.09);
  color:#4b7eaa;
}
.weather-fact-icon.gust { background:rgba(125,105,180,.09); color:#7561a7; }
.weather-fact-icon.rain { background:rgba(64,143,171,.09); color:#3b879f; }
.weather-fact-icon.visibility { background:rgba(101,111,124,.09); color:#626c78; }
.weather-fact-svg { width:16px; height:16px; }
.weather-fact > div { min-width:0; }
.weather-fact small { font-size:10px; line-height:1.1; }
.weather-fact strong { margin-top:2px; display:block; font-size:13px; line-height:1.15; }

/* Dashboard-Aufgaben bleiben kompakt nebeneinander */
.dash-task-row { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
.dash-task-item { min-width:0; }

/* Neueste Medien: eher Galerie/Activity als abgeschnittene Mini-Karten */
.dash-media-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.dash-media-card { display:grid; grid-template-columns:64px minmax(0,1fr); gap:9px; align-items:center; padding:8px; border:1px solid var(--line); border-radius:13px; background:#fff; }
.dash-media-thumb { width:64px; aspect-ratio:1/1; border-radius:10px; position:relative; }
.dash-media-play { width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:#fff; box-shadow:0 5px 18px rgba(31,34,39,.12); }
.dash-media-icon { width:18px; height:18px; }
.dash-media-copy { min-width:0; }
.dash-media-card strong,.dash-media-card small { white-space:normal; overflow:visible; text-overflow:clip; }
.dash-media-card strong { margin:0; font-size:11px; line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.dash-media-card small { margin-top:4px; font-size:9.5px; line-height:1.25; color:var(--muted); }

/* Urlaub / Checkboxen: Inhalt sauber links ausrichten */
#requestForm .toggle-row,
#vacationCorrectionForm .toggle-row {
  display:grid;
  grid-template-columns:26px minmax(0,1fr);
  align-items:start;
  justify-content:start;
  gap:10px;
  width:100%;
}
#requestForm .toggle-row input,
#vacationCorrectionForm .toggle-row input { width:19px; height:19px; margin:2px 0 0; justify-self:start; }
#requestForm .toggle-row span,
#vacationCorrectionForm .toggle-row span { min-width:0; width:100%; text-align:left; justify-self:stretch; }
#requestForm .toggle-row strong,#requestForm .toggle-row small,
#vacationCorrectionForm .toggle-row strong,#vacationCorrectionForm .toggle-row small { text-align:left; }

/* Medienpool klar in Bibliothek und Upload trennen */
.media-hero { align-items:flex-end; }
.media-section-switch { display:inline-grid; grid-template-columns:1fr 1fr; gap:4px; padding:4px; border:1px solid var(--line); border-radius:12px; background:#f3f4f6; }
.media-section-tab { display:flex; align-items:center; justify-content:center; gap:7px; min-height:40px; padding:8px 13px; border:0; border-radius:9px; background:transparent; color:#69707a; font-size:11px; font-weight:650; }
.media-section-tab.active { background:#fff; color:var(--ink); box-shadow:0 2px 8px rgba(31,34,39,.06); }
.media-section-tab.upload { color:var(--brand); }
.media-section-icon { width:17px; height:17px; }

/* Setup: konsistenter Seitenkopf ohne überlagerte/verrutschte Inhalte */
.setup-detail-head {
  position:sticky !important;
  top:72px !important;
  z-index:12 !important;
  display:grid !important;
  grid-template-columns:auto minmax(0,1fr) !important;
  align-items:center !important;
  gap:12px !important;
  width:100% !important;
  margin:0 0 14px !important;
  padding:10px 0 !important;
  background:var(--surface-alt) !important;
  border-bottom:1px solid rgba(224,226,231,.9) !important;
}
.setup-detail-head h2 { margin:0 !important; min-width:0; font-size:20px; line-height:1.2; white-space:normal; }
.setup-detail-head .secondary { min-height:40px; padding:9px 12px; }
.setup-detail { margin:0 !important; padding:0 !important; }
.setup-section-stack,.employee-setup,.planning-setup { gap:14px !important; }
.setup-section-grid { gap:12px !important; }
.admin-card,.planning-section,.employee-directory-card,.rights-panel { position:relative; }

@media (max-width:760px) {
  .weather-facts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 10px; }
  .weather-fact { padding:6px 0; }
  .weather-fact-icon { width:28px; height:28px; flex-basis:28px; }
  .weather-fact small { font-size:10px; }
  .weather-fact strong { font-size:12.5px; }

  .dash-task-row { grid-template-columns:repeat(3,minmax(0,1fr)) !important; gap:7px !important; }
  .dash-task-item { display:grid !important; grid-template-columns:1fr !important; gap:6px !important; padding:10px 9px !important; }
  .dash-task-item > span { width:30px; height:30px; }
  .dash-task-item strong { font-size:18px; }
  .dash-task-item small { font-size:9.5px; line-height:1.2; }

  .dash-media-grid { grid-template-columns:1fr; gap:7px; }
  .dash-media-card { grid-template-columns:54px minmax(0,1fr); padding:7px; }
  .dash-media-thumb { width:54px; }
  .dash-media-card strong { font-size:11.5px; }
  .dash-media-card small { display:block; font-size:9.5px; }

  .media-hero { align-items:stretch; }
  .media-section-switch { width:100%; }
  .media-section-tab { min-height:44px; font-size:12px; }

  .setup-detail-head { top:64px !important; padding:8px 0 !important; margin:0 0 12px !important; }
  .setup-detail-head h2 { font-size:18px !important; }
  .setup-detail-head .secondary { min-height:42px; }

  /* Setup-Startseite auf dem Handy lieber ruhig untereinander statt gequetscht */
  .setup-grid { grid-template-columns:1fr !important; gap:9px !important; }
  .setup-tile { min-height:auto !important; grid-template-columns:44px minmax(0,1fr) 18px !important; grid-template-rows:1fr !important; align-items:center !important; padding:13px !important; }
  .setup-tile > i { position:static !important; justify-self:end; }
  .setup-tile-copy strong { font-size:13px !important; }
  .setup-tile-copy small { font-size:10.5px !important; }
}

@media (max-width:380px) {
  .dash-task-row { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
  .dash-task-item { padding:8px 7px !important; }
  .dash-task-item small { font-size:9px; }
}


/* V18 – UX-Struktur, Urlaubstypen, kompakter Medienpool */
.dash-task-item > span { width:38px !important; height:38px !important; flex-basis:38px !important; border-radius:12px !important; }
.dash-task-icon { width:21px !important; height:21px !important; }
.dash-task-item strong { font-size:22px !important; font-weight:720 !important; }
.dash-task-item small { font-size:11px !important; line-height:1.25 !important; font-weight:560 !important; }

.vacation-requests-panel { margin-top:14px; }
.vacation-request-head { align-items:center; }
.compact-primary { width:auto; min-width:128px; }
.request-time-block { padding:12px; margin:10px 0; border:1px solid var(--line); border-radius:14px; background:var(--surface-alt); }
.request-time-block .field { margin:0; }

.setup-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
.setup-tile { min-height:132px !important; grid-template-columns:1fr !important; grid-template-rows:auto auto 1fr; align-content:start; justify-items:start; gap:10px !important; padding:16px !important; }
.setup-tile-icon { width:46px !important; height:46px !important; }
.setup-tile-copy strong { font-size:14px !important; }
.setup-tile-copy small { font-size:11px !important; }
.setup-tile > i { position:absolute; right:14px; top:14px; }
.setup-tile { position:relative; }
.setup-detail-head { position:sticky !important; top:72px !important; z-index:20 !important; background:var(--surface-alt) !important; padding:10px 0 !important; margin:0 0 14px !important; }
.setup-detail { padding-top:0 !important; }
.setup-hub,.setup-subview { display:grid; gap:14px; min-width:0; }
.setup-hub-intro h3 { margin:0; font-size:18px; }
.setup-hub-intro p { margin:4px 0 0; color:var(--muted); font-size:12px; line-height:1.45; }
.setup-subtile-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; }
.setup-subtile { display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:11px; min-width:0; min-height:92px; padding:14px; border:1px solid var(--line); border-radius:16px; background:#fff; box-shadow:var(--shadow-soft); text-align:left; }
.setup-subtile > span { width:42px; height:42px; display:grid; place-items:center; border-radius:13px; color:var(--brand); background:var(--brand-soft); }
.setup-subtile-icon { width:21px; height:21px; }
.setup-subtile strong,.setup-subtile small { display:block; }
.setup-subtile strong { font-size:13px; font-weight:680; color:var(--ink); }
.setup-subtile small { margin-top:3px; font-size:10.5px; line-height:1.35; color:var(--muted); }
.setup-subtile i { font-style:normal; font-size:20px; color:#a3a8b0; }
.subview-back { justify-self:start; }
.limits-base-control.simplified { grid-template-columns:minmax(0,1fr) auto !important; }
.compact-week-picker { margin-bottom:12px; }

.media-grid { grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:11px !important; }
.media-card { border-radius:16px !important; }
.media-preview { aspect-ratio:4/5 !important; min-height:0 !important; background:#f3f4f6; }
.media-preview > video { display:none !important; }
.media-preview .media-file-placeholder { min-height:100%; }
.media-card-body { padding:10px !important; gap:7px !important; }
.media-title-row { display:grid !important; grid-template-columns:1fr !important; gap:5px; }
.media-title-row h3 { font-size:12px !important; line-height:1.25; }
.media-title-row p { display:none; }
.media-status { justify-self:start; font-size:8.5px !important; padding:4px 6px !important; }
.media-note,.media-badges,.media-meta { font-size:9px !important; }
.media-badges { display:none !important; }
.media-meta { display:grid !important; gap:4px !important; }
.media-actions { display:grid !important; grid-template-columns:1fr !important; gap:6px !important; }
.media-actions .secondary,.media-actions .ghost,.media-actions select { width:100%; min-width:0; font-size:9px !important; min-height:34px !important; padding:7px !important; }
.media-selected-row-v18 { align-items:start !important; }
.media-selected-main { min-width:0; display:grid; gap:4px; }
.media-selected-main strong,.media-selected-main small { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.media-selected-main input { width:100%; min-width:0; min-height:38px; font-size:12px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:#fff; }

@media (max-width:760px) {
  .dash-task-item { padding:11px 8px !important; justify-items:center !important; text-align:center !important; }
  .dash-task-item > span { width:34px !important; height:34px !important; justify-self:center; }
  .dash-task-icon { width:19px !important; height:19px !important; }
  .dash-task-item strong { font-size:21px !important; }
  .dash-task-item small { font-size:10px !important; }
  .vacation-request-head { display:flex !important; align-items:center !important; justify-content:space-between !important; gap:10px !important; }
  .vacation-request-head h2 { font-size:18px !important; }
  .vacation-request-head p { display:none; }
  .compact-primary { min-width:0; padding:10px 13px !important; font-size:11px !important; }
  .setup-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:10px !important; }
  .setup-tile { min-height:122px !important; padding:13px !important; }
  .setup-tile-copy strong { font-size:12.5px !important; line-height:1.25; }
  .setup-tile-copy small { font-size:10px !important; line-height:1.3; }
  .setup-detail-head { top:64px !important; }
  .setup-subtile-grid { grid-template-columns:1fr !important; }
  .setup-subtile { min-height:84px; }
  .media-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:9px !important; }
  .media-card-body { padding:9px !important; }
  .media-title-row h3 { font-size:11.5px !important; }
  .media-note { display:none !important; }
  .media-meta span:last-child { display:none; }
  .media-actions { grid-template-columns:1fr !important; }
  .request-time-block { padding:10px; }
}

@media (max-width:390px) {
  .setup-grid { grid-template-columns:1fr 1fr !important; gap:8px !important; }
  .setup-tile { min-height:116px !important; }
  .media-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}


/* =========================================================
   V19 – Media previews, Urlaubslisten, Samstag, Setup-Fix
   ========================================================= */
.setup-detail-head {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
  margin: 0 0 14px !important;
  padding: 0 0 12px !important;
  background: transparent !important;
  border-bottom: 1px solid var(--line) !important;
}
.setup-detail { width:100% !important; max-width:none !important; min-width:0 !important; }
.setup-hub,.setup-subview,.employee-setup,.planning-admin-stack { width:100%; max-width:100%; min-width:0; }
.setup-subtile-grid,.employee-hub-cards,.planning-hub-cards { width:100%; min-width:0; }
.setup-subview > .admin-card,.employee-setup > .admin-card,.planning-admin-stack > .admin-card { width:100%; max-width:100%; min-width:0; }
.subview-back { position:sticky; top:76px; z-index:11; box-shadow:0 6px 16px rgba(31,34,39,.06); }

.ops-board-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.ops-vacation-list-button { display:inline-flex; align-items:center; gap:7px; white-space:nowrap; }
.vacation-lists-modal-root .modal-card { width:min(920px,calc(100vw - 28px)); }
.vacation-lists-page { display:grid; gap:14px; }
.vacation-list-toolbar { width:min(220px,100%); }
.vacation-employee-list { display:grid; gap:9px; }
.vacation-employee-card { border:1px solid var(--line); border-radius:16px; background:#fff; overflow:hidden; }
.vacation-employee-card > summary { list-style:none; display:grid; grid-template-columns:44px minmax(0,1fr) auto 18px; gap:10px; align-items:center; padding:13px; cursor:pointer; }
.vacation-employee-card > summary::-webkit-details-marker { display:none; }
.vacation-list-avatar { width:44px; height:44px; display:grid; place-items:center; border-radius:50%; overflow:hidden; background:#eef0f3; color:#5e6570; font-size:12px; font-weight:700; }
.vacation-list-person strong,.vacation-list-person span,.vacation-list-balance b,.vacation-list-balance small { display:block; }
.vacation-list-person strong { font-size:13px; }
.vacation-list-person span,.vacation-list-balance small { color:var(--muted); font-size:10px; margin-top:2px; }
.vacation-list-balance { text-align:right; }
.vacation-list-balance b { font-size:13px; }
.vacation-list-body { border-top:1px solid var(--line); padding:12px; display:grid; gap:12px; }
.vacation-list-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.vacation-list-metrics > div { padding:9px; border-radius:12px; background:var(--surface-alt); }
.vacation-list-metrics span,.vacation-list-metrics strong { display:block; }
.vacation-list-metrics span { color:var(--muted); font-size:9px; }
.vacation-list-metrics strong { margin-top:3px; font-size:15px; }
.vacation-list-requests { display:grid; gap:6px; }
.vacation-list-request { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 0; border-top:1px solid var(--line); }
.vacation-list-request:first-child { border-top:0; }
.vacation-list-request strong,.vacation-list-request span { display:block; }
.vacation-list-request strong { font-size:11px; }
.vacation-list-request span { color:var(--muted); font-size:9.5px; margin-top:2px; }

.media-preview img { background:#eceff2; }
.media-preview::after { pointer-events:none; }

@media (max-width:760px) {
  .setup-detail-head { margin:0 0 12px !important; padding:0 0 10px !important; }
  .setup-detail-head h2 { font-size:20px !important; }
  .setup-detail-head .secondary { min-height:42px; }
  .subview-back { top:70px; }
  .ops-board-head { align-items:stretch; flex-direction:column; }
  .ops-vacation-list-button { width:100%; justify-content:center; }
  .vacation-lists-modal-root .modal-card { width:100%; max-width:none; }
  .vacation-employee-card > summary { grid-template-columns:40px minmax(0,1fr) auto 14px; padding:11px; }
  .vacation-list-avatar { width:40px; height:40px; }
  .vacation-list-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .vacation-list-request { align-items:flex-start; flex-direction:column; }
  .vacation-list-request .ghost { width:100%; }
  .day-limit-grid.modern { display:grid !important; grid-template-columns:1fr !important; overflow:visible !important; gap:8px !important; }
  .limit-day-row { width:100%; max-width:100%; min-width:0; }
  .limits-modern,.limits-week-card { width:100%; max-width:100%; min-width:0; }
}

.chat-hard-delete{margin-left:auto;white-space:nowrap;}
@media(max-width:760px){.chat-hard-delete{font-size:10px;padding:7px 9px;}}

/* =========================================================
   V20 – Dashboard-Feinschliff & Urlaubsübersicht
   ========================================================= */

/* Wetter: ein zusammenhängendes, ruhiges 2x2-Informationsfeld */
.weather-facts {
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:0 !important;
  margin-top:4px;
  padding:2px 0;
  border-top:1px solid rgba(220,224,230,.8);
  border-bottom:1px solid rgba(220,224,230,.8);
}
.weather-fact {
  display:grid !important;
  grid-template-columns:34px minmax(0,1fr) !important;
  align-items:center !important;
  gap:10px !important;
  min-height:58px;
  padding:10px 12px !important;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
}
.weather-fact:nth-child(even) { border-left:1px solid rgba(220,224,230,.8) !important; }
.weather-fact:nth-child(n+3) { border-top:1px solid rgba(220,224,230,.8) !important; }
.weather-fact-icon { width:32px !important; height:32px !important; flex-basis:32px !important; border-radius:11px !important; }
.weather-fact-svg { width:17px !important; height:17px !important; }
.weather-fact small { font-size:10.5px !important; color:#777e88 !important; font-weight:520 !important; }
.weather-fact strong { font-size:14px !important; color:var(--ink) !important; font-weight:680 !important; }

/* Aufgaben: Icons neutral schwarz, Kennzahlen im RF-Rot */
.dash-task-item > span {
  color:#22262b !important;
  background:#f1f2f4 !important;
}
.dash-task-item strong {
  color:var(--brand) !important;
}
.dash-task-item small {
  color:#6f7680 !important;
}

/* Urlaubsliste als eigenständiges Werkzeug */
.vacation-lists-shell {
  width:100%;
  max-width:1120px;
  margin:0 auto;
}
.vacation-lists-shell .vacation-lists-page {
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  padding:20px;
  box-shadow:var(--shadow-soft);
}
.vacation-lists-shell .modal-title-block h3 { font-size:24px; margin:5px 0 0; }
.vacation-lists-shell .modal-title-block p { margin:6px 0 0; color:var(--muted); }

/* Urlaub nachtragen: aktueller Kontostand + Live-Auswirkung */
.correction-snapshot {
  margin:2px 0 14px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fafbfc;
}
.correction-snapshot-loading { color:var(--muted); font-size:12px; }
.correction-snapshot-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:11px; }
.correction-snapshot-head strong,.correction-snapshot-head small { display:block; }
.correction-snapshot-head strong { font-size:14px; }
.correction-snapshot-head small { margin-top:2px; color:var(--muted); font-size:10px; }
.correction-snapshot-head .text-link { border:0; background:transparent; color:var(--brand); font-size:10.5px; font-weight:650; padding:2px 0; }
.correction-snapshot-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.correction-snapshot-grid > div { min-width:0; padding:10px 11px; border-radius:12px; background:#fff; border:1px solid rgba(224,227,232,.9); }
.correction-snapshot-grid span,.correction-snapshot-grid strong { display:block; }
.correction-snapshot-grid span { color:var(--muted); font-size:9.5px; line-height:1.25; }
.correction-snapshot-grid strong { margin-top:4px; color:var(--ink); font-size:17px; line-height:1; }
.correction-snapshot-grid .correction-highlight { background:var(--brand-soft); border-color:#f4d8dc; }
.correction-snapshot-grid .correction-highlight strong { color:var(--brand); }
.correction-snapshot-grid .correction-after { background:#edf8f2; border-color:#d5ebdf; }
.correction-snapshot-grid .correction-after strong { color:#17734b; }

@media (max-width:760px) {
  .weather-fact { min-height:54px; padding:9px 8px !important; grid-template-columns:30px minmax(0,1fr) !important; gap:8px !important; }
  .weather-fact-icon { width:29px !important; height:29px !important; flex-basis:29px !important; }
  .weather-fact small { font-size:9.5px !important; }
  .weather-fact strong { font-size:12.5px !important; }

  .vacation-lists-shell { padding:0; }
  .vacation-lists-shell .vacation-lists-page { border:0; border-radius:0; padding:0; box-shadow:none; background:transparent; }
  .vacation-lists-shell .modal-title-block { margin-bottom:4px; }
  .vacation-lists-shell .modal-title-block h3 { font-size:21px; }

  .correction-snapshot { padding:12px; }
  .correction-snapshot-head { align-items:center; }
  .correction-snapshot-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .correction-snapshot-grid > div { padding:9px; }
  .correction-snapshot-grid span { font-size:9px; }
  .correction-snapshot-grid strong { font-size:15px; }
}

/* =========================================================
   V21 – klare App-Struktur, Mitarbeiterakte & Team-Momente
   ========================================================= */
.content-shell { max-width: 1320px !important; }

/* Dashboard: Wetter ruhig, Aufgaben klar, Team-Momente kompakt */
.weather-facts { gap: 10px 18px !important; }
.weather-fact {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 6px 0 !important;
  min-height: 48px;
}
.weather-fact-icon { box-shadow: none !important; }
.dash-task-item > span { color: #202328 !important; background: #f2f3f5 !important; }
.dash-task-item strong { color: var(--brand) !important; }
.milestone-card { min-width: 0; }
.milestone-list { display: grid; gap: 4px; }
.milestone-row { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.milestone-row:first-child { border-top: 0; }
.milestone-avatar { width: 38px; height: 38px; border-radius: 50%; }
.milestone-row strong,.milestone-row span { display:block; }
.milestone-row strong { font-size: 12px; font-weight: 650; }
.milestone-row span { margin-top: 2px; color: var(--muted); font-size: 10.5px; }

/* Urlaub: ein Modul statt verstreuter Admin-Seiten */
.vacation-mode-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.vacation-segment { display:inline-flex; padding:4px; border:1px solid var(--line); border-radius:13px; background:#f2f3f5; }
.vacation-segment button { border:0; border-radius:9px; background:transparent; padding:9px 13px; color:var(--muted); font-weight:650; font-size:11.5px; }
.vacation-segment button.active { background:#fff; color:var(--brand); box-shadow:0 2px 8px rgba(20,22,26,.06); }
.vacation-admin-actions { display:flex; flex-wrap:wrap; gap:7px; justify-content:flex-end; }
.team-vacation-panel { padding: 18px; }
.team-vacation-panel .vacation-lists-page { border:0 !important; box-shadow:none !important; padding:0 !important; }
.vacation-admin-modal-root .modal { width:min(720px,100%); }

/* Setup: echte Kachelzentrale */
.setup-grid { grid-template-columns: repeat(4,minmax(0,1fr)) !important; max-width: 1180px; margin: 0 auto; }
.setup-tile { min-height: 150px !important; padding: 18px !important; border-radius: 20px !important; align-content: start; }
.setup-tile-icon { width: 48px !important; height: 48px !important; border-radius: 15px !important; }
.setup-tile-copy strong { font-size: 14px !important; font-weight: 680 !important; }
.setup-tile-copy small { font-size: 10.5px !important; line-height: 1.45 !important; }
.setup-detail { max-width: 1080px; margin: 0 auto; }
.setup-detail-head { max-width:1080px; margin:0 auto 14px; }
.employee-hub-cards.simplified { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.employee-hub-cards.simplified .employee-hub-card { min-height:120px; }

/* Mitarbeiterakte */
.employee-directory-row { grid-template-columns: 52px minmax(0,1fr) auto !important; gap:12px !important; align-items:center !important; }
.employee-row-actions { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
.area-chooser { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.area-chooser label { display:flex; align-items:center; gap:8px; min-height:44px; padding:9px 11px; border:1px solid var(--line); border-radius:12px; background:#fafbfc; }
.area-chooser input { width:18px; height:18px; accent-color:var(--brand); }
.area-chooser span { font-size:11.5px; font-weight:600; }
.profile-self-form { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; margin:14px 0; }
.dev-role-switcher { margin-top:16px; padding:13px; border-radius:14px; background:#f7f8fa; border:1px solid var(--line); }
.dev-role-switcher > strong { display:block; margin-bottom:8px; font-size:12px; }
.dev-role-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.dev-user-switch { text-align:left; display:block; min-height:54px; }
.dev-user-switch span,.dev-user-switch small { display:block; }
.dev-user-switch small { margin-top:2px; color:var(--muted); font-size:9.5px; }

/* Planung: Warnung sofort sichtbar, Aktionen darunter */
.planning-direct-warning { padding:14px; border:1px solid #f0cc83; border-radius:17px; background:#fffaf0; }
.planning-direct-warning .planning-conflict-panel { margin:0; }
.planning-hub-cards.two-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
.planning-ok.compact { padding:11px 13px; border-radius:13px; }

/* Desktop: nicht künstlich in die Breite ziehen */
@media (min-width: 1200px) {
  .dash-shell { max-width: 1180px; margin: 0 auto; }
  .vacation-overview-section,.vacation-requests-panel,.vacation-mode-bar,.team-vacation-panel { max-width: 1120px; margin-left:auto; margin-right:auto; }
  .employee-directory-card { max-width: 980px; margin:0 auto; }
}

@media (max-width: 900px) {
  .setup-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}

@media (max-width: 760px) {
  .content-shell { max-width:100% !important; }
  .weather-facts { gap: 5px 12px !important; }
  .weather-fact { padding:5px 0 !important; min-height:44px !important; }
  .weather-fact small { font-size:9.5px !important; }
  .weather-fact strong { font-size:12px !important; }
  .vacation-mode-bar { align-items:stretch; flex-direction:column; }
  .vacation-segment { display:grid; grid-template-columns:1fr 1fr; width:100%; }
  .vacation-segment button { width:100%; }
  .vacation-admin-actions { justify-content:stretch; display:grid; grid-template-columns:1fr 1fr; }
  .vacation-admin-actions:has(:only-child) { grid-template-columns:1fr; }
  .setup-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap:9px !important; }
  .setup-tile { min-height:132px !important; padding:13px !important; grid-template-columns:1fr !important; gap:9px !important; }
  .setup-tile-icon { width:42px !important; height:42px !important; }
  .setup-tile-copy strong { font-size:12.5px !important; }
  .setup-tile-copy small { font-size:9.5px !important; }
  .setup-detail-head { position:sticky; top:91px; z-index:8; background:rgba(247,248,250,.96); backdrop-filter:blur(10px); padding:8px 0; }
  .employee-hub-cards.simplified { grid-template-columns:1fr; }
  .employee-directory-row { grid-template-columns:48px minmax(0,1fr) !important; }
  .employee-row-actions { grid-column:1/-1; display:grid; grid-template-columns:1fr 1fr; width:100%; }
  .employee-row-actions .secondary:only-child { grid-column:1/-1; }
  .area-chooser { grid-template-columns:1fr 1fr; }
  .planning-hub-cards.two-cards { grid-template-columns:1fr; }
  .profile-self-form { grid-template-columns:1fr; }
  .dev-role-grid { grid-template-columns:1fr; }
  .milestone-row { grid-template-columns:36px minmax(0,1fr); }
}

@media (max-width: 390px) {
  .setup-grid { grid-template-columns:1fr !important; }
  .area-chooser { grid-template-columns:1fr; }
}
.employee-milestone-list { display:grid; gap:4px; }
.employee-milestone-row { display:grid; grid-template-columns:48px minmax(0,1fr); gap:12px; align-items:center; padding:12px 0; border-top:1px solid var(--line); }
.employee-milestone-row:first-child { border-top:0; }
.employee-milestone-row strong,.employee-milestone-row span { display:block; }
.employee-milestone-row strong { font-size:12.5px; }
.employee-milestone-row span { margin-top:3px; color:var(--muted); font-size:10.5px; }

/* V21 – Anmeldung & Einladungen */
body.auth-mode .sidebar, body.auth-mode .topbar, body.auth-mode .mobile-nav { display:none !important; }
body.auth-mode .app-frame { display:block; }
body.auth-mode .content-shell { max-width:none !important; padding:0 !important; }
.auth-shell { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(145deg,#fff 0%,#fff7f8 55%,#f4f6f8 100%); }
.auth-card { width:min(440px,100%); padding:28px; border:1px solid var(--line); border-radius:24px; background:#fff; box-shadow:0 24px 70px rgba(24,25,29,.10); }
.auth-logo { display:block; width:min(260px,80%); max-height:90px; object-fit:contain; object-position:left center; margin-bottom:24px; }
.auth-card h2 { margin:10px 0 6px; font-size:28px; letter-spacing:-.035em; }
.auth-card > p { margin:0 0 20px; color:var(--muted); line-height:1.55; }
.auth-submit { width:100%; min-height:48px; margin-top:8px; }
.auth-help { display:block; margin-top:14px; color:var(--muted); line-height:1.45; }
.invite-email { margin:0 0 16px; padding:10px 12px; border-radius:11px; background:#f6f7f9; color:#4d535c; font-size:12px; }
.invite-link-box { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
.invite-link-box input { width:100%; min-width:0; }
@media(max-width:600px){ .auth-shell{padding:14px;} .auth-card{padding:22px 18px;border-radius:20px;} .invite-link-box{grid-template-columns:1fr;} }

/* =========================================================
   V22 – Premium-Struktur & konsistentes Responsive-System
   ========================================================= */
:root {
  --content-max: 1240px;
  --card-radius: 20px;
  --control-radius: 14px;
}

/* Kopfzeile: Logo/Titel nicht mehr gedrängt */
.topbar { padding-inline: 30px !important; }
.topbar-left { gap: 18px !important; }
.mobile-brand-icon { margin-inline: 2px 2px; }
.topbar-title-wrap { padding-left: 2px; }
.content-shell { max-width: var(--content-max) !important; padding-inline: 30px !important; }

/* Wetter: keine Tabellen-/Eingabefeld-Anmutung, keine Trennlinien */
.weather-facts {
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:10px !important;
  border:0 !important;
  padding:0 !important;
}
.weather-fact,
.weather-fact + .weather-fact {
  border:0 !important;
  box-shadow:none !important;
  background:rgba(255,255,255,.48) !important;
  border-radius:14px !important;
  padding:10px 11px !important;
  min-height:62px !important;
}
.weather-fact:before,
.weather-fact:after { display:none !important; content:none !important; }
.weather-fact small { font-size:10px !important; color:#747b86 !important; }
.weather-fact strong { font-size:13.5px !important; color:#202329 !important; }

/* Team-Momente auf dem Dashboard bewusst präsenter */
.team-moment-card {
  background:linear-gradient(145deg,#fff 0%,#fff9f3 55%,#fff4f5 100%) !important;
  border-color:#f0d8d0 !important;
}
.team-moment-head { align-items:flex-start !important; }
.team-moment-head > div { min-width:0; }
.team-moment-kicker {
  display:block;
  margin-bottom:4px;
  color:var(--brand);
  font-size:8.5px;
  font-weight:850;
  letter-spacing:.14em;
}
.milestone-row {
  grid-template-columns:34px 40px minmax(0,1fr) !important;
  padding:10px 0 !important;
}
.milestone-row.is-today {
  margin-inline:-8px;
  padding:10px 8px !important;
  border-radius:14px;
  background:rgba(255,255,255,.72);
}
.milestone-type {
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:#fff;
  color:var(--brand);
  box-shadow:0 3px 12px rgba(26,27,31,.06);
}
.milestone-type.anniversary { color:#9b6b11; background:#fff9e8; }
.milestone-type-icon { width:17px; height:17px; }
.milestone-row strong em {
  display:inline-flex;
  margin-left:7px;
  padding:3px 6px;
  border-radius:999px;
  background:var(--brand);
  color:#fff;
  font-size:8px;
  font-style:normal;
  vertical-align:middle;
}

/* Kalender: Monat/Jahr ist eine echte Steuerung */
.rf-calendar-title-button {
  display:block;
  min-width:0;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  text-align:left;
}
.rf-calendar-title-button h2 { margin:2px 0 1px !important; }
.rf-calendar-title-button small { color:var(--brand); font-size:9.5px; font-weight:650; }
.period-picker-modal-root .modal,
.year-picker-modal-root .modal { width:min(480px,100%); }
.period-month-grid,
.year-picker-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.period-month-grid button,
.year-picker-grid button {
  min-height:48px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#fff;
  color:var(--ink);
  font-weight:700;
}
.period-month-grid button.active,
.year-picker-grid button.active { border-color:#f2b7bf; background:var(--brand-soft); color:var(--brand); }
.period-year-row { margin-bottom:12px; }

/* Teamurlaub: Jahr als klarer Selektor statt Zahlenfeld */
.year-picker-button {
  width:100%;
  min-height:58px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:auto auto;
  align-items:center;
  gap:1px 10px;
  padding:10px 13px;
  border:1px solid var(--line-strong);
  border-radius:13px;
  background:#fff;
  text-align:left;
}
.year-picker-button span { grid-column:1; font-size:16px; font-weight:700; }
.year-picker-button small { grid-column:1; color:var(--muted); font-size:9.5px; }
.year-picker-button b { grid-column:2; grid-row:1/3; font-size:16px; color:#717780; }

/* Medienbibliothek: Polaroid-Karten, Aktionen erst nach Aufklappen */
.media-grid {
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:16px !important;
  align-items:start;
}
.media-polaroid {
  padding:0 !important;
  overflow:hidden;
  border-radius:18px !important;
  background:#fff;
}
.media-card-summary {
  display:block;
  list-style:none;
  cursor:pointer;
}
.media-card-summary::-webkit-details-marker { display:none; }
.media-polaroid .media-preview {
  aspect-ratio:4 / 5 !important;
  border-radius:0 !important;
  overflow:hidden;
  background:#f1f2f4;
}
.media-polaroid .media-preview img { width:100%; height:100%; object-fit:cover; display:block; }
.media-polaroid-caption { padding:11px 12px 12px; }
.media-polaroid-title { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:start; }
.media-polaroid-title strong {
  min-width:0;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  font-size:12px;
  line-height:1.3;
  font-weight:720;
}
.media-polaroid-title .media-status { margin-top:0; }
.media-polaroid-meta { margin-top:8px; display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--muted); font-size:9.5px; }
.media-polaroid-meta b { font-size:15px; font-weight:500; transition:transform .16s ease; }
.media-polaroid[open] .media-polaroid-meta b { transform:rotate(180deg); }
.media-card-expanded {
  display:grid !important;
  gap:8px !important;
  padding:0 12px 12px !important;
  border-top:1px solid var(--line);
  margin-top:0;
}
.media-card-expanded .media-note { margin:10px 0 0; }
.media-card-expanded .media-badges { display:flex !important; flex-wrap:wrap; }
.media-card-expanded .media-meta { display:grid !important; gap:5px; }
.media-card-expanded .media-actions { display:grid !important; grid-template-columns:1fr !important; gap:7px; }
.media-card-expanded .media-actions .secondary,
.media-card-expanded .media-actions .ghost,
.media-card-expanded .media-actions .media-status-select { width:100%; min-height:39px; }

/* Setup: Haupt- und Unterebenen sprechen dieselbe Kachelsprache */
.setup-grid,
.setup-subtile-grid,
.employee-hub-cards.simplified,
.planning-hub-cards.two-cards {
  gap:12px !important;
}
.setup-subtile-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
.setup-subtile,
.employee-hub-card,
.planning-hub-card {
  min-height:112px !important;
  border-radius:18px !important;
  border:1px solid var(--line) !important;
  background:#fff !important;
  box-shadow:var(--shadow-soft) !important;
}
.setup-subtile:hover,
.employee-hub-card:hover,
.planning-hub-card:hover { border-color:#efc9cf !important; }
.system-info-tile { cursor:default; }
.system-status-card { margin-top:2px; }
.setup-detail-head {
  top:72px !important;
  padding:12px 0 10px !important;
  background:rgba(247,248,250,.96) !important;
  backdrop-filter:blur(12px);
}

/* Desktop ist kein breitgezerrtes Handy */
@media (min-width:1200px) {
  .dash-shell,
  .rf-calendar-page,
  .media-hero,
  .media-storage,
  .media-toolbar,
  .media-grid,
  .setup-grid,
  .setup-detail,
  .setup-detail-head { max-width:1160px !important; margin-left:auto !important; margin-right:auto !important; }
  .dash-grid-main { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dash-weather-hero { max-width:1160px; }
  .rf-calendar-layout { grid-template-columns:minmax(0,1.7fr) minmax(300px,.65fr) !important; }
}

@media (max-width:980px) {
  .media-grid { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
  .weather-facts { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}

@media (max-width:760px) {
  .topbar { padding:10px 18px !important; }
  .topbar-left { gap:14px !important; }
  .content-shell { padding-inline:15px !important; }
  .weather-facts { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:7px !important; }
  .weather-fact { min-height:56px !important; padding:8px 9px !important; }
  .milestone-row { grid-template-columns:30px 36px minmax(0,1fr) !important; gap:8px !important; }
  .milestone-type { width:30px; height:30px; }
  .setup-detail-head { top:64px !important; }
  .setup-subtile-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  .setup-subtile { min-height:126px !important; grid-template-columns:1fr !important; align-content:start !important; }
  .setup-subtile > span { width:40px !important; height:40px !important; }
  .setup-subtile i { position:absolute; right:13px; top:13px; }
  .setup-subtile { position:relative; }
  .employee-hub-cards.simplified,
  .planning-hub-cards.two-cards { grid-template-columns:1fr 1fr !important; }
  .employee-hub-card,
  .planning-hub-card { min-height:128px !important; align-content:start; }
  .media-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:10px !important; }
  .media-polaroid-caption { padding:9px 9px 10px; }
  .media-polaroid-title { grid-template-columns:1fr; gap:5px; }
  .media-polaroid-title strong { font-size:11px; }
  .media-status { justify-self:start; }
  .media-card-expanded { padding:0 9px 9px !important; }
  .period-month-grid,
  .year-picker-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media (max-width:390px) {
  .setup-subtile-grid,
  .employee-hub-cards.simplified,
  .planning-hub-cards.two-cards { grid-template-columns:1fr !important; }
  .media-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}


/* =========================================================
   Testphase UX-Hotfix: Feedback, Chat, Wetter, Urlaub
   ========================================================= */

/* Begrüßung: Datum/Uhrzeit bewusst in eigener Zeile */
.dash-welcome {
  display:grid !important;
  gap:7px !important;
}
.dash-greeting-line {
  display:flex;
  align-items:baseline;
  gap:8px;
  flex-wrap:wrap;
}
.dash-current-date {
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--muted);
  font-size:11px;
  font-weight:500;
  line-height:1.35;
  text-transform:capitalize;
}
.dash-current-date i { font-style:normal; opacity:.55; }

/* Urlaub: Statuskacheln */
.vacation-metric-grid-status { grid-template-columns:repeat(5,minmax(0,1fr)); }
.vacation-metric.pending-metric.has-pending { border-color:#efd58a; background:#fffaf0; }
.vacation-metric.pending-metric.has-pending strong { color:#9a6900; }
.vacation-metric.available-metric { background:#fbfbfc; }
.vacation-list-metrics { grid-template-columns:repeat(5,minmax(0,1fr)); }
.vacation-list-metrics .pending { background:#fffaf0; }
.vacation-list-metrics .pending strong { color:#9a6900; }

/* Formularfeedback immer wirklich über dem geöffneten Formular */
.request-feedback-popover {
  position:fixed;
  inset:0;
  z-index:400;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(25,28,33,.48);
  backdrop-filter:blur(5px);
}
.request-feedback-card {
  width:min(460px,calc(100vw - 32px));
  display:grid;
  grid-template-columns:46px minmax(0,1fr);
  gap:13px;
  padding:20px;
  border-radius:22px;
  background:#fff;
  box-shadow:0 28px 80px rgba(20,22,26,.28);
  border:1px solid rgba(240,71,80,.15);
}
.request-feedback-icon {
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:#fff0f2;
  color:var(--brand);
}
.request-feedback-card strong,
.request-feedback-card p,
.request-feedback-card small { display:block; }
.request-feedback-card strong { font-size:16px; line-height:1.2; }
.request-feedback-card p { margin:6px 0 0; color:#555b64; font-size:13px; line-height:1.5; }
.request-feedback-card small { margin-top:8px; color:var(--muted); font-size:11px; line-height:1.4; }
.request-feedback-card button { grid-column:1/-1; margin-top:6px; width:100%; min-height:46px; }

/* Modals blockieren auf Mobile die Bottom-Navigation – mehr Platz, weniger Doppel-Navigation */
body.modal-open { overflow:hidden; }

/* Wetter: Hauptzustand und Fahrhinweis klar getrennt, Fakten ohne Linien */
.dash-weather-hero {
  display:grid !important;
  grid-template-columns:74px minmax(0,1fr) !important;
  gap:14px 18px !important;
  align-items:center !important;
  padding:20px 20px 40px !important;
}
.weather-symbol { grid-column:1; grid-row:1; }
.weather-main { grid-column:2; min-width:0; }
.weather-main .weather-label { display:block; margin-bottom:4px; }
.weather-condition-row {
  display:flex !important;
  align-items:baseline !important;
  gap:14px !important;
  flex-wrap:wrap;
}
.weather-condition-row strong { font-size:38px !important; line-height:1 !important; letter-spacing:-.045em; }
.weather-condition-row span { font-size:16px !important; color:#2f3339 !important; }
.weather-driving {
  grid-column:1/-1;
  margin:0 !important;
  width:fit-content !important;
  max-width:100%;
  border-radius:13px !important;
  padding:8px 11px !important;
  font-size:11.5px !important;
  line-height:1.35;
}
.weather-facts {
  grid-column:1/-1;
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:12px 18px !important;
  margin:2px 0 0 !important;
  padding:0 !important;
  border:0 !important;
}
.weather-fact,
.weather-fact + .weather-fact,
.weather-fact:nth-child(even),
.weather-fact:nth-child(n+3) {
  display:grid !important;
  grid-template-columns:34px minmax(0,1fr) !important;
  align-items:center !important;
  gap:9px !important;
  min-height:48px !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
.weather-fact-icon { width:32px !important; height:32px !important; border-radius:11px !important; }
.weather-fact small { font-size:10.5px !important; }
.weather-fact strong { font-size:14px !important; }
.weather-location-active,.weather-location-button { bottom:13px !important; }

/* Nachtrag: offene Anträge des gewählten Mitarbeiters direkt sichtbar */
.correction-snapshot-grid { grid-template-columns:repeat(4,minmax(0,1fr)) !important; }
.correction-snapshot-grid .correction-pending { background:#fff8e8 !important; }
.correction-snapshot-grid .correction-pending strong { color:#986800 !important; }
.correction-open-requests {
  margin-top:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}
.correction-open-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:6px;
}
.correction-open-head strong { font-size:12.5px; }
.correction-open-head span {
  min-width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:#fff5df;
  color:#8e6200;
  font-size:11px;
  font-weight:700;
}
.correction-open-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:9px 0;
  border-top:1px solid var(--line);
}
.correction-open-row:first-of-type { border-top:0; }
.correction-open-row > div { min-width:0; }
.correction-open-row strong,.correction-open-row small { display:block; }
.correction-open-row strong { font-size:11.5px; }
.correction-open-row small { margin-top:2px; color:var(--muted); font-size:9.5px; }
.correction-open-row b { white-space:nowrap; color:#8e6200; font-size:11px; }
.correction-open-requests.empty-open { color:var(--muted); font-size:10.5px; text-align:center; }

/* Mitarbeiter-Unterseite auf Mobile nicht in gedrückte Spalten */
.employee-hub-cards.simplified .employee-hub-card {
  min-height:104px !important;
  grid-template-columns:48px minmax(0,1fr) 24px !important;
  align-items:center !important;
  padding:15px !important;
}
.employee-hub-cards.simplified .employee-hub-card > span { width:46px; height:46px; }
.employee-hub-cards.simplified .employee-hub-card strong { font-size:13.5px !important; line-height:1.25; }
.employee-hub-cards.simplified .employee-hub-card small { font-size:10.5px !important; line-height:1.4; margin-top:4px; }
.employee-hub-cards.simplified .employee-hub-card > i { position:static !important; justify-self:end; align-self:center; }

@media (max-width:980px) {
  .vacation-metric-grid-status { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .vacation-metric-grid-status .available-metric { grid-column:1/-1; }
  .vacation-list-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .weather-facts { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  .correction-snapshot-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}

@media (max-width:760px) {
  body.modal-open .mobile-nav { display:none !important; }
  body.modal-open { padding-bottom:0 !important; }

  .employee-hub-cards.simplified { grid-template-columns:1fr !important; }
  .employee-hub-cards.simplified .employee-hub-card { min-height:98px !important; }
  .dash-current-date { font-size:11px; }

  .dash-weather-hero {
    grid-template-columns:64px minmax(0,1fr) !important;
    gap:12px 14px !important;
    padding:18px 16px 40px !important;
  }
  .weather-symbol { width:58px !important; height:58px !important; }
  .weather-condition-row { gap:10px !important; }
  .weather-condition-row strong { font-size:34px !important; }
  .weather-condition-row span { font-size:14px !important; }
  .weather-driving { width:100% !important; justify-content:flex-start; }
  .weather-facts { gap:12px 10px !important; }
  .weather-fact { min-height:44px !important; }

  html:has(body.chat-compose-focus),
  body.chat-compose-focus { overflow:hidden !important; height:100% !important; overscroll-behavior:none !important; }
  body.chat-compose-focus .topbar,
  body.chat-compose-focus .mobile-nav { display:none !important; }
  body.chat-compose-focus .content-shell { padding:0 !important; }
  body.chat-compose-focus .chat-page.has-active {
    position:fixed !important;
    left:0 !important;
    right:0 !important;
    top:var(--rf-visual-top,0px) !important;
    z-index:180 !important;
    width:100vw !important;
    height:var(--rf-visual-height,100dvh) !important;
    min-height:0 !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    margin:0 !important;
  }
  body.chat-compose-focus .chat-conversation {
    height:100% !important;
    min-height:0 !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    background:#fff;
  }
  body.chat-compose-focus .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    overflow:auto !important;
    overscroll-behavior:contain;
  }
  body.chat-compose-focus .chat-composer {
    position:relative !important;
    bottom:auto !important;
    padding:8px 10px max(8px,env(safe-area-inset-bottom)) !important;
    background:#fff !important;
  }
}


/* =========================================================
   V22.5 – Kalender optisch an das restliche Mitarbeiterportal angeglichen
   ========================================================= */
.rf-calendar-modern { gap:14px; }
.rf-calendar-hero {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:14px 20px;
  align-items:center;
  padding:18px 20px 16px;
  overflow:hidden;
  position:relative;
  background:linear-gradient(135deg,#fff 0%,#fff 64%,#fff5f6 100%);
}
.rf-calendar-hero::after {
  content:'';
  position:absolute;
  width:180px;
  height:180px;
  right:-78px;
  top:-96px;
  border-radius:50%;
  background:rgba(204,32,56,.055);
  pointer-events:none;
}
.rf-calendar-hero-main { display:flex; align-items:center; gap:13px; min-width:0; position:relative; z-index:1; }
.rf-calendar-hero-icon {
  flex:0 0 46px;
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:var(--brand-soft);
  color:var(--brand);
  box-shadow:inset 0 0 0 1px rgba(204,32,56,.08);
}
.rf-calendar-hero-icon svg { width:22px; height:22px; }
.rf-calendar-modern .rf-calendar-title-button { cursor:pointer; }
.rf-calendar-modern .rf-calendar-title-button h2 { font-size:26px !important; line-height:1.08; letter-spacing:-.04em; }
.rf-calendar-modern .rf-calendar-title-button small { display:flex; align-items:center; gap:5px; margin-top:4px; font-size:10px; }
.rf-calendar-modern .rf-calendar-title-button small span { font-size:12px; transform:translateY(-1px); }
.rf-calendar-modern .rf-calendar-nav { position:relative; z-index:1; align-items:center; }
.rf-calendar-modern .rf-calendar-nav button { min-height:40px; border-radius:12px; }
.rf-calendar-modern .rf-calendar-nav .icon-only { width:40px; padding:0; font-size:17px; }
.rf-calendar-stats {
  grid-column:1/-1;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  position:relative;
  z-index:1;
}
.rf-calendar-stats > span {
  min-width:0;
  display:grid;
  grid-template-columns:8px auto minmax(0,1fr);
  align-items:center;
  gap:6px;
  padding:8px 10px;
  border:1px solid #f0f0f2;
  border-radius:12px;
  background:rgba(255,255,255,.82);
}
.rf-calendar-stats i { width:7px; height:7px; border-radius:50%; background:#adb2ba; }
.rf-calendar-stats b { font-size:12px; line-height:1; }
.rf-calendar-stats small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:9.5px; }
.rf-calendar-stats .approved i { background:var(--success); }
.rf-calendar-stats .submitted i { background:#e2a500; }
.rf-calendar-stats .intensive i { background:#4d7fc6; }
.rf-calendar-stats .block i { background:#d7374e; }

.rf-calendar-modern .rf-calendar-layout { gap:14px; }
.rf-calendar-modern .rf-calendar-card { padding:14px; border-radius:19px; }
.rf-calendar-modern .rf-cal-weekdays { margin-bottom:5px; }
.rf-calendar-modern .rf-cal-weekdays > div { padding:5px 0 8px; font-size:10px; letter-spacing:.03em; text-transform:uppercase; }
.rf-calendar-modern .rf-cal-weekdays > div.weekend { color:#b06c75; }
.rf-calendar-modern .rf-cal-grid { gap:5px; }
.rf-calendar-modern .rf-cal-day {
  min-height:94px;
  padding:8px;
  border:1px solid #f1f1f3;
  border-radius:14px;
  background:#fbfbfc;
  transition:transform .13s ease,box-shadow .13s ease,border-color .13s ease,background .13s ease;
  overflow:hidden;
}
.rf-calendar-modern .rf-cal-day.weekend:not(.selected):not(.today) { background:#fdfafa; }
.rf-calendar-modern .rf-cal-day:hover { transform:translateY(-1px); border-color:#e4e4e8; box-shadow:0 6px 18px rgba(29,31,36,.055); }
.rf-calendar-modern .rf-cal-day.outside { opacity:.28; background:#f7f7f8; }
.rf-calendar-modern .rf-cal-day.today { border-color:#f0aeba; background:#fff7f8; }
.rf-calendar-modern .rf-cal-day.selected {
  border-color:var(--brand);
  background:#fff;
  box-shadow:0 8px 24px rgba(204,32,56,.11),inset 0 0 0 1px rgba(204,32,56,.04);
}
.rf-calendar-modern .rf-cal-day.selected::before {
  content:'';
  position:absolute;
  left:0;
  right:0;
  top:0;
  height:3px;
  background:var(--brand);
}
.rf-calendar-modern .rf-cal-number { width:29px; height:29px; border-radius:10px; font-size:11.5px; font-weight:700; }
.rf-calendar-modern .rf-cal-day.today .rf-cal-number { box-shadow:0 4px 12px rgba(204,32,56,.22); }
.rf-calendar-modern .rf-cal-day.selected:not(.today) .rf-cal-number { color:var(--brand); background:var(--brand-soft); }
.rf-calendar-modern .rf-cal-day.blocked::after { width:7px; height:7px; top:9px; right:9px; box-shadow:0 0 0 3px #fff; }
.rf-cal-mini-events { width:100%; min-width:0; display:grid; gap:3px; align-self:stretch; margin-top:auto; }
.rf-cal-mini-event {
  display:block;
  width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:3px 5px;
  border-radius:6px;
  background:#f0f1f3;
  color:#666c75;
  font-size:8px;
  font-weight:700;
  line-height:1.15;
}
.rf-cal-mini-event.approved { background:#edf9f1; color:#287b49; }
.rf-cal-mini-event.submitted { background:#fff7df; color:#936900; }
.rf-cal-mini-event.reviewer_approved { background:#fff0f2; color:var(--brand); }
.rf-cal-mini-event.block { background:#fff0f2; color:#b9243a; }
.rf-cal-mini-event.intensive,.rf-cal-mini-event.course { background:#edf4ff; color:#3b67a4; }
.rf-calendar-modern .rf-cal-dots { display:none; }
.rf-cal-more { position:absolute; right:8px; bottom:7px; padding:1px 4px; border-radius:999px; background:#f0f1f3; color:#7b818a !important; font-size:7.5px !important; font-weight:700; }

.rf-calendar-modern .rf-cal-legend {
  gap:7px;
  margin-top:12px;
  padding-top:11px;
  border-top:1px solid #f0f0f2;
}
.rf-calendar-modern .rf-cal-legend span {
  padding:5px 8px;
  border-radius:999px;
  background:#f7f7f8;
  color:#6f747c;
  font-size:9px;
  font-weight:600;
}
.rf-calendar-modern .rf-cal-legend span i { width:6px; height:6px; }
.rf-calendar-modern .rf-cal-legend .approved i{background:var(--success)}
.rf-calendar-modern .rf-cal-legend .submitted i{background:#e2a500}
.rf-calendar-modern .rf-cal-legend .reviewer_approved i{background:var(--brand)}
.rf-calendar-modern .rf-cal-legend .block i{background:#d7374e}
.rf-calendar-modern .rf-cal-legend .intensive i{background:#4d7fc6}

.rf-calendar-modern .rf-day-panel { padding:16px; border-radius:19px; }
.rf-calendar-modern .rf-day-head {
  display:grid;
  grid-template-columns:52px minmax(0,1fr) auto;
  align-items:center;
  gap:11px;
  padding-bottom:14px;
  border-bottom:1px solid #f0f0f2;
}
.rf-day-date-badge {
  width:52px;
  height:58px;
  display:grid;
  align-content:center;
  justify-items:center;
  border-radius:15px;
  background:var(--brand);
  color:#fff;
  box-shadow:0 7px 18px rgba(204,32,56,.17);
}
.rf-day-date-badge b { font-size:21px; line-height:1; letter-spacing:-.03em; }
.rf-day-date-badge span { margin-top:4px; font-size:8px; font-weight:800; letter-spacing:.09em; opacity:.82; }
.rf-day-title { min-width:0; }
.rf-day-title > span { color:var(--muted); font-size:8.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; }
.rf-day-title strong { margin-top:2px; font-size:14px; line-height:1.2; }
.rf-day-title small { display:block; margin-top:3px; color:var(--muted); font-size:9.5px; }
.rf-day-count { width:30px !important; height:30px !important; border-radius:10px !important; font-size:11px !important; }
.rf-calendar-modern .rf-day-events { gap:8px; margin-top:12px; }
.rf-calendar-modern .rf-day-event {
  position:relative;
  grid-template-columns:4px minmax(0,1fr) auto;
  gap:9px;
  align-items:center;
  padding:10px 9px 10px 0;
  border:1px solid #f0f0f2;
  border-radius:12px;
  background:#fbfbfc;
  overflow:hidden;
}
.rf-calendar-modern .rf-day-event > i { align-self:stretch; width:4px; height:auto; min-height:34px; border-radius:0 999px 999px 0; }
.rf-calendar-modern .rf-day-event > div { min-width:0; }
.rf-calendar-modern .rf-day-event strong { font-size:11.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rf-calendar-modern .rf-day-event small { font-size:9.5px; white-space:normal; line-height:1.35; }
.rf-calendar-modern .rf-day-event > span {
  padding:4px 6px;
  border-radius:999px;
  background:#fff;
  color:#6f747c;
  font-size:8px;
  font-weight:700;
  white-space:nowrap;
}
.rf-calendar-modern .rf-day-event.approved > span { color:#287b49; background:#edf9f1; }
.rf-calendar-modern .rf-day-event.submitted > span { color:#936900; background:#fff7df; }
.rf-calendar-modern .rf-day-event.reviewer_approved > span,.rf-calendar-modern .rf-day-event.block > span { color:var(--brand); background:#fff0f2; }
.rf-calendar-modern .rf-day-event.intensive > span,.rf-calendar-modern .rf-day-event.course > span { color:#3b67a4; background:#edf4ff; }
.rf-calendar-modern .rf-day-empty {
  min-height:180px;
  display:grid;
  place-items:center;
  align-content:center;
  text-align:center;
  gap:5px;
  padding:24px 12px;
}
.rf-calendar-modern .rf-day-empty > span { width:42px; height:42px; display:grid; place-items:center; border-radius:14px; background:#f5f5f7; color:#a0a5ad; }
.rf-calendar-modern .rf-day-empty svg { width:20px; height:20px; }
.rf-calendar-modern .rf-day-empty strong { color:#4d5158; font-size:12px; }
.rf-calendar-modern .rf-day-empty small { max-width:190px; color:var(--muted); font-size:9.5px; line-height:1.4; }

@media (max-width:760px) {
  .rf-calendar-modern { gap:10px; }
  .rf-calendar-hero { grid-template-columns:1fr; gap:11px; padding:15px; border-radius:17px; }
  .rf-calendar-hero-main { gap:10px; }
  .rf-calendar-hero-icon { width:42px; height:42px; flex-basis:42px; border-radius:13px; }
  .rf-calendar-modern .rf-calendar-title-button h2 { font-size:21px !important; }
  .rf-calendar-modern .rf-calendar-title-button small { font-size:9px; }
  .rf-calendar-modern .rf-calendar-nav { display:grid; grid-template-columns:42px minmax(0,1fr) 42px; width:100%; gap:7px; }
  .rf-calendar-modern .rf-calendar-nav button { width:100% !important; min-height:39px; }
  .rf-calendar-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
  .rf-calendar-stats > span { padding:7px 8px; border-radius:10px; }
  .rf-calendar-stats small { font-size:8.8px; }
  .rf-calendar-modern .rf-calendar-card { padding:8px; border-radius:16px; }
  .rf-calendar-modern .rf-cal-weekdays > div { padding:5px 0 7px; font-size:8.7px; }
  .rf-calendar-modern .rf-cal-grid { gap:3px; }
  .rf-calendar-modern .rf-cal-day { min-height:58px; padding:5px; border-radius:10px; }
  .rf-calendar-modern .rf-cal-number { width:23px; height:23px; border-radius:8px; font-size:10px; }
  .rf-cal-mini-events { display:none; }
  .rf-calendar-modern .rf-cal-dots { display:flex; gap:2px; margin-top:auto; }
  .rf-calendar-modern .event-dot { width:5px; height:5px; }
  .rf-cal-more { right:4px; bottom:4px; font-size:7px !important; padding:1px 3px; }
  .rf-calendar-modern .rf-cal-legend { gap:5px; margin-top:9px; padding-top:8px; }
  .rf-calendar-modern .rf-cal-legend span { padding:4px 6px; font-size:8px; }
  .rf-calendar-modern .rf-day-panel { padding:13px; border-radius:16px; }
  .rf-calendar-modern .rf-day-head { grid-template-columns:46px minmax(0,1fr) auto; gap:9px; padding-bottom:11px; }
  .rf-day-date-badge { width:46px; height:51px; border-radius:13px; }
  .rf-day-date-badge b { font-size:19px; }
  .rf-day-title strong { font-size:13px; }
  .rf-calendar-modern .rf-day-event { grid-template-columns:4px minmax(0,1fr); padding:9px 8px 9px 0; }
  .rf-calendar-modern .rf-day-event > span { grid-column:2; justify-self:start; }
  .rf-calendar-modern .rf-day-empty { min-height:120px; }
}

/* Korrektur gegen ältere generische Tageskopf-Regel */
.rf-calendar-modern .rf-day-date-badge b {
  width:auto !important;
  height:auto !important;
  display:block !important;
  border-radius:0 !important;
  background:transparent !important;
  color:inherit !important;
}

/* =========================================================
   V22.6 – Tablet-Layout, stabiler Chat & Urlaubsfeedback
   ========================================================= */

/* Urlaubsfeedback lebt innerhalb der bereits geöffneten Antragsmaske.
   So bleibt der Kontext sichtbar, ohne dass Hinweise hinter der Maske landen. */
.request-feedback-layer {
  position:absolute;
  inset:0;
  z-index:25;
  display:grid;
  place-items:center;
  padding:22px;
  background:rgba(21,23,27,.48);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}
.request-feedback-card {
  width:min(470px,100%);
  max-height:min(620px,calc(100dvh - 48px));
  overflow:auto;
  display:grid;
  gap:14px;
  padding:20px;
  border:1px solid rgba(204,32,56,.16);
  border-radius:22px;
  background:#fff;
  box-shadow:0 28px 80px rgba(18,20,24,.28);
}
.request-feedback-heading {
  display:grid;
  grid-template-columns:48px minmax(0,1fr);
  gap:12px;
  align-items:center;
}
.request-feedback-heading > div { min-width:0; }
.request-feedback-heading .eyebrow-chip { margin-bottom:5px; }
.request-feedback-heading strong {
  display:block;
  color:var(--ink);
  font-size:17px;
  line-height:1.22;
  letter-spacing:-.02em;
}
.request-feedback-card > p {
  margin:0;
  color:#555b64;
  font-size:13px;
  line-height:1.5;
}
.request-feedback-details {
  display:grid;
  gap:7px;
  padding:11px;
  border:1px solid #eceef1;
  border-radius:14px;
  background:#fafbfc;
}
.request-feedback-details > div {
  min-width:0;
  display:grid;
  grid-template-columns:70px minmax(0,1fr);
  gap:9px;
  align-items:start;
}
.request-feedback-details span {
  color:var(--muted);
  font-size:10px;
  font-weight:600;
}
.request-feedback-details strong {
  min-width:0;
  color:#3e434a;
  font-size:11.5px;
  font-weight:650;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.request-feedback-card > button { width:100%; min-height:47px; }
.request-feedback-open > .modal { pointer-events:none; }
.request-feedback-open .request-feedback-layer { pointer-events:auto; }

/* Medienstatus darf Titel auf keinem mittleren Viewport überdecken. */
.media-polaroid-title { min-width:0; }
.media-polaroid-title strong { overflow-wrap:anywhere; }
.media-polaroid-title .media-status {
  max-width:100%;
  white-space:normal;
  line-height:1.15;
  text-align:center;
}

/* Eigenes Tablet-Raster statt verkleinertem Desktop. */
@media (min-width:761px) and (max-width:1199px) {
  .app-frame { grid-template-columns:210px minmax(0,1fr) !important; }
  .sidebar { padding-inline:11px !important; }
  .brand-main-logo { width:164px !important; }
  .topbar { padding-inline:18px !important; }
  .content-shell {
    width:100% !important;
    max-width:none !important;
    padding:18px 18px 34px !important;
  }

  .dash-shell,
  .vacation-mode-bar,
  .vacation-overview-section,
  .vacation-requests-panel,
  .team-vacation-panel,
  .rf-calendar-page,
  .media-hero,
  .media-storage,
  .media-toolbar,
  .media-grid,
  .feed-layout,
  .setup-grid,
  .setup-detail,
  .setup-detail-head {
    width:100% !important;
    max-width:none !important;
    margin-left:0 !important;
    margin-right:0 !important;
  }

  .media-grid {
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:12px !important;
  }
  .media-polaroid-title {
    grid-template-columns:1fr !important;
    gap:6px !important;
  }
  .media-polaroid-title .media-status {
    justify-self:start !important;
    text-align:left;
  }
  .media-polaroid-caption { min-height:86px; }

  .vacation-metric-grid-status,
  .vacation-list-metrics {
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  }
  .vacation-metric-grid-status > *,
  .vacation-list-metrics > * { grid-column:span 2 !important; }
  .vacation-metric-grid-status > *:nth-last-child(-n+2),
  .vacation-list-metrics > *:nth-last-child(-n+2) { grid-column:span 3 !important; }
  .vacation-metric-grid-status .available-metric { grid-column:span 3 !important; }

  .feed-layout { grid-template-columns:minmax(0,1fr) !important; }
  .feed-card { padding:17px !important; }

  .chat-page {
    width:100% !important;
    grid-template-columns:250px minmax(0,1fr) !important;
    height:calc(100dvh - 118px) !important;
    min-height:560px !important;
  }
  .chat-list-panel { min-width:0; }
  .chat-conversation { min-width:0; }
  .chat-thread { padding:11px 10px; }
  .chat-messages { padding:16px 14px; }

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

/* Auf größeren Tablets liegt die Tagesansicht neben dem Monat und nutzt die Fläche sinnvoll. */
@media (min-width:1000px) and (max-width:1199px) {
  .rf-calendar-layout {
    grid-template-columns:minmax(0,1.55fr) minmax(230px,.7fr) !important;
    align-items:start;
  }
  .rf-day-panel {
    position:sticky !important;
    top:82px !important;
    margin-top:0 !important;
  }
  .rf-calendar-modern .rf-cal-day { min-height:74px; }
}

/* Chat: auf Touch-Geräten wird beim Tippen nur der Chat an den sichtbaren
   Keyboard-Viewport geheftet. Die Dokumentseite selbst bleibt an ihrer Stelle. */
@media (max-width:1180px) and (pointer:coarse) {
  html:has(body.chat-compose-focus),
  body.chat-compose-focus {
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.chat-compose-focus .sidebar,
  body.chat-compose-focus .sidebar-backdrop,
  body.chat-compose-focus .topbar,
  body.chat-compose-focus .mobile-nav { display:none !important; }
  body.chat-compose-focus .workspace,
  body.chat-compose-focus .content-shell,
  body.chat-compose-focus #app {
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
  }
  body.chat-compose-focus .chat-page.has-active {
    position:fixed !important;
    left:0 !important;
    right:auto !important;
    top:var(--rf-visual-top,0px) !important;
    z-index:500 !important;
    width:100vw !important;
    height:var(--rf-visual-height,100dvh) !important;
    min-height:0 !important;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    display:block !important;
    background:#fff !important;
  }
  body.chat-compose-focus .chat-page.has-active .chat-list-panel { display:none !important; }
  body.chat-compose-focus .chat-page.has-active .chat-conversation {
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    overflow:hidden !important;
    background:#fff !important;
  }
  body.chat-compose-focus .chat-conversation-head {
    padding:10px 12px !important;
    padding-top:max(10px,env(safe-area-inset-top)) !important;
  }
  body.chat-compose-focus .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    height:auto !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    overscroll-behavior:contain !important;
    -webkit-overflow-scrolling:touch;
  }
  body.chat-compose-focus .chat-composer {
    position:relative !important;
    inset:auto !important;
    width:100% !important;
    margin:0 !important;
    padding:8px 10px max(8px,env(safe-area-inset-bottom)) !important;
    border-top:1px solid var(--line) !important;
    background:#fff !important;
    box-shadow:0 -5px 18px rgba(25,28,33,.05);
  }
  body.chat-compose-focus .chat-composer textarea {
    min-height:44px !important;
    font-size:16px !important;
  }
}

@media (max-width:760px) {
  .request-feedback-layer {
    padding:14px;
    align-items:center;
  }
  .request-feedback-card {
    width:100%;
    max-height:calc(var(--rf-visual-height,100dvh) - 28px);
    padding:17px;
    border-radius:19px;
  }
  .request-feedback-heading { grid-template-columns:44px minmax(0,1fr); gap:10px; }
  .request-feedback-icon { width:44px; height:44px; border-radius:13px; }
  .request-feedback-heading strong { font-size:16px; }
  .request-feedback-details > div { grid-template-columns:62px minmax(0,1fr); }

  .chat-page {
    height:calc(100dvh - 148px) !important;
    min-height:0 !important;
  }
}

/* =========================================================
   V22.7 – Mobile Lesbarkeit, Chat-Abstand & Tablet-Dichte
   ========================================================= */

/* Dashboard: nur Wochentag + Datum, bewusst ohne Uhrzeit. */
.dash-current-date { gap:0 !important; }
.dash-current-date i { display:none !important; }

/* Tablet soll wie eine echte Tablet-App wirken – nicht wie verkleinerter Desktop. */
@media (min-width:761px) and (max-width:1199px) {
  .app-frame { grid-template-columns:190px minmax(0,1fr) !important; }
  .sidebar { padding:16px 12px !important; }
  .brand-main-logo { width:150px !important; max-width:100% !important; }
  .topbar { padding-inline:20px !important; }
  .content-shell {
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
    padding:20px 22px 40px !important;
  }

  .dash-shell,
  .vacation-mode-bar,
  .vacation-overview-section,
  .vacation-requests-panel,
  .team-vacation-panel,
  .rf-calendar-page,
  .feed-layout,
  .setup-grid,
  .setup-detail,
  .setup-detail-head,
  .employee-setup,
  .planning-admin-stack,
  .limits-admin-stack {
    width:100% !important;
    max-width:none !important;
    margin-left:0 !important;
    margin-right:0 !important;
  }

  /* Dashboard nutzt den Platz wie das Intranet: klare 2-Spalten-Fläche,
     Medienvorschau bewusst über die ganze Breite. */
  .dash-grid-main { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:14px !important; }
  .dash-grid-main > .dash-media-card-wrap { grid-column:1/-1 !important; }
  .dash-media-grid { grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:10px !important; }
  .dash-card { padding:18px !important; }
  .dash-card-head h3 { font-size:16px !important; }
  .dash-empty { font-size:12.5px !important; }
  .dash-greeting-line span { font-size:17px !important; }
  .dash-greeting-line strong { font-size:27px !important; }
  .dash-current-date { font-size:12px !important; }

  /* Urlaub: auf normalem iPad alle fünf Statuswerte in einer echten Reihe. */
  .vacation-metric-grid-status,
  .vacation-list-metrics { grid-template-columns:repeat(5,minmax(0,1fr)) !important; gap:10px !important; }
  .vacation-metric-grid-status > *,
  .vacation-list-metrics > *,
  .vacation-metric-grid-status > *:nth-last-child(-n+2),
  .vacation-list-metrics > *:nth-last-child(-n+2),
  .vacation-metric-grid-status .available-metric { grid-column:auto !important; }
  .vacation-metric { min-height:102px !important; padding:15px !important; }
  .vacation-metric span { font-size:11px !important; }
  .vacation-metric strong { font-size:27px !important; }
  .vacation-metric small { font-size:10px !important; line-height:1.3; }

  /* Team-Feed und Setup erhalten dieselbe Lesedichte wie die Hauptseiten. */
  .feed-card { padding:19px !important; }
  .feed-card h3 { font-size:17px !important; }
  .feed-card p { font-size:12.5px !important; }
  .feed-meta strong { font-size:12px !important; }
  .feed-meta span,.feed-card-footer { font-size:10.5px !important; }

  .setup-tile,
  .setup-subtile,
  .employee-hub-card,
  .planning-hub-card { padding:16px !important; }
  .setup-subtile strong,
  .employee-hub-card strong,
  .planning-hub-card strong { font-size:13.5px !important; }
  .setup-subtile small,
  .employee-hub-card small,
  .planning-hub-card small { font-size:10.8px !important; line-height:1.42 !important; }

  /* Kalender auf Tablet etwas größer und ruhiger als bisher. */
  .rf-calendar-modern .rf-cal-weekdays > div { font-size:10.5px !important; }
  .rf-calendar-modern .rf-cal-day { min-height:82px !important; padding:7px !important; }
  .rf-calendar-modern .rf-cal-number { width:28px !important; height:28px !important; font-size:11.5px !important; }
  .rf-cal-mini-event { font-size:8.8px !important; padding:3px 5px !important; }
  .rf-calendar-modern .rf-cal-legend span { font-size:9.5px !important; }
  .rf-day-title strong { font-size:14px !important; }
  .rf-calendar-modern .rf-day-event strong { font-size:11.8px !important; }
}

/* Bei kleineren Tablets bleibt Urlaub in 3 + 2 Kacheln lesbar. */
@media (min-width:761px) and (max-width:899px) {
  .vacation-metric-grid-status,
  .vacation-list-metrics { grid-template-columns:repeat(6,minmax(0,1fr)) !important; }
  .vacation-metric-grid-status > *,
  .vacation-list-metrics > * { grid-column:span 2 !important; }
  .vacation-metric-grid-status > *:nth-last-child(-n+2),
  .vacation-list-metrics > *:nth-last-child(-n+2) { grid-column:span 3 !important; }
  .vacation-metric-grid-status .available-metric { grid-column:span 3 !important; }
}

/* Mobile Chat vor dem Tippen: der Composer endet oberhalb der Bottom-Navigation.
   Beim Fokus übernimmt weiterhin der VisualViewport-Modus aus V22.6. */
@media (max-width:760px) {
  .chat-page.has-active {
    height:calc(100dvh - 200px - env(safe-area-inset-bottom)) !important;
    min-height:0 !important;
    max-height:none !important;
    margin-bottom:8px !important;
  }
  .chat-page.has-active .chat-conversation { min-height:0 !important; }
  .chat-page.has-active .chat-messages { min-height:0 !important; max-height:none !important; }
  .chat-page.has-active .chat-composer {
    position:relative !important;
    z-index:3;
    padding:9px 9px 10px !important;
    background:#fff !important;
    border-top:1px solid var(--line) !important;
  }
  .chat-page.has-active .chat-composer textarea {
    min-height:44px !important;
    font-size:16px !important;
  }

  /* Mitarbeiter-Unterseite spricht exakt dieselbe Kachelsprache wie
     Abwesenheitslimits und Planung & Sperrzeiten. */
  .employee-hub-cards.simplified {
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:12px !important;
  }
  .employee-hub-cards.simplified .employee-hub-card {
    position:relative !important;
    min-height:126px !important;
    grid-template-columns:1fr !important;
    grid-template-rows:auto auto !important;
    align-content:start !important;
    align-items:start !important;
    gap:10px !important;
    padding:14px !important;
    border-radius:18px !important;
  }
  .employee-hub-cards.simplified .employee-hub-card > span {
    width:40px !important;
    height:40px !important;
    border-radius:13px !important;
  }
  .employee-hub-cards.simplified .employee-hub-card > div { min-width:0; }
  .employee-hub-cards.simplified .employee-hub-card strong {
    font-size:13px !important;
    line-height:1.25 !important;
  }
  .employee-hub-cards.simplified .employee-hub-card small {
    margin-top:4px !important;
    font-size:10.5px !important;
    line-height:1.35 !important;
  }
  .employee-hub-cards.simplified .employee-hub-card > i {
    position:absolute !important;
    right:13px !important;
    top:13px !important;
    font-size:20px !important;
  }
  .employee-hub-cards.simplified .employee-hub-card:last-child:nth-child(odd) {
    grid-column:1/-1 !important;
  }

  /* Mobile Kalender: gleiche Gestaltung, aber nicht mehr wie herausgezoomt. */
  .rf-calendar-modern { gap:12px !important; }
  .rf-calendar-hero { padding:17px !important; gap:13px !important; }
  .rf-calendar-hero-main { gap:11px !important; }
  .rf-calendar-hero-icon { width:44px !important; height:44px !important; flex-basis:44px !important; }
  .rf-calendar-modern .rf-calendar-title-button h2 { font-size:24px !important; }
  .rf-calendar-modern .rf-calendar-title-button small { font-size:10.5px !important; margin-top:5px !important; }
  .rf-calendar-modern .rf-calendar-nav { grid-template-columns:44px minmax(0,1fr) 44px !important; gap:8px !important; }
  .rf-calendar-modern .rf-calendar-nav button { min-height:42px !important; font-size:12px !important; }

  .rf-calendar-stats { gap:7px !important; }
  .rf-calendar-stats > span { padding:9px 10px !important; gap:7px !important; }
  .rf-calendar-stats b { font-size:14px !important; }
  .rf-calendar-stats small { font-size:10px !important; }

  .rf-calendar-modern .rf-calendar-card { padding:10px !important; }
  .rf-calendar-modern .rf-cal-weekdays > div { padding:6px 0 8px !important; font-size:10.2px !important; }
  .rf-calendar-modern .rf-cal-grid { gap:4px !important; }
  .rf-calendar-modern .rf-cal-day { min-height:64px !important; padding:6px !important; border-radius:11px !important; }
  .rf-calendar-modern .rf-cal-number { width:27px !important; height:27px !important; border-radius:9px !important; font-size:12px !important; }
  .rf-calendar-modern .rf-cal-dots { gap:3px !important; }
  .rf-calendar-modern .event-dot { width:6px !important; height:6px !important; }
  .rf-cal-more { right:5px !important; bottom:5px !important; font-size:8px !important; }
  .rf-calendar-modern .rf-cal-legend { gap:6px !important; margin-top:10px !important; padding-top:9px !important; }
  .rf-calendar-modern .rf-cal-legend span { padding:5px 7px !important; font-size:9.2px !important; }
  .rf-calendar-modern .rf-day-panel { padding:14px !important; }
  .rf-calendar-modern .rf-day-head { grid-template-columns:48px minmax(0,1fr) auto !important; gap:10px !important; }
  .rf-day-date-badge { width:48px !important; height:54px !important; }
  .rf-day-date-badge b { font-size:20px !important; }
  .rf-day-title > span { font-size:9px !important; }
  .rf-day-title strong { font-size:14px !important; }
  .rf-day-title small { font-size:10px !important; }
  .rf-calendar-modern .rf-day-event strong { font-size:12px !important; }
  .rf-calendar-modern .rf-day-event small { font-size:10px !important; }
  .rf-calendar-modern .rf-day-empty strong { font-size:12.5px !important; }
  .rf-calendar-modern .rf-day-empty small { font-size:10px !important; }
}

@media (max-width:390px) {
  .employee-hub-cards.simplified { grid-template-columns:1fr !important; }
  .employee-hub-cards.simplified .employee-hub-card:last-child:nth-child(odd) { grid-column:auto !important; }
  .rf-calendar-modern .rf-cal-day { min-height:60px !important; padding:5px !important; }
  .rf-calendar-modern .rf-cal-number { width:25px !important; height:25px !important; font-size:11.5px !important; }
}

/* =========================================================
   V22.8 – Urlaubs-Sperrhinweis & Ein-Tap-Chat auf iPhone/iPad
   ========================================================= */

/* Eigene Klassennamen, damit ältere Feedback-Regeln nicht mehr in den
   Sperrhinweis hineinwirken können. Der Dialog bleibt kompakt und lesbar. */
.vacation-block-dialog-layer {
  position:fixed;
  inset:0;
  z-index:450;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(20,22,27,.52);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}
.vacation-block-dialog {
  width:min(470px,calc(100vw - 32px));
  max-height:calc(100dvh - 40px);
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:20px;
  border:1px solid rgba(204,32,56,.16);
  border-radius:22px;
  background:#fff;
  box-shadow:0 28px 80px rgba(18,20,24,.30);
}
.vacation-block-dialog-head {
  display:grid;
  grid-template-columns:48px minmax(0,1fr);
  gap:12px;
  align-items:center;
  min-width:0;
}
.vacation-block-dialog-head > div { min-width:0; }
.vacation-block-dialog-head .eyebrow-chip { margin-bottom:5px; }
.vacation-block-dialog-head strong {
  display:block;
  margin:0;
  color:var(--ink);
  font-size:18px;
  line-height:1.22;
  letter-spacing:-.02em;
  overflow-wrap:normal;
  word-break:normal;
}
.vacation-block-dialog-icon {
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:#fff0f2;
  color:var(--brand);
}
.vacation-block-dialog-message {
  margin:0;
  color:#555b64;
  font-size:13.5px;
  line-height:1.5;
  overflow-wrap:break-word;
}
.vacation-block-dialog-details {
  display:grid;
  gap:8px;
  padding:12px;
  border:1px solid #eceef1;
  border-radius:14px;
  background:#fafbfc;
}
.vacation-block-dialog-details > div {
  display:grid;
  grid-template-columns:74px minmax(0,1fr);
  gap:10px;
  align-items:start;
  min-width:0;
}
.vacation-block-dialog-details span {
  color:var(--muted);
  font-size:10.5px;
  font-weight:650;
}
.vacation-block-dialog-details strong {
  min-width:0;
  color:#34383e;
  font-size:12px;
  font-weight:700;
  line-height:1.4;
  overflow-wrap:break-word;
  word-break:normal;
}
.vacation-block-dialog > button {
  width:100%;
  min-height:47px;
  margin:0;
}
.vacation-block-dialog-open > .modal { pointer-events:none; }
.vacation-block-dialog-open .vacation-block-dialog-layer { pointer-events:auto; }

/* Im ruhenden mobilen Chat wird die Kartenhöhe per JS exakt bis oberhalb der
   Bottom-Navigation berechnet. Dadurch ist der Composer schon vor dem Tippen
   vollständig sichtbar und wird nicht mehr von der Navigation überdeckt. */
@media (max-width:760px) {
  .chat-page.has-active {
    height:var(--rf-chat-idle-height,calc(100svh - 170px)) !important;
    max-height:var(--rf-chat-idle-height,calc(100svh - 170px)) !important;
    min-height:320px !important;
    margin-bottom:0 !important;
  }
  body.chat-compose-focus .chat-page.has-active {
    height:var(--rf-visual-height,100dvh) !important;
    max-height:none !important;
    min-height:0 !important;
  }
  .vacation-block-dialog-layer {
    padding:14px;
    align-items:center;
  }
  .vacation-block-dialog {
    width:min(100%,460px);
    max-height:calc(100dvh - 28px);
    padding:17px;
    gap:12px;
    border-radius:20px;
  }
  .vacation-block-dialog-head {
    grid-template-columns:44px minmax(0,1fr);
    gap:10px;
  }
  .vacation-block-dialog-icon {
    width:44px;
    height:44px;
    border-radius:13px;
  }
  .vacation-block-dialog-head strong { font-size:17px; }
  .vacation-block-dialog-message { font-size:13px; }
  .vacation-block-dialog-details > div {
    grid-template-columns:68px minmax(0,1fr);
    gap:8px;
  }
  .vacation-block-dialog-details strong { font-size:11.5px; }
}

/* =========================================================
   V22.9 – Navigation, Dashboard-Polaroids & Wetter-Feinschliff
   ========================================================= */
.weather-location-button.active {
  color:#47505b;
  background:rgba(255,255,255,.9);
}

/* Dashboard-Medien wie kleine Polaroids statt Listen-Karten. */
.dash-media-grid {
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:12px !important;
  align-items:start;
}
.dash-media-card {
  display:block !important;
  min-width:0;
  padding:7px 7px 10px !important;
  border:1px solid #e5e7eb !important;
  border-radius:11px !important;
  background:#fff !important;
  box-shadow:0 7px 18px rgba(31,34,39,.08);
  text-align:left;
  transform:rotate(-.35deg);
  transition:transform .16s ease, box-shadow .16s ease;
}
.dash-media-card:nth-child(even) { transform:rotate(.35deg); }
.dash-media-card:hover { transform:translateY(-2px) rotate(0); box-shadow:0 10px 22px rgba(31,34,39,.11); }
.dash-media-thumb {
  width:100% !important;
  aspect-ratio:4/5 !important;
  border-radius:7px !important;
  overflow:hidden;
  background:#f2f3f5;
}
.dash-media-copy { padding:7px 2px 0; }
.dash-media-card strong {
  margin:0 !important;
  font-size:11.5px !important;
  line-height:1.22 !important;
  display:-webkit-box !important;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden !important;
}
.dash-media-card small {
  display:block !important;
  margin-top:4px !important;
  font-size:9.5px !important;
  line-height:1.2 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

@media (max-width:760px) {
  .mobile-nav { grid-template-columns:repeat(4,minmax(0,1fr)) !important; grid-auto-flow:unset !important; grid-auto-columns:unset !important; overflow-x:hidden !important; }
  .mobile-nav-item { min-width:0 !important; font-size:10px !important; }
  .dash-media-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:10px !important; }
  .dash-media-card { padding:6px 6px 9px !important; }
  .dash-media-card strong { font-size:11px !important; }
  .dash-media-card small { font-size:9px !important; }
}

/* =========================================================
   V23 – Tablet neu skaliert + Urlaubsanträge wie im Intranet
   ========================================================= */

/* Eigene Anträge: Filter, klickbare Zeilen und Detailansicht */
.vacation-request-toolbar {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin:-2px 0 12px;
}
.vacation-request-toolbar label {
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:11px;
  font-weight:650;
}
.vacation-request-toolbar select {
  min-height:38px;
  padding:0 34px 0 11px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  color:var(--ink);
  font:inherit;
}
.request-card-openable {
  position:relative;
  cursor:pointer;
  transition:border-color .14s ease, box-shadow .14s ease, transform .14s ease, background .14s ease;
}
.request-card-openable:hover,
.request-card-openable:focus-visible {
  border-color:#e2b2b8 !important;
  box-shadow:0 8px 22px rgba(31,34,39,.07);
  outline:none;
}
.request-card-openable:hover { transform:translateY(-1px); }
.request-status-stack {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
}
.request-open-chevron {
  color:#a5a9b0;
  font-style:normal;
  font-size:22px;
  line-height:1;
}
.cancel-request-badge {
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:3px 8px;
  border-radius:999px;
  background:#fff0f2;
  color:var(--brand);
  font-size:9.5px;
  font-weight:750;
  white-space:nowrap;
}
.vacation-list-request.request-card-openable {
  grid-template-columns:minmax(0,1fr) auto auto !important;
  gap:10px !important;
  align-items:center;
}

.vacation-detail-modal-root .modal,
.vacation-cancel-modal-root .modal { width:min(650px,calc(100vw - 32px)); }
.vacation-detail-modal { display:grid; gap:16px; }
.vacation-detail-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding-bottom:14px;
  border-bottom:1px solid var(--line);
}
.vacation-detail-heading > div { min-width:0; }
.vacation-detail-heading h3 { margin:6px 0 3px; font-size:23px; letter-spacing:-.03em; }
.vacation-detail-heading p { margin:0; color:var(--muted); font-size:12.5px; line-height:1.45; }
.vacation-detail-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
}
.vacation-detail-grid > div {
  min-width:0;
  padding:12px 13px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#fafbfc;
}
.vacation-detail-grid span,
.vacation-detail-grid strong { display:block; }
.vacation-detail-grid span { color:var(--muted); font-size:9.5px; font-weight:650; }
.vacation-detail-grid strong { margin-top:4px; font-size:12.5px; line-height:1.35; overflow-wrap:anywhere; }
.vacation-detail-note,
.vacation-cancel-note {
  padding:13px 14px;
  border:1px solid #eceef1;
  border-radius:13px;
  background:#fafbfc;
}
.vacation-detail-note span { color:var(--muted); font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.vacation-detail-note p,
.vacation-cancel-note p { margin:5px 0 0; font-size:12px; line-height:1.5; }
.vacation-cancel-note { border-color:#f1c8ce; background:#fff5f6; color:#923047; }
.vacation-cancel-note.handled { border-color:#dce1e6; background:#f5f7f9; color:#56606d; }
.vacation-detail-timeline {
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}
.vacation-detail-timeline h4 { margin:0 0 11px; font-size:12px; }
.vacation-timeline-row {
  display:grid;
  grid-template-columns:13px minmax(0,1fr);
  gap:10px;
  position:relative;
  padding:0 0 13px;
}
.vacation-timeline-row:last-child { padding-bottom:0; }
.vacation-timeline-row::after {
  content:'';
  position:absolute;
  left:5px;
  top:13px;
  bottom:0;
  width:1px;
  background:#e5e7ea;
}
.vacation-timeline-row:last-child::after { display:none; }
.vacation-timeline-row > i {
  width:11px;
  height:11px;
  margin-top:2px;
  border-radius:50%;
  background:#9ca2ab;
  box-shadow:0 0 0 3px #f2f3f5;
}
.vacation-timeline-row.submitted > i { background:#dba100; }
.vacation-timeline-row.reviewer_approved > i { background:#7d5bd6; }
.vacation-timeline-row.approved > i { background:var(--success); }
.vacation-timeline-row.rejected > i,
.vacation-timeline-row.cancel-requested > i { background:var(--brand); }
.vacation-timeline-row.cancelled > i { background:#707782; }
.vacation-timeline-row strong,
.vacation-timeline-row span { display:block; }
.vacation-timeline-row strong { font-size:11.5px; }
.vacation-timeline-row span { margin-top:2px; color:var(--muted); font-size:9.5px; }
.vacation-detail-actions {
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  padding-top:2px;
}
.cancellation-request-card { border-color:#f0c9cf !important; background:#fffafb !important; }
.cancellation-request-card .ops-request-note { background:#fff2f4; }

/* Tablet: bewusst eigene Informationsdichte wie im bestehenden Intranet.
   Kein Desktop wird mehr auf ~70% zusammengequetscht. */
@media (min-width:761px) and (max-width:1199px) {
  .app-frame { grid-template-columns:188px minmax(0,1fr) !important; }
  .sidebar { padding:17px 11px !important; }
  .brand-main-logo { width:148px !important; }
  .topbar { min-height:66px !important; padding:0 18px !important; }
  .topbar h1 { font-size:19px !important; }
  .content-shell {
    width:100% !important;
    max-width:none !important;
    padding:24px 24px 48px !important;
  }

  /* Dashboard: Urlaub bekommt die volle Breite; Heute und News bilden darunter
     eine echte Zweierspalte. Dadurch verschwinden die winzigen Urlaubskacheln. */
  .dash-shell { gap:16px !important; }
  .dash-hero { padding:4px 4px 1px !important; }
  .dash-greeting-line span { font-size:18px !important; }
  .dash-greeting-line strong { font-size:31px !important; }
  .dash-current-date { margin-top:5px !important; font-size:13px !important; }
  .dash-weather-hero { padding:22px 22px 42px !important; border-radius:20px !important; }
  .weather-condition-row strong { font-size:40px !important; }
  .weather-condition-row span { font-size:15px !important; }
  .weather-label { font-size:11.5px !important; }
  .weather-driving { font-size:11.5px !important; }
  .weather-fact small { font-size:10.5px !important; }
  .weather-fact strong { font-size:13.5px !important; }

  .dash-grid-main {
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:16px !important;
  }
  .dash-grid-main > * { min-width:0; }
  .dash-vacation-card {
    order:-30;
    grid-column:1/-1 !important;
    padding:19px !important;
  }
  .dash-today-card { order:-20; grid-column:auto !important; }
  .dash-feed-card { order:-20; grid-column:auto !important; }
  .team-moment-card { order:-10; grid-column:1/-1 !important; }
  .dash-media-card-wrap { order:10; grid-column:1/-1 !important; padding:19px !important; }
  .dash-card { padding:18px !important; border-radius:19px !important; }
  .dash-card-head { margin-bottom:14px !important; }
  .dash-card-head h3 { font-size:17px !important; }
  .dash-card-head button,.dash-card-head span { font-size:12px !important; }
  .dash-empty { min-height:72px; font-size:13px !important; }
  .dash-feed-row strong,.dash-today-row strong { font-size:13.5px !important; }
  .dash-feed-row small,.dash-today-row span { font-size:11px !important; }

  .dash-vacation-card .vacation-metric-grid-status {
    display:grid !important;
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    gap:10px !important;
  }
  .dash-vacation-card .vacation-metric-grid-status > * { grid-column:span 2 !important; }
  .dash-vacation-card .vacation-metric-grid-status > *:nth-child(4),
  .dash-vacation-card .vacation-metric-grid-status > *:nth-child(5) { grid-column:span 3 !important; }
  .dash-vacation-card .vacation-metric {
    min-height:104px !important;
    padding:15px !important;
  }
  .dash-vacation-card .vacation-metric span { font-size:11px !important; }
  .dash-vacation-card .vacation-metric strong { font-size:29px !important; }
  .dash-vacation-card .vacation-metric small { font-size:10.5px !important; line-height:1.35 !important; }
  .dash-media-grid { grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:13px !important; }
  .dash-media-card strong { font-size:12px !important; }
  .dash-media-card small { font-size:10px !important; }

  /* Urlaub-Hauptseite: keine fünf schmalen Säulen mehr. */
  .vacation-overview-section,
  .vacation-requests-panel,
  .vacation-mode-bar,
  .team-vacation-panel { width:100% !important; max-width:none !important; }
  .vacation-overview-section .vacation-metric-grid-status,
  .vacation-list-metrics {
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    gap:11px !important;
  }
  .vacation-overview-section .vacation-metric-grid-status > *,
  .vacation-list-metrics > * { grid-column:span 2 !important; }
  .vacation-overview-section .vacation-metric-grid-status > *:nth-child(4),
  .vacation-overview-section .vacation-metric-grid-status > *:nth-child(5),
  .vacation-list-metrics > *:nth-child(4),
  .vacation-list-metrics > *:nth-child(5) { grid-column:span 3 !important; }
  .vacation-overview-section .vacation-metric,
  .vacation-list-metrics > * { min-height:112px !important; padding:16px !important; }
  .vacation-overview-section .vacation-metric span { font-size:11px !important; }
  .vacation-overview-section .vacation-metric strong { font-size:30px !important; }
  .vacation-overview-section .vacation-metric small { font-size:10.5px !important; line-height:1.35 !important; }
  .vacation-requests-panel { padding:19px !important; }
  .vacation-request-head h2 { font-size:20px !important; }
  .vacation-request-head p { font-size:12px !important; }
  .request-card { padding:14px 15px !important; border-radius:14px !important; }
  .request-title { font-size:13.5px !important; }
  .request-meta { font-size:11px !important; }

  /* Kalender: auf Tablet immer einspaltig. Der Detailtag liegt unter dem Monat,
     damit der Monatskalender die volle Inhaltsbreite bekommt. */
  .rf-calendar-page { width:100% !important; max-width:none !important; gap:16px !important; }
  .rf-calendar-modern .rf-calendar-hero { padding:21px 22px 18px !important; border-radius:20px !important; }
  .rf-calendar-hero-icon { width:52px !important; height:52px !important; flex-basis:52px !important; }
  .rf-calendar-modern .rf-calendar-title-button h2 { font-size:29px !important; }
  .rf-calendar-modern .rf-calendar-title-button small { font-size:11px !important; }
  .rf-calendar-modern .rf-calendar-nav button { min-height:44px !important; font-size:12px !important; }
  .rf-calendar-stats > span { padding:10px 12px !important; }
  .rf-calendar-stats b { font-size:14px !important; }
  .rf-calendar-stats small { font-size:10px !important; }
  .rf-calendar-modern .rf-calendar-layout {
    grid-template-columns:minmax(0,1fr) !important;
    gap:16px !important;
  }
  .rf-calendar-modern .rf-calendar-card { width:100% !important; padding:16px !important; border-radius:20px !important; }
  .rf-calendar-modern .rf-cal-weekdays > div { padding:8px 0 10px !important; font-size:12px !important; }
  .rf-calendar-modern .rf-cal-grid { gap:7px !important; }
  .rf-calendar-modern .rf-cal-day {
    min-height:100px !important;
    padding:9px !important;
    border-radius:14px !important;
  }
  .rf-calendar-modern .rf-cal-number { width:34px !important; height:34px !important; font-size:14px !important; }
  .rf-cal-mini-event { padding:4px 6px !important; font-size:9.5px !important; }
  .rf-calendar-modern .rf-cal-legend { gap:8px !important; }
  .rf-calendar-modern .rf-cal-legend span { padding:6px 9px !important; font-size:10px !important; }
  .rf-calendar-modern .rf-day-panel {
    position:static !important;
    top:auto !important;
    width:100% !important;
    min-height:180px;
    padding:18px !important;
    border-radius:20px !important;
  }
  .rf-calendar-modern .rf-day-title strong { font-size:15px !important; }
  .rf-calendar-modern .rf-day-title small { font-size:10.5px !important; }
  .rf-calendar-modern .rf-day-event strong { font-size:13px !important; }
  .rf-calendar-modern .rf-day-event small { font-size:10.5px !important; }

  /* Team-Feed: etwas größere Lesedichte. */
  .feed-layout { width:100% !important; max-width:none !important; }
  .feed-card { padding:20px !important; border-radius:18px !important; }
  .feed-card h3 { font-size:18px !important; }
  .feed-card p { font-size:13px !important; line-height:1.5 !important; }

  /* iPad-Chat bleibt im Portal. Nur die Höhe schrumpft über VisualViewport. */
  .chat-page {
    width:100% !important;
    grid-template-columns:260px minmax(0,1fr) !important;
    height:var(--rf-chat-tablet-height,calc(100dvh - 126px)) !important;
    max-height:var(--rf-chat-tablet-height,calc(100dvh - 126px)) !important;
    min-height:390px !important;
  }
  .chat-conversation { min-height:0 !important; }
  .chat-messages { min-height:0 !important; overflow-y:auto !important; }
  .chat-composer { flex:0 0 auto; }

  /* Falls Safari eine alte focus-Klasse noch im DOM erwischt, darf sie auf
     Tablet niemals die Portalnavigation ausblenden. */
  body.chat-compose-focus .sidebar,
  body.chat-compose-focus .topbar { display:flex !important; }
  body.chat-compose-focus .sidebar { display:block !important; }
  body.chat-compose-focus .workspace,
  body.chat-compose-focus #app { width:auto !important; max-width:none !important; }
  body.chat-compose-focus .content-shell { width:100% !important; max-width:none !important; padding:24px 24px 48px !important; }
  body.chat-compose-focus .chat-page.has-active {
    position:static !important;
    inset:auto !important;
    width:100% !important;
    height:var(--rf-chat-tablet-height,calc(100dvh - 126px)) !important;
    max-height:var(--rf-chat-tablet-height,calc(100dvh - 126px)) !important;
    border:1px solid var(--line) !important;
    border-radius:18px !important;
    box-shadow:var(--shadow-card) !important;
    display:grid !important;
    grid-template-columns:260px minmax(0,1fr) !important;
  }
  body.chat-compose-focus .chat-page.has-active .chat-list-panel { display:block !important; }
  body.chat-compose-focus .chat-page.has-active .chat-conversation { display:grid !important; }
}

@media (min-width:761px) and (max-width:900px) {
  .content-shell { padding-inline:18px !important; }
  .dash-media-grid { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
  .rf-calendar-modern .rf-cal-day { min-height:86px !important; padding:8px !important; }
  .rf-cal-mini-event { font-size:8.5px !important; }
  .chat-page { grid-template-columns:230px minmax(0,1fr) !important; }
  body.chat-compose-focus .chat-page.has-active { grid-template-columns:230px minmax(0,1fr) !important; }
}

@media (max-width:760px) {
  .vacation-request-toolbar { justify-content:stretch; }
  .vacation-request-toolbar label { width:100%; justify-content:space-between; }
  .vacation-request-toolbar select { flex:1; }
  .request-status-stack { justify-content:flex-start; }
  .vacation-detail-modal-root .modal,
  .vacation-cancel-modal-root .modal { width:calc(100vw - 20px); }
  .vacation-detail-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; }
  .vacation-detail-heading h3 { font-size:20px; }
  .vacation-detail-grid { grid-template-columns:1fr 1fr; gap:7px; }
  .vacation-detail-grid > div { padding:10px 11px; }
  .vacation-detail-actions { display:grid; grid-template-columns:1fr; }
  .vacation-detail-actions button { width:100%; }
  .vacation-list-request.request-card-openable { grid-template-columns:minmax(0,1fr) auto !important; }
  .vacation-list-request.request-card-openable > button { grid-column:1/-1; width:100%; }
}

/* =========================================================
   V23.2 – Chat wie Messenger + ruhige Urlaubsansicht mobil
   ========================================================= */

/* iPhone: ein geöffneter Thread ist eine echte Vollbild-Unterhaltung.
   Portal-Header und Bottom-Navigation kommen erst über Zurück wieder. */
@media (max-width:760px) {
  body.chat-phone-thread-open {
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.chat-phone-thread-open .topbar,
  body.chat-phone-thread-open .mobile-nav,
  body.chat-phone-thread-open .sidebar,
  body.chat-phone-thread-open .sidebar-backdrop {
    display:none !important;
  }
  body.chat-phone-thread-open .workspace,
  body.chat-phone-thread-open .content-shell,
  body.chat-phone-thread-open #app {
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
  }
  body.chat-phone-thread-open .chat-page.has-active {
    position:fixed !important;
    left:0 !important;
    right:0 !important;
    top:var(--rf-chat-phone-top,0px) !important;
    width:100vw !important;
    height:var(--rf-chat-phone-height,100dvh) !important;
    min-height:0 !important;
    max-height:none !important;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    z-index:1000 !important;
    display:block !important;
    background:#fff !important;
  }
  body.chat-phone-thread-open .chat-page.has-active .chat-list-panel {
    display:none !important;
  }
  body.chat-phone-thread-open .chat-page.has-active .chat-conversation {
    display:grid !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    overflow:hidden !important;
    background:#fff !important;
  }
  body.chat-phone-thread-open .chat-conversation-head {
    min-height:68px !important;
    padding:calc(10px + env(safe-area-inset-top)) 14px 10px !important;
    background:#fff !important;
    border-bottom:1px solid var(--line) !important;
    z-index:4;
  }
  body.chat-phone-thread-open .chat-conversation-head strong { font-size:16px !important; }
  body.chat-phone-thread-open .chat-conversation-head span { font-size:12px !important; }
  body.chat-phone-thread-open .chat-back {
    width:42px !important;
    height:42px !important;
    border-radius:13px !important;
    flex:0 0 42px;
  }
  body.chat-phone-thread-open .chat-messages {
    min-height:0 !important;
    height:auto !important;
    max-height:none !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    padding:16px 12px 14px !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
  }
  body.chat-phone-thread-open .chat-composer {
    position:relative !important;
    inset:auto !important;
    z-index:5 !important;
    display:grid !important;
    grid-template-columns:44px minmax(0,1fr) 48px !important;
    gap:8px !important;
    align-items:end !important;
    width:100% !important;
    margin:0 !important;
    padding:9px 10px calc(9px + env(safe-area-inset-bottom)) !important;
    background:#fff !important;
    border-top:1px solid var(--line) !important;
    box-shadow:0 -5px 18px rgba(25,28,33,.04);
  }
  body.chat-phone-thread-open .chat-composer textarea {
    display:block !important;
    width:100% !important;
    min-height:44px !important;
    max-height:112px !important;
    padding:10px 13px !important;
    border-radius:16px !important;
    font-size:16px !important;
    line-height:1.35 !important;
    overflow-y:auto !important;
  }
  body.chat-phone-thread-open .chat-attach,
  body.chat-phone-thread-open .chat-send {
    width:44px !important;
    height:44px !important;
    min-width:44px !important;
    border-radius:14px !important;
  }
  body.chat-phone-thread-open .chat-send { width:48px !important; min-width:48px !important; }

  /* Alte Focus-Styles aus früheren Hotfixes dürfen im neuen Vollbild-Chat
     nichts mehr verschieben oder erneut die Seite umbauen. */
  body.chat-phone-thread-open.chat-compose-focus .chat-page.has-active {
    top:var(--rf-chat-phone-top,0px) !important;
    height:var(--rf-chat-phone-height,100dvh) !important;
  }

  /* Urlaub: Header und Filter bekommen Luft statt einer gequetschten Zeile. */
  .vacation-requests-panel {
    padding:16px !important;
    border-radius:20px !important;
  }
  .vacation-request-head {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    align-items:center !important;
    gap:12px !important;
    margin-bottom:14px !important;
  }
  .vacation-request-head h2 {
    margin:0 !important;
    font-size:22px !important;
    line-height:1.12 !important;
    letter-spacing:-.025em;
  }
  .vacation-request-head p { display:none !important; }
  .vacation-request-head .compact-primary {
    min-height:48px !important;
    padding:0 16px !important;
    border-radius:14px !important;
    font-size:13px !important;
    white-space:nowrap;
  }
  .vacation-request-toolbar {
    display:block !important;
    margin:0 0 14px !important;
  }
  .vacation-request-toolbar label {
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:6px !important;
    width:100% !important;
    color:var(--muted) !important;
    font-size:11px !important;
  }
  .vacation-request-toolbar label > span {
    padding-left:2px;
    font-weight:700;
  }
  .vacation-request-toolbar select {
    width:100% !important;
    min-height:46px !important;
    padding:0 42px 0 14px !important;
    border-radius:14px !important;
    font-size:14px !important;
    color:var(--ink) !important;
  }
  .vacation-requests-panel .request-list { gap:11px !important; }
  .vacation-requests-panel .request-card-openable {
    padding:15px 15px 14px !important;
    border-radius:17px !important;
    border:1px solid #e2e4e8 !important;
    box-shadow:0 5px 16px rgba(31,34,39,.035);
    background:#fff !important;
  }
  .vacation-requests-panel .request-top {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    gap:12px !important;
    align-items:start !important;
  }
  .vacation-requests-panel .request-title {
    font-size:16px !important;
    line-height:1.25 !important;
    font-weight:720 !important;
    letter-spacing:-.015em;
  }
  .vacation-requests-panel .request-meta {
    margin-top:5px !important;
    font-size:12.5px !important;
    line-height:1.45 !important;
    color:var(--muted) !important;
  }
  .vacation-requests-panel .request-note {
    margin:10px 0 0 !important;
    padding:9px 10px !important;
    border-radius:11px !important;
    background:#f7f8fa !important;
    font-size:12px !important;
    line-height:1.4 !important;
  }
  .vacation-requests-panel .request-status-stack {
    display:grid !important;
    grid-template-columns:auto 18px !important;
    gap:7px !important;
    align-items:center !important;
    justify-items:end !important;
    justify-content:end !important;
  }
  .vacation-requests-panel .request-open-chevron {
    font-size:25px !important;
    color:#a7adb5 !important;
  }
  .vacation-requests-panel .request-card-openable > .actions {
    display:none !important;
  }

  /* Detail-Bottomsheet: das X bekommt seinen eigenen Platz und kann den Status
     nie wieder überdecken. */
  .vacation-detail-modal-root .modal {
    width:100% !important;
    max-width:none !important;
    padding:18px 16px calc(18px + env(safe-area-inset-bottom)) !important;
    border-radius:24px 24px 0 0 !important;
  }
  .vacation-detail-modal-root .modal-close {
    top:14px !important;
    right:14px !important;
    z-index:8 !important;
    width:38px !important;
    height:38px !important;
    border-radius:12px !important;
    background:#f3f4f6 !important;
  }
  .vacation-detail-heading {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    gap:10px 12px !important;
    padding:2px 44px 16px 0 !important;
    align-items:start !important;
  }
  .vacation-detail-heading > .badge {
    align-self:start !important;
    justify-self:end !important;
    margin-top:2px !important;
  }
  .vacation-detail-heading h3 { font-size:23px !important; }
  .vacation-detail-heading p { font-size:13px !important; }
  .vacation-detail-grid { gap:9px !important; }
  .vacation-detail-grid > div { padding:12px !important; border-radius:14px !important; }
  .vacation-detail-grid span { font-size:10.5px !important; }
  .vacation-detail-grid strong { font-size:14px !important; }
  .vacation-detail-timeline { padding:15px !important; border-radius:16px !important; }
  .vacation-detail-timeline h4 { font-size:14px !important; }
  .vacation-timeline-row strong { font-size:13px !important; }
  .vacation-timeline-row span { font-size:11px !important; }
  .vacation-detail-actions button {
    min-height:48px !important;
    border-radius:14px !important;
    font-size:13px !important;
  }
}

@media (max-width:390px) {
  .vacation-request-head {
    grid-template-columns:1fr !important;
  }
  .vacation-request-head .compact-primary { width:100% !important; }
  .vacation-requests-panel .request-top {
    grid-template-columns:1fr !important;
  }
  .vacation-requests-panel .request-status-stack {
    grid-template-columns:auto 18px !important;
    justify-content:start !important;
    justify-items:start !important;
  }
  .vacation-detail-heading {
    grid-template-columns:1fr !important;
    padding-right:44px !important;
  }
  .vacation-detail-heading > .badge { justify-self:start !important; }
}


/* =========================================================
   V23.3 – Teamurlaub mobile: kompakte, klare Antragskarten
   ========================================================= */
.vacation-list-requests {
  gap:10px !important;
}
.vacation-list-request.request-card-openable {
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:center !important;
  gap:12px !important;
  padding:12px 13px !important;
  border:1px solid var(--line) !important;
  border-radius:14px !important;
  background:#fff !important;
  min-width:0;
}
.vacation-list-request.request-card-openable:first-child {
  border-top:1px solid var(--line) !important;
}
.vacation-list-request-main {
  min-width:0;
  display:grid;
  gap:7px;
}
.vacation-list-request-title {
  min-width:0;
  display:flex;
  align-items:baseline;
  gap:6px;
  flex-wrap:wrap;
}
.vacation-list-request-title strong {
  font-size:13px !important;
  line-height:1.25;
}
.vacation-list-request-title > span {
  margin:0 !important;
  font-size:12.5px !important;
  line-height:1.3;
  color:var(--ink) !important;
  font-weight:650;
}
.vacation-list-request-meta {
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.vacation-list-request-meta > span {
  margin:0 !important;
}
.vacation-list-request-status,
.vacation-list-cancel-flag,
.vacation-list-time {
  display:inline-flex !important;
  align-items:center;
  min-height:24px;
  padding:3px 8px;
  border-radius:999px;
  font-size:10px !important;
  line-height:1.2;
  white-space:nowrap;
}
.vacation-list-request-status {
  background:#f1f3f5;
  color:#5f6670 !important;
  font-weight:750;
}
.vacation-list-request-status.status-approved { background:#e9f7ef; color:#23704b !important; }
.vacation-list-request-status.status-submitted,
.vacation-list-request-status.status-reviewer_approved { background:#fff5d8; color:#956900 !important; }
.vacation-list-request-status.status-rejected { background:#fff0f1; color:#b63240 !important; }
.vacation-list-request-status.status-cancelled { background:#eef0f3; color:#626a75 !important; }
.vacation-list-cancel-flag { background:#fff0f2; color:var(--brand) !important; font-weight:750; }
.vacation-list-time { padding-left:0; padding-right:0; background:transparent; color:var(--muted) !important; }
.vacation-list-request-actions {
  display:flex;
  align-items:center;
  gap:5px;
}
.vacation-list-request-actions .request-open-chevron {
  width:28px;
  height:34px;
  display:grid;
  place-items:center;
  font-size:24px;
}
.vacation-list-delete-button {
  width:34px;
  height:34px;
  padding:0;
  display:grid;
  place-items:center;
  border:0;
  border-radius:10px;
  background:#fff1f2;
  color:#c83240;
  cursor:pointer;
  font-size:15px;
  line-height:1;
}
.vacation-list-delete-button:hover,
.vacation-list-delete-button:focus-visible {
  background:#ffe3e6;
  outline:none;
}

@media (max-width:760px) {
  .vacation-list-body { padding:12px !important; gap:14px !important; }
  .vacation-list-metrics { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important; }
  .vacation-list-metrics > div { min-height:82px; padding:12px 13px !important; }
  .vacation-list-metrics > div:last-child { grid-column:1/-1; }
  .vacation-list-metrics span { font-size:11px !important; }
  .vacation-list-metrics strong { font-size:22px !important; }
  .vacation-list-request.request-card-openable {
    grid-template-columns:minmax(0,1fr) auto !important;
    padding:12px !important;
  }
  .vacation-list-request.request-card-openable > button { width:34px !important; grid-column:auto !important; }
  .vacation-list-request-title { display:grid; gap:2px; }
  .vacation-list-request-title strong { font-size:13.5px !important; }
  .vacation-list-request-title > span { font-size:12px !important; font-weight:600; color:var(--muted) !important; }
}

/* =========================================================
   V23.4 – Urlaubsmodal, Tablet-Chat & Admin-Chat-Cleanup
   ========================================================= */

/* Chatliste: Systemadmin kann Test-Chats direkt und eindeutig entfernen. */
.chat-thread-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:4px;
  min-width:0;
  padding:1px 4px 1px 0;
  border-radius:13px;
}
.chat-thread-row.active { background:#fff0f3; }
.chat-thread-row .chat-thread { min-width:0; }
.chat-thread-delete {
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  padding:0;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#a7abb1;
  cursor:pointer;
}
.chat-thread-delete:hover,
.chat-thread-delete:focus-visible {
  background:#fff0f2;
  color:var(--brand);
  outline:none;
}
.chat-delete-icon { width:16px; height:16px; }
.chat-hard-delete {
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
}

/* Avatare bleiben in jeder Chatansicht exakt quadratisch und zentriert. */
.chat-thread-avatar {
  flex:0 0 auto;
  overflow:hidden;
  line-height:1;
  text-align:center;
  aspect-ratio:1/1;
}
.chat-thread-avatar.avatar-photo img,
.person-avatar.avatar-photo img,
.profile-avatar.avatar-photo img {
  width:100% !important;
  height:100% !important;
  display:block !important;
  object-fit:cover !important;
  object-position:50% 50% !important;
  transform:none !important;
}

/* Urlaub: auf PC und Tablet hat Schließen eine eigene Kopfzone. Status und X
   können sich damit unabhängig von Textlänge nie überlagern. */
@media (min-width:761px) {
  .vacation-detail-modal-root .modal {
    padding-top:56px !important;
  }
  .vacation-detail-modal-root .modal-close {
    top:14px !important;
    right:15px !important;
    z-index:20 !important;
    width:34px !important;
    height:34px !important;
    display:grid !important;
    place-items:center !important;
    border-radius:10px !important;
    border:1px solid var(--line) !important;
    background:#f7f8fa !important;
    color:#525760 !important;
  }
  .vacation-detail-modal-root .vacation-detail-heading {
    padding-right:0 !important;
  }
}

/* iPad/Tablet: Beim Schreiben wird die Unterhaltung in den tatsächlich
   sichtbaren Keyboard-Viewport gelegt. Das verhindert das Safari-Hochschieben
   des gesamten Portals, ohne das Textfeld neu zu rendern oder den Fokus zu verlieren. */
@media (min-width:761px) and (max-width:1180px) and (pointer:coarse) {
  body.chat-tablet-compose-focus {
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.chat-tablet-compose-focus .sidebar,
  body.chat-tablet-compose-focus .sidebar-backdrop,
  body.chat-tablet-compose-focus .topbar,
  body.chat-tablet-compose-focus .mobile-nav {
    visibility:hidden !important;
    pointer-events:none !important;
  }
  body.chat-tablet-compose-focus .chat-page.has-active {
    position:fixed !important;
    z-index:5000 !important;
    top:var(--rf-chat-tablet-top,0px) !important;
    left:0 !important;
    width:100vw !important;
    height:var(--rf-chat-tablet-height,100dvh) !important;
    min-height:0 !important;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    display:block !important;
    background:#fff !important;
  }
  body.chat-tablet-compose-focus .chat-page.has-active .chat-list-panel {
    display:none !important;
  }
  body.chat-tablet-compose-focus .chat-page.has-active .chat-conversation {
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    overflow:hidden !important;
    background:#fff !important;
  }
  body.chat-tablet-compose-focus .chat-conversation-head {
    padding:11px 16px !important;
  }
  body.chat-tablet-compose-focus .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    height:auto !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
    -webkit-overflow-scrolling:touch;
    padding:18px !important;
  }
  body.chat-tablet-compose-focus .chat-composer {
    position:relative !important;
    width:100% !important;
    margin:0 !important;
    padding:9px 12px max(9px,env(safe-area-inset-bottom)) !important;
    background:#fff !important;
    border-top:1px solid var(--line) !important;
  }
}

@media (max-width:760px) {
  .chat-thread-row { grid-template-columns:minmax(0,1fr) auto; }
  .chat-thread-delete { width:34px; height:34px; }
  .chat-hard-delete span { display:none; }
  .chat-hard-delete { min-width:38px; justify-content:center; padding:7px !important; }
}

/* =========================================================
   V23.5 – Mediapool 2.0: lesbar, touchfreundlich, Social-Feed-UX
   ========================================================= */
.media-hero,
.media-storage,
.media-toolbar,
.media-grid { width:100%; }

.media-hero {
  padding:22px !important;
  border-radius:22px !important;
  gap:22px !important;
}
.media-hero-copy h2 {
  margin:6px 0 6px !important;
  font-size:30px !important;
  line-height:1.08 !important;
  letter-spacing:-.04em !important;
}
.media-hero-copy p {
  max-width:720px;
  font-size:14px !important;
  line-height:1.5 !important;
}
.media-section-switch {
  min-width:270px;
  padding:5px !important;
  border-radius:15px !important;
}
.media-section-tab {
  min-height:48px !important;
  padding:10px 15px !important;
  border-radius:11px !important;
  font-size:13.5px !important;
  font-weight:750 !important;
}
.media-section-icon { width:19px !important; height:19px !important; }

.media-storage {
  padding:17px 19px !important;
  gap:11px !important;
  border-radius:18px !important;
}
.media-storage-copy strong { font-size:16px !important; }
.media-storage-copy span { font-size:12.5px !important; }
.media-storage-track { height:9px !important; }
.media-storage-meta { font-size:12px !important; font-weight:560; }

.media-toolbar {
  display:grid !important;
  grid-template-columns:minmax(260px,.9fr) minmax(420px,1.55fr) auto !important;
  align-items:center !important;
  gap:16px !important;
  padding:16px !important;
  border-radius:18px !important;
}
.media-search {
  min-width:0 !important;
  min-height:50px;
  padding:0 14px !important;
  gap:10px !important;
  border-radius:14px !important;
  background:#f7f8fa !important;
}
.media-search .mini-icon { width:20px; height:20px; flex:0 0 20px; color:#4f5660; }
.media-search input {
  min-height:48px !important;
  font-size:15px !important;
  font-weight:520;
}
.media-search input::placeholder { color:#979da6; }

.media-filter-stack { display:grid; gap:9px; min-width:0; }
.media-filter-group {
  display:grid;
  grid-template-columns:54px minmax(0,1fr);
  align-items:center;
  gap:8px;
  min-width:0;
}
.media-filter-label {
  color:#7c838d;
  font-size:11px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.media-filter-row {
  min-width:0;
  display:flex !important;
  flex-wrap:nowrap !important;
  justify-content:flex-start !important;
  gap:7px !important;
  overflow-x:auto;
  padding:1px 1px 3px;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.media-filter-row::-webkit-scrollbar { display:none; }
.media-filter {
  flex:0 0 auto;
  min-height:38px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:8px 11px !important;
  border-radius:999px !important;
  font-size:12px !important;
  font-weight:730 !important;
  white-space:nowrap;
}
.media-filter-count {
  min-width:22px;
  height:22px;
  display:inline-grid;
  place-items:center;
  padding:0 6px;
  border-radius:999px;
  background:#f0f1f3;
  color:#626975;
  font-size:10.5px;
  font-weight:800;
}
.media-filter.active .media-filter-count { background:rgba(204,32,56,.1); color:var(--brand); }
.media-toolbar-result {
  min-width:112px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  text-align:right;
}
.media-toolbar-result > div { min-width:0; }
.media-toolbar-result strong,
.media-toolbar-result span { display:block; }
.media-toolbar-result strong { font-size:13px; font-weight:800; }
.media-toolbar-result span { margin-top:2px; color:var(--muted); font-size:10.5px; }
.media-clear-filter {
  flex:0 0 auto;
  min-height:38px;
  padding:8px 11px;
  border:0;
  border-radius:10px;
  background:var(--brand-soft);
  color:var(--brand-dark);
  font-size:11.5px;
  font-weight:800;
}

.media-grid {
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:18px !important;
  align-items:start !important;
}
.media-polaroid {
  border-radius:20px !important;
  border-color:#e3e5e9 !important;
  box-shadow:0 8px 26px rgba(22,24,29,.07) !important;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
@media (hover:hover) {
  .media-polaroid:hover {
    transform:translateY(-2px);
    border-color:#d9dce2 !important;
    box-shadow:0 13px 34px rgba(22,24,29,.1) !important;
  }
}
.media-card-summary { outline:none; }
.media-card-summary:focus-visible { box-shadow:inset 0 0 0 3px rgba(204,32,56,.18); }
.media-polaroid .media-preview {
  position:relative;
  aspect-ratio:4 / 5 !important;
  background:#eceef1 !important;
}
.media-card-video .media-preview { aspect-ratio:16 / 10 !important; }
.media-polaroid .media-preview img { background:#eceef1 !important; }
.media-kind-badge {
  top:12px !important;
  left:12px !important;
  padding:6px 9px !important;
  font-size:10px !important;
  font-weight:800 !important;
  letter-spacing:.09em !important;
}
.media-play-overlay {
  position:absolute;
  left:50%;
  top:50%;
  width:50px;
  height:50px;
  display:grid;
  place-items:center;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:rgba(255,255,255,.92);
  color:#20242a;
  box-shadow:0 8px 24px rgba(0,0,0,.18);
  backdrop-filter:blur(8px);
  pointer-events:none;
}
.media-play-icon { width:23px; height:23px; }
.media-file-placeholder { gap:9px !important; }
.media-placeholder-icon { width:46px !important; height:46px !important; }
.media-file-placeholder strong { font-size:16px !important; }
.media-file-placeholder span { font-size:11px !important; }

.media-polaroid-caption {
  min-height:0 !important;
  padding:14px 15px 15px !important;
}
.media-card-kicker {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  margin-bottom:9px;
}
.media-status {
  flex:0 0 auto;
  justify-self:auto !important;
  max-width:none !important;
  padding:6px 9px !important;
  font-size:11.5px !important;
  line-height:1.15 !important;
  font-weight:800 !important;
  white-space:nowrap !important;
  text-align:left !important;
}
.media-category-label {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#717883;
  font-size:11.5px;
  font-weight:650;
}
.media-card-title {
  min-width:0;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  color:var(--ink);
  font-size:16px;
  line-height:1.3;
  font-weight:800;
  letter-spacing:-.015em;
  overflow-wrap:anywhere;
}
.media-polaroid-meta {
  margin-top:12px !important;
  min-height:30px;
  font-size:11.5px !important;
}
.media-polaroid-meta > span {
  min-width:0;
  display:flex;
  align-items:center;
  gap:7px;
  overflow:hidden;
}
.media-polaroid-meta > span > span {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.media-polaroid-meta b { font-size:20px !important; color:#858c96; }
.media-uploader-avatar {
  width:28px !important;
  height:28px !important;
  flex-basis:28px !important;
  margin-right:0 !important;
  font-size:9px !important;
}

.media-card-expanded {
  gap:11px !important;
  padding:0 15px 15px !important;
}
.media-card-expanded .media-note {
  margin:13px 0 0 !important;
  font-size:13px !important;
  line-height:1.5 !important;
}
.media-card-expanded .media-badges {
  gap:6px !important;
  margin-top:12px;
}
.media-card-expanded .media-badges span {
  padding:6px 9px !important;
  font-size:11px !important;
  font-weight:700 !important;
}
.media-card-expanded .media-meta {
  gap:7px !important;
  padding-top:11px !important;
  font-size:11.5px !important;
  line-height:1.4;
}
.media-card-expanded .media-actions { gap:8px !important; }
.media-card-expanded .media-actions .secondary,
.media-card-expanded .media-actions .ghost,
.media-card-expanded .media-actions .media-status-select {
  min-height:44px !important;
  padding:9px 12px !important;
  border-radius:11px !important;
  font-size:12.5px !important;
  font-weight:780 !important;
}
.media-action-icon { width:17px; height:17px; margin-right:6px; vertical-align:-3px; }

.media-empty {
  min-height:330px !important;
  padding:28px !important;
  border-radius:20px !important;
}
.media-empty h3 { font-size:21px !important; }
.media-empty p { max-width:420px; font-size:13px !important; line-height:1.5; }
.media-empty .primary,.media-empty .secondary { min-height:44px; padding:10px 14px; font-size:12.5px; }

/* Upload und Videoansicht ebenfalls aus der Mini-Schrift holen. */
.media-upload-modal { gap:17px !important; }
.media-upload-modal .modal-title-block h3 { font-size:22px !important; }
.media-upload-modal .modal-title-block p { font-size:13px !important; }
.media-picker-block { padding:18px !important; border-radius:17px !important; }
.media-picker-copy { grid-template-columns:48px minmax(0,1fr) !important; gap:13px !important; }
.media-picker-copy .media-drop-icon { width:38px !important; height:38px !important; }
.media-picker-copy strong { font-size:14px !important; }
.media-picker-copy span { font-size:12px !important; line-height:1.4; }
.media-picker-copy small { font-size:11px !important; }
.media-picker-actions button { min-height:46px !important; font-size:12.5px !important; }
.media-ios-note { font-size:11px !important; }
.media-selected-main strong { font-size:12.5px !important; }
.media-selected-main small { font-size:11px !important; }
.media-selected-main input { min-height:42px !important; font-size:13px !important; }
.media-video-footer strong { font-size:13px; }
.media-video-footer span,.media-video-hint { font-size:11.5px !important; line-height:1.45; }

@media (min-width:761px) and (max-width:1199px) {
  .media-hero { padding:20px !important; }
  .media-hero-copy h2 { font-size:28px !important; }
  .media-toolbar {
    grid-template-columns:1fr !important;
    gap:13px !important;
  }
  .media-filter-stack {
    grid-template-columns:1fr !important;
    gap:8px !important;
  }
  .media-filter-group { grid-template-columns:58px minmax(0,1fr); }
  .media-toolbar-result { justify-content:space-between; text-align:left; min-width:0; }
  .media-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:16px !important; }
  .media-card-title { font-size:15.5px; }
}

@media (max-width:760px) {
  .media-hero,
  .media-storage,
  .media-toolbar,
  .media-grid { margin-left:0 !important; margin-right:0 !important; }

  .media-hero {
    padding:17px !important;
    gap:16px !important;
    border-radius:19px !important;
  }
  .media-hero-copy h2 { font-size:27px !important; }
  .media-hero-copy p { font-size:13.5px !important; }
  .media-section-switch { width:100% !important; min-width:0; }
  .media-section-tab { min-height:50px !important; font-size:13.5px !important; }

  .media-storage { padding:15px !important; border-radius:16px !important; }
  .media-storage-copy { display:flex !important; flex-direction:row !important; align-items:flex-start !important; justify-content:space-between !important; gap:10px !important; }
  .media-storage-copy strong { font-size:14px !important; }
  .media-storage-copy span { max-width:44%; text-align:right !important; font-size:11px !important; }
  .media-storage-meta { font-size:11.5px !important; }

  .media-toolbar {
    display:grid !important;
    grid-template-columns:1fr !important;
    align-items:stretch !important;
    gap:14px !important;
    padding:14px !important;
    border-radius:18px !important;
  }
  .media-search { min-height:54px; border-radius:15px !important; }
  .media-search input { min-height:52px !important; font-size:16px !important; }
  .media-filter-stack { gap:12px !important; }
  .media-filter-group {
    display:grid;
    grid-template-columns:1fr !important;
    gap:7px !important;
  }
  .media-filter-label { font-size:11px; }
  .media-filter-row { gap:8px !important; margin-right:-14px; padding-right:14px; }
  .media-filter { min-height:44px; padding:9px 13px !important; font-size:13px !important; }
  .media-filter-count { min-width:24px; height:24px; font-size:11px; }
  .media-toolbar-result { justify-content:space-between; text-align:left; min-width:0; }
  .media-toolbar-result strong { font-size:13.5px; }
  .media-toolbar-result span { font-size:11px; }
  .media-clear-filter { min-height:42px; font-size:12px; }

  .media-grid {
    grid-template-columns:1fr !important;
    gap:16px !important;
  }
  .media-polaroid { border-radius:20px !important; }
  .media-card-video .media-preview { aspect-ratio:16 / 10 !important; }
  .media-card-image .media-preview { aspect-ratio:4 / 5 !important; }
  .media-kind-badge { top:13px !important; left:13px !important; font-size:10.5px !important; }
  .media-play-overlay { width:56px; height:56px; }
  .media-play-icon { width:25px; height:25px; }
  .media-polaroid-caption { padding:14px 15px 15px !important; }
  .media-card-kicker { margin-bottom:9px; }
  .media-status { padding:7px 10px !important; font-size:12.5px !important; }
  .media-category-label { font-size:12.5px; }
  .media-card-title { font-size:18px !important; line-height:1.28; }
  .media-polaroid-meta { margin-top:13px !important; font-size:12.5px !important; }
  .media-uploader-avatar { width:30px !important; height:30px !important; flex-basis:30px !important; }
  .media-card-expanded { padding:0 15px 15px !important; }
  .media-card-expanded .media-note { font-size:13.5px !important; }
  .media-card-expanded .media-badges span { font-size:11.5px !important; }
  .media-card-expanded .media-meta { font-size:12px !important; }
  .media-card-expanded .media-actions .secondary,
  .media-card-expanded .media-actions .ghost,
  .media-card-expanded .media-actions .media-status-select {
    min-height:48px !important;
    font-size:13.5px !important;
  }

  .media-upload-modal .modal-title-block h3 { font-size:21px !important; }
  .media-upload-modal .modal-title-block p { font-size:13px !important; }
  .media-picker-copy strong { font-size:14px !important; }
  .media-picker-copy span { font-size:12px !important; }
  .media-picker-copy small { font-size:11px !important; }
}

/* =========================================================
   V23.6 – Workflow, Teamurlaub, Tablet-Chat & Dashboard-Politur
   ========================================================= */

/* Glocke: Kopf und Fuß bleiben immer sichtbar; nur die Meldungsliste scrollt. */
.notification-panel {
  display:grid !important;
  grid-template-rows:auto minmax(0,1fr) auto !important;
  height:min(720px,calc(100dvh - 94px)) !important;
  max-height:calc(100dvh - 94px) !important;
  overflow:hidden !important;
}
/* Wichtig: V23.6 setzt das Panel auf display:grid !important.
   Dadurch wurde das native [hidden] überstimmt und die Glocke ließ sich nicht mehr schließen. */
.notification-panel[hidden] {
  display:none !important;
}
.notification-list {
  min-height:0 !important;
  max-height:none !important;
  overflow-y:auto !important;
  overscroll-behavior:contain;
}
.notification-read-all {
  position:relative;
  z-index:2;
  min-height:44px;
  flex:0 0 auto;
  background:#fff !important;
  box-shadow:0 -8px 20px rgba(28,31,36,.035);
}

/* Aufgaben mit 0 sind neutral. Erst echte Arbeit bekommt die rote Betonung. */
.dash-task-item.is-zero {
  background:#fafbfc !important;
  border-color:#e7e9ed !important;
  color:#737a84;
}
.dash-task-item.is-zero > span {
  background:#f0f2f4 !important;
  color:#8a919a !important;
}
.dash-task-item.is-zero strong { color:#6f7680 !important; }
.dash-task-item.has-items {
  border-color:#f0c8cf !important;
  background:#fffafb !important;
}

/* Dashboard-Mediapool auf PC: volle Breite, ruhige moderne Karten statt Mini-Polaroids. */
.dash-grid-main > .dash-media-card-wrap { grid-column:1 / -1 !important; }
.dash-media-card-wrap .dash-media-grid { width:100%; }
@media (min-width:1200px) {
  .dash-media-card-wrap { padding:20px !important; }
  .dash-media-grid { grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:16px !important; }
  .dash-media-card {
    transform:none !important;
    padding:0 !important;
    overflow:hidden;
    border-radius:16px !important;
    box-shadow:0 7px 22px rgba(31,34,39,.07) !important;
  }
  .dash-media-card:hover { transform:translateY(-2px) !important; }
  .dash-media-thumb { aspect-ratio:16 / 10 !important; border-radius:0 !important; }
  .dash-media-copy { padding:12px 13px 13px !important; }
  .dash-media-card strong { font-size:13.5px !important; line-height:1.3 !important; }
  .dash-media-card small { margin-top:5px !important; font-size:11px !important; }
}

/* Mediapool mobil: Status bewusst als 2x2-Raster – kein seitliches Scrollen. */
@media (max-width:760px) {
  .media-filter-row-status {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px !important;
    width:100% !important;
    margin-right:0 !important;
    padding:0 !important;
    overflow:visible !important;
  }
  .media-filter-row-status .media-filter {
    width:100% !important;
    min-width:0 !important;
    justify-content:space-between !important;
    padding-inline:13px !important;
  }
}

/* Chat-Avatare: echte Kreisfläche; Bild und Initialen sitzen geometrisch mittig. */
.chat-thread-avatar {
  position:relative !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:0 !important;
  border-radius:50% !important;
  line-height:1 !important;
  vertical-align:middle;
}
.chat-thread-avatar.avatar-photo { display:block !important; }
.chat-thread-avatar.avatar-photo img {
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  margin:0 !important;
  padding:0 !important;
  border-radius:50% !important;
  object-fit:cover !important;
  object-position:center center !important;
}

/* Teamurlaub: Management sieht schon in der geschlossenen Zeile die wichtigen Werte. */
.vacation-team-overview { gap:16px !important; }
.vacation-team-heading {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  align-items:end;
}
.vacation-team-kpis {
  display:grid;
  grid-template-columns:repeat(3,minmax(105px,1fr));
  gap:8px;
}
.vacation-team-kpis > div {
  min-width:0;
  padding:11px 13px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#fafbfc;
}
.vacation-team-kpis span,.vacation-team-kpis strong { display:block; }
.vacation-team-kpis span { color:var(--muted); font-size:9.5px; font-weight:700; }
.vacation-team-kpis strong { margin-top:4px; font-size:21px; line-height:1; }
.vacation-team-kpis .attention { background:#fff7f8; border-color:#f1c9cf; }
.vacation-team-kpis .attention strong { color:var(--brand); }
.vacation-team-toolbar {
  display:grid;
  grid-template-columns:220px minmax(240px,1fr) 210px;
  gap:10px;
  align-items:end;
  padding:13px;
  border:1px solid var(--line);
  border-radius:15px;
  background:#fafbfc;
}
.vacation-team-toolbar .vacation-list-toolbar { width:auto !important; }
.vacation-team-search,.vacation-team-filter { display:grid; gap:5px; min-width:0; }
.vacation-team-search > span,.vacation-team-filter > span { color:var(--muted); font-size:9.5px; font-weight:750; }
.vacation-team-search input,.vacation-team-filter select {
  width:100%;
  min-height:42px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  padding:9px 11px;
  color:var(--ink);
  font:inherit;
  font-size:12px;
}
.vacation-team-columns {
  display:grid;
  grid-template-columns:minmax(260px,1.4fr) 110px 110px minmax(190px,1fr) 22px;
  gap:12px;
  padding:0 14px;
  color:#9197a0;
  font-size:9px;
  font-weight:800;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.vacation-team-row > summary.vacation-team-summary {
  display:grid !important;
  grid-template-columns:minmax(260px,1.4fr) 110px 110px minmax(190px,1fr) 22px !important;
  gap:12px !important;
  align-items:center !important;
  padding:13px 14px !important;
}
.vacation-team-person { display:grid; grid-template-columns:44px minmax(0,1fr); gap:11px; align-items:center; min-width:0; }
.vacation-team-stat span,.vacation-team-stat strong,.vacation-team-next span,.vacation-team-next strong,.vacation-team-next small { display:block; }
.vacation-team-stat span,.vacation-team-next > span { color:var(--muted); font-size:9px; font-weight:700; }
.vacation-team-stat strong { margin-top:3px; font-size:12.5px; white-space:nowrap; }
.vacation-team-stat.pending strong { color:#956900; }
.vacation-team-stat.zero strong { color:#878e97; }
.vacation-team-next { min-width:0; }
.vacation-team-next strong { margin-top:3px; font-size:11.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.vacation-team-next small { width:max-content; max-width:100%; margin-top:4px; padding:3px 7px; border-radius:999px; background:#f1f2f4; color:#6f7680; font-size:8.5px; font-weight:800; }
.vacation-team-next small.status-approved { background:#e9f7ef; color:#23704b; }
.vacation-team-next small.status-submitted,.vacation-team-next small.status-reviewer_approved { background:#fff5d8; color:#956900; }
.vacation-team-chevron { color:#9aa0a8; font-style:normal; font-size:17px; transition:transform .16s ease; }
.vacation-team-row[open] .vacation-team-chevron { transform:rotate(180deg); }
.vacation-team-row[hidden] { display:none !important; }
.vacation-team-no-results { margin-top:2px; }

@media (max-width:900px) {
  .vacation-team-heading { grid-template-columns:1fr; align-items:stretch; }
  .vacation-team-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .vacation-team-toolbar { grid-template-columns:1fr 1fr; }
  .vacation-team-toolbar .vacation-list-toolbar { grid-column:1 / -1; }
  .vacation-team-columns { display:none; }
  .vacation-team-row > summary.vacation-team-summary {
    grid-template-columns:44px minmax(0,1fr) auto !important;
    gap:10px !important;
  }
  .vacation-team-person { grid-column:1 / 3; grid-template-columns:44px minmax(0,1fr); }
  .vacation-team-stat { padding:8px 10px; border-radius:10px; background:#f7f8fa; }
  .vacation-team-stat:nth-of-type(2) { grid-column:1; }
  .vacation-team-stat:nth-of-type(3) { grid-column:2; }
  .vacation-team-next { grid-column:1 / 3; padding-top:2px; }
  .vacation-team-chevron { grid-column:3; grid-row:1 / 4; align-self:center; }
}
@media (max-width:560px) {
  .vacation-team-kpis { grid-template-columns:1fr 1fr; }
  .vacation-team-kpis > div:first-child { grid-column:1 / -1; }
  .vacation-team-toolbar { grid-template-columns:1fr; }
  .vacation-team-toolbar .vacation-list-toolbar { grid-column:auto; }
  .vacation-team-row > summary.vacation-team-summary { grid-template-columns:minmax(0,1fr) 22px !important; }
  .vacation-team-person { grid-column:1; grid-template-columns:42px minmax(0,1fr); }
  .vacation-team-stat:nth-of-type(2),.vacation-team-stat:nth-of-type(3) { grid-column:auto; }
  .vacation-team-next { grid-column:1; }
  .vacation-team-chevron { grid-column:2; grid-row:1 / 4; }
}

/* Tablet verhält sich im Chat bewusst wie das Handy: Liste -> Vollbild-Thread -> Zurück. */
@media (min-width:761px) and (max-width:1180px) {
  body.chat-phone-thread-open {
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.chat-phone-thread-open .topbar,
  body.chat-phone-thread-open .mobile-nav,
  body.chat-phone-thread-open .sidebar,
  body.chat-phone-thread-open .sidebar-backdrop { display:none !important; }
  body.chat-phone-thread-open .workspace,
  body.chat-phone-thread-open .content-shell,
  body.chat-phone-thread-open #app {
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
  }
  body.chat-phone-thread-open .chat-page.has-active {
    position:fixed !important;
    inset:auto 0 0 0 !important;
    top:var(--rf-chat-phone-top,0px) !important;
    width:100vw !important;
    height:var(--rf-chat-phone-height,100dvh) !important;
    min-height:0 !important;
    max-height:none !important;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    z-index:1000 !important;
    display:block !important;
    background:#fff !important;
  }
  body.chat-phone-thread-open .chat-page.has-active .chat-list-panel { display:none !important; }
  body.chat-phone-thread-open .chat-page.has-active .chat-conversation {
    display:grid !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    overflow:hidden !important;
    background:#fff !important;
  }
  body.chat-phone-thread-open .chat-conversation-head {
    min-height:68px !important;
    padding:12px 18px !important;
    background:#fff !important;
    border-bottom:1px solid var(--line) !important;
    z-index:4;
  }
  body.chat-phone-thread-open .chat-conversation-head strong { font-size:16px !important; }
  body.chat-phone-thread-open .chat-conversation-head span { font-size:12px !important; }
  body.chat-phone-thread-open .chat-back {
    width:44px !important;
    height:44px !important;
    border-radius:13px !important;
    flex:0 0 44px;
  }
  body.chat-phone-thread-open .chat-messages {
    min-height:0 !important;
    height:auto !important;
    max-height:none !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    padding:18px !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
  }
  body.chat-phone-thread-open .chat-composer {
    position:relative !important;
    inset:auto !important;
    z-index:5 !important;
    display:grid !important;
    grid-template-columns:46px minmax(0,1fr) 50px !important;
    gap:9px !important;
    align-items:end !important;
    width:100% !important;
    margin:0 !important;
    padding:10px 14px calc(10px + env(safe-area-inset-bottom)) !important;
    background:#fff !important;
    border-top:1px solid var(--line) !important;
  }
  body.chat-phone-thread-open .chat-composer textarea {
    width:100% !important;
    min-height:46px !important;
    max-height:116px !important;
    padding:11px 14px !important;
    border-radius:16px !important;
    font-size:16px !important;
    line-height:1.35 !important;
  }
  body.chat-phone-thread-open .chat-attach,
  body.chat-phone-thread-open .chat-send {
    width:46px !important;
    height:46px !important;
    min-width:46px !important;
    border-radius:14px !important;
  }
  body.chat-phone-thread-open .chat-send { width:50px !important; min-width:50px !important; }
}


/* =========================================================
   V23.7 – Teamurlaub-Akkordeon, Planungskarten & Chat-Abstand
   ========================================================= */

/* Teamurlaub: in der Grundansicht steht wirklich der Mitarbeiter im Fokus.
   Kennzahlen und Anträge erscheinen erst nach dem Aufklappen. */
.vacation-team-accordion-view .vacation-team-columns { display:none !important; }
.vacation-employee-accordion { display:grid; gap:12px; }
.vacation-employee-accordion-card {
  border:1px solid var(--line) !important;
  border-radius:18px !important;
  overflow:hidden;
  background:#fff;
  box-shadow:0 8px 24px rgba(35,39,47,.04);
}
.vacation-employee-accordion-card > summary.vacation-employee-accordion-summary {
  display:grid !important;
  grid-template-columns:minmax(0,1fr) 24px !important;
  align-items:center !important;
  gap:14px !important;
  min-height:76px;
  padding:14px 16px !important;
  cursor:pointer;
  list-style:none;
  background:#fff;
}
.vacation-employee-accordion-card > summary::-webkit-details-marker { display:none; }
.vacation-employee-accordion-card[open] > summary { background:#fafbfc; border-bottom:1px solid var(--line); }
.vacation-employee-accordion-card .vacation-team-person { grid-column:auto !important; grid-template-columns:48px minmax(0,1fr) !important; gap:12px !important; }
.vacation-employee-accordion-card .vacation-list-person strong { font-size:15px; line-height:1.2; }
.vacation-employee-accordion-card .vacation-list-person span { margin-top:4px; font-size:11px; }
.vacation-employee-summary-flags { display:flex; gap:7px; align-items:center; justify-content:flex-end; flex-wrap:wrap; }
.vacation-summary-flag { display:inline-flex; align-items:center; min-height:28px; padding:5px 9px; border-radius:999px; background:#f1f3f5; color:#656d78; font-size:9.5px; font-weight:800; white-space:nowrap; }
.vacation-summary-flag.attention { background:#fff4d7; color:#946900; }
.vacation-summary-flag.planned { background:#edf6ff; color:#2c6696; }
.vacation-employee-accordion-card .vacation-team-chevron { grid-column:auto !important; grid-row:auto !important; justify-self:end; }
.vacation-accordion-body { padding:16px !important; }
.vacation-accordion-highlight { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:14px; }
.vacation-accordion-highlight > div { min-width:0; padding:12px 13px; border:1px solid #eceef1; border-radius:14px; background:#f8f9fb; }
.vacation-accordion-highlight span,.vacation-accordion-highlight strong,.vacation-accordion-highlight small { display:block; }
.vacation-accordion-highlight span { color:var(--muted); font-size:9.5px; font-weight:800; text-transform:uppercase; letter-spacing:.035em; }
.vacation-accordion-highlight strong { margin-top:5px; font-size:14px; line-height:1.25; }
.vacation-accordion-highlight small { margin-top:5px; color:var(--muted); font-size:9px; }
.vacation-accordion-highlight .pending strong { color:#946900; }
.vacation-accordion-highlight .zero strong { color:#848b95; }
.vacation-accordion-request-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:16px 0 8px; }
.vacation-accordion-request-head strong { font-size:12px; }
.vacation-accordion-request-head span { display:grid; place-items:center; min-width:28px; height:28px; padding:0 7px; border-radius:999px; background:#f1f2f4; color:#686f78; font-size:10px; font-weight:800; }

/* Planung: statt einfacher Textzeilen klar lesbare Karten mit Zeitraum,
   Typ, Sperrstatus und direkten Aktionen. */
.planning-list-modern { padding:18px !important; }
.planning-entry-card-list { display:grid; gap:11px; }
.planning-entry-card {
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  gap:12px;
  align-items:start;
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  box-shadow:0 5px 18px rgba(31,35,41,.035);
}
.planning-entry-accent { display:grid; place-items:center; width:42px; height:42px; border-radius:13px; background:#f3f4f6; color:#68707b; }
.planning-entry-card.type-block .planning-entry-accent { background:#fff0f1; color:var(--brand); }
.planning-entry-card.type-intensive .planning-entry-accent { background:#edf6ff; color:#2e6f9e; }
.planning-entry-content { min-width:0; }
.planning-entry-top { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.planning-entry-kind { display:block; margin-bottom:3px; color:var(--muted); font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.planning-entry-top h4 { margin:0; font-size:14px; line-height:1.3; }
.planning-entry-date { flex:0 0 auto; padding:6px 9px; border-radius:10px; background:#f6f7f9; color:#5f6670; font-size:10px; font-weight:750; white-space:nowrap; }
.planning-entry-tags { display:flex; gap:7px; flex-wrap:wrap; margin-top:9px; }
.planning-lock-badge,.planning-info-badge { display:inline-flex; align-items:center; padding:5px 8px; border-radius:999px; font-size:9px; font-weight:800; }
.planning-lock-badge { background:#fff0f1; color:#c73545; }
.planning-info-badge { background:#eef4f8; color:#577080; }
.planning-entry-note { margin:9px 0 0; color:#6e7580; font-size:10.5px; line-height:1.45; }
.planning-entry-actions { display:flex; flex-direction:column; gap:7px; min-width:104px; }
.planning-entry-actions button { width:100%; min-height:36px; padding:7px 10px !important; font-size:10px; }
.planning-form-grid-modern { align-items:start; }
.planning-form-grid-modern > [hidden] { display:none !important; }
.planning-edit-modal-root .modal-card { max-width:720px; }

/* Mobile Chat: etwas mehr Luft zu Displaykante und Home-Indikator. */
@media (max-width:760px) {
  body.chat-phone-thread-open .chat-conversation-head { padding-left:18px !important; padding-right:18px !important; }
  body.chat-phone-thread-open .chat-messages { padding-left:18px !important; padding-right:18px !important; }
  body.chat-phone-thread-open .chat-composer { padding-left:14px !important; padding-right:14px !important; }
  body.chat-phone-thread-open .chat-bubble { max-width:86% !important; }

  .vacation-employee-accordion-card > summary.vacation-employee-accordion-summary {
    grid-template-columns:minmax(0,1fr) 22px !important;
    gap:10px !important;
    padding:13px 14px !important;
  }
  .vacation-employee-summary-flags { grid-column:1; justify-content:flex-start; padding-left:60px; }
  .vacation-employee-accordion-card .vacation-team-chevron { grid-column:2 !important; grid-row:1 / 3 !important; }
  .vacation-accordion-body { padding:13px !important; }
  .vacation-accordion-highlight { grid-template-columns:1fr 1fr; }
  .vacation-accordion-highlight > div:last-child { grid-column:1 / -1; }
  .planning-entry-card { grid-template-columns:40px minmax(0,1fr); padding:12px; }
  .planning-entry-accent { width:40px; height:40px; }
  .planning-entry-top { display:block; }
  .planning-entry-date { display:inline-block; margin-top:7px; white-space:normal; }
  .planning-entry-actions { grid-column:1 / -1; display:grid; grid-template-columns:1fr 1fr; min-width:0; }
  .planning-entry-actions > button:only-child { grid-column:1 / -1; }
}


/* =========================================================
   V23.8 – Chat-Anhang als Entwurf + iPad-Zurück-Fix
   ========================================================= */
.chat-attachment-preview[hidden] { display:none !important; }
.chat-attachment-preview {
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:68px minmax(0,1fr) 36px;
  gap:11px;
  align-items:center;
  min-width:0;
  padding:9px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-alt);
}
.chat-attachment-preview img {
  width:68px;
  height:58px;
  display:block;
  object-fit:cover;
  border-radius:10px;
  background:#e9ebee;
}
.chat-attachment-preview > div { min-width:0; display:grid; gap:2px; }
.chat-attachment-preview strong { font-size:12px; font-weight:700; }
.chat-attachment-preview span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#555d68; font-size:10.5px; }
.chat-attachment-preview small { color:var(--muted); font-size:9.5px; line-height:1.35; }
.chat-attachment-preview button {
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border:0;
  border-radius:10px;
  background:#fff;
  color:#555d68;
  font-size:22px;
  line-height:1;
  box-shadow:0 1px 3px rgba(26,30,35,.08);
}
.chat-attachment-preview button:hover { color:var(--brand); background:var(--brand-soft); }

@media (max-width:760px) {
  body.chat-phone-thread-open .chat-attachment-preview {
    grid-template-columns:60px minmax(0,1fr) 36px;
    gap:9px;
    padding:8px;
    margin:0 2px 1px;
    border-radius:13px;
  }
  body.chat-phone-thread-open .chat-attachment-preview img { width:60px; height:54px; }
  body.chat-phone-thread-open .chat-attachment-preview strong { font-size:12.5px; }
  body.chat-phone-thread-open .chat-attachment-preview span { font-size:11px; }
  body.chat-phone-thread-open .chat-attachment-preview small { font-size:10px; }
}

@media (min-width:761px) and (max-width:1180px) {
  body.chat-phone-thread-open .chat-page.has-active {
    left:0 !important;
    right:0 !important;
    bottom:auto !important;
  }
  body.chat-phone-thread-open .chat-conversation-head {
    position:relative !important;
    padding-left:78px !important;
    z-index:12 !important;
  }
  body.chat-phone-thread-open .chat-back {
    position:fixed !important;
    top:calc(12px + env(safe-area-inset-top)) !important;
    left:18px !important;
    z-index:1020 !important;
    touch-action:manipulation;
  }
  body.chat-phone-thread-open .chat-attachment-preview {
    grid-template-columns:72px minmax(0,1fr) 38px;
    margin-bottom:1px;
  }
  body.chat-phone-thread-open .chat-attachment-preview img { width:72px; height:60px; }
}

/* =========================================================
   V23.9 – Chat-UX, Unread-Badge, Feed-Edit & Mediapool-Politur
   ========================================================= */

/* Ungelesene Chatnachrichten direkt in der unteren Navigation. */
.mobile-nav-icon-wrap {
  position:relative;
  display:inline-grid;
  place-items:center;
  width:28px;
  height:24px;
}
.mobile-nav-unread {
  position:absolute;
  top:-7px;
  right:-10px;
  min-width:18px;
  height:18px;
  display:grid;
  place-items:center;
  padding:0 5px;
  border:2px solid #fff;
  border-radius:999px;
  background:var(--brand);
  color:#fff;
  font-size:8.5px;
  font-weight:900;
  line-height:1;
  box-shadow:0 2px 6px rgba(181,28,49,.22);
}

/* Öffentliche Abstimmungen: Namen bewusst lesbar statt als kleine Fußnote. */
.poll-voters {
  display:block;
  margin-top:8px;
  padding:7px 9px;
  border-radius:9px;
  background:#f7f8fa;
  color:#626a75;
  font-size:10px;
  line-height:1.4;
  text-align:left;
}
.poll-voters b { color:#3f4650; font-weight:800; }
.feed-edit-button { min-height:34px; }

/* PC-Mediapool: Statuschips dürfen umbrechen, nie seitlich abgeschnitten werden. */
@media (min-width:1200px) {
  .media-toolbar {
    grid-template-columns:minmax(245px,.8fr) minmax(500px,1.65fr) minmax(120px,auto) !important;
  }
  .media-filter-row {
    flex-wrap:wrap !important;
    overflow:visible !important;
    padding-right:0 !important;
  }
  .media-filter-row-status .media-filter { margin-bottom:1px; }
}

/* Handy-Chatliste wie Messenger: Karte bleibt im sichtbaren Bereich,
   bei vielen Chats scrollt nur die Liste innerhalb der Karte. */
@media (max-width:760px) {
  .chat-page:not(.has-active) {
    height:calc(100dvh - 174px) !important;
    min-height:420px !important;
    max-height:calc(100dvh - 174px) !important;
    overflow:hidden !important;
  }
  .chat-page:not(.has-active) .chat-list-panel {
    height:100% !important;
    min-height:0 !important;
    display:flex !important;
    flex-direction:column !important;
    overflow:hidden !important;
  }
  .chat-page:not(.has-active) .chat-list-head,
  .chat-page:not(.has-active) .chat-search { flex:0 0 auto; }
  .chat-page:not(.has-active) .chat-thread-list {
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding-bottom:18px;
  }

  /* Mehr Luft an Displaykante und Home-Indikator. */
  body.chat-phone-thread-open .chat-conversation-head {
    padding-left:20px !important;
    padding-right:20px !important;
  }
  body.chat-phone-thread-open .chat-messages {
    padding-left:20px !important;
    padding-right:20px !important;
  }
  body.chat-phone-thread-open .chat-composer {
    padding-left:18px !important;
    padding-right:18px !important;
    padding-bottom:calc(14px + env(safe-area-inset-bottom)) !important;
    gap:10px !important;
  }
  .mobile-nav {
    padding-left:max(10px,env(safe-area-inset-left)) !important;
    padding-right:max(10px,env(safe-area-inset-right)) !important;
    padding-bottom:calc(8px + env(safe-area-inset-bottom)) !important;
  }
}

/* Tablet bleibt bewusst in der PC-artigen Zweispaltenansicht. Dadurch verschiebt
   die Bildschirmtastatur nicht mehr den gesamten Messenger und die Chatliste
   bleibt jederzeit als Navigation sichtbar. */
@media (min-width:761px) and (max-width:1180px) {
  .chat-page,
  .chat-page.has-active {
    display:grid !important;
    grid-template-columns:minmax(230px,30%) minmax(0,1fr) !important;
    width:100% !important;
    height:calc(100dvh - 126px) !important;
    min-height:430px !important;
    max-height:calc(100dvh - 126px) !important;
    position:static !important;
    inset:auto !important;
    border:1px solid var(--line) !important;
    border-radius:18px !important;
    box-shadow:var(--shadow-card) !important;
    overflow:hidden !important;
  }
  .chat-page.has-active .chat-list-panel,
  .chat-list-panel {
    display:flex !important;
    flex-direction:column !important;
    height:100% !important;
    min-height:0 !important;
    overflow:hidden !important;
  }
  .chat-thread-list {
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .chat-page.has-active .chat-conversation,
  .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    height:100% !important;
    min-height:0 !important;
    overflow:hidden !important;
  }
  .chat-page .chat-back { display:none !important; }
  .chat-page .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    overflow-y:auto !important;
  }
  .chat-page .chat-composer {
    position:relative !important;
    bottom:auto !important;
    padding:12px 14px !important;
  }
}

/* =========================================================
   V23.10 – Chat-Stabilität, globale Unread-Badges, Feed-Leser,
   Urlaubsanträge & PWA-Viewport
   ========================================================= */

/* Ungelesene Chats sind auf PC/Tablet direkt in der Seitenleiste sichtbar. */
.nav-item { position:relative; }
.nav-item-unread {
  margin-left:auto;
  min-width:22px;
  height:22px;
  padding:0 6px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:var(--brand);
  color:#fff;
  font-size:9px;
  font-weight:800;
  line-height:1;
  box-shadow:0 2px 6px rgba(181,28,49,.18);
}
.nav-item.active .nav-item-unread { background:#fff; color:var(--brand); }

/* Der Badge an der mobilen Chat-Navigation darf nie vom Icon-Wrapper abgeschnitten werden. */
.mobile-nav-item { overflow:visible !important; }
.mobile-nav-item .mobile-nav-icon-wrap {
  overflow:visible !important;
  max-width:none !important;
  text-overflow:clip !important;
}
.mobile-nav-item .mobile-nav-unread {
  overflow:visible !important;
  max-width:none !important;
  white-space:nowrap !important;
  right:-13px !important;
  top:-8px !important;
  min-width:20px !important;
  height:20px !important;
  padding:0 5px !important;
  font-size:9px !important;
  z-index:4;
}

/* Team-Feed: Lesebestätigungen für Chefin und explizit berechtigte Verwaltung. */
.feed-read-receipts {
  margin-top:14px;
  border:1px solid #e7e9ed;
  border-radius:13px;
  background:#fafbfc;
  overflow:hidden;
}
.feed-read-receipts > summary {
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:44px;
  padding:10px 12px;
  cursor:pointer;
  color:#555d68;
  font-size:11px;
  font-weight:700;
}
.feed-read-receipts > summary::-webkit-details-marker { display:none; }
.feed-read-receipts > summary::after {
  content:'⌄';
  color:#9298a1;
  font-size:16px;
  transform-origin:center;
  transition:transform .15s ease;
}
.feed-read-receipts[open] > summary::after { transform:rotate(180deg); }
.feed-read-receipts > summary strong {
  margin-left:auto;
  min-width:58px;
  text-align:right;
  color:var(--ink);
  font-size:11px;
}
.feed-read-receipt-list {
  display:grid;
  gap:0;
  padding:0 12px 8px;
  border-top:1px solid #eceef1;
}
.feed-read-receipt-person {
  display:grid;
  grid-template-columns:32px minmax(0,1fr) 20px;
  gap:9px;
  align-items:center;
  padding:9px 0;
  border-top:1px solid #eef0f2;
}
.feed-read-receipt-person:first-child { border-top:0; }
.feed-reader-avatar {
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#eef0f3;
  color:#59616b;
  font-size:9.5px;
  font-weight:750;
}
.feed-read-receipt-person div { min-width:0; }
.feed-read-receipt-person strong,
.feed-read-receipt-person small { display:block; }
.feed-read-receipt-person strong {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:11.5px;
}
.feed-read-receipt-person small { margin-top:2px; color:var(--muted); font-size:9.5px; }
.feed-read-receipt-person i { color:var(--success); font-style:normal; font-weight:900; text-align:right; }
.feed-read-empty { padding:12px 0 6px; color:var(--muted); font-size:10.5px; }

/* Eigene Urlaubsanträge: klare Hierarchie statt einer langen, umbrechenden Textzeile. */
.request-main-copy { min-width:0; }
.request-person {
  margin-bottom:3px;
  color:var(--muted);
  font-size:10.5px;
  font-weight:650;
}
.request-facts {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.request-facts > span {
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:4px 8px;
  border-radius:999px;
  background:#f3f4f6;
  color:#5e6570;
  font-size:10.5px;
  font-weight:650;
  line-height:1.2;
}
.request-submitted {
  margin-top:8px;
  color:#9298a1;
  font-size:10.5px;
  line-height:1.35;
}
.vacation-requests-panel .request-note {
  display:grid !important;
  gap:3px !important;
}
.vacation-requests-panel .request-note > span {
  color:#8a9099;
  font-size:9.5px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.vacation-requests-panel .request-note > p {
  margin:0;
  color:#454b54;
  font-size:12px;
  line-height:1.4;
}

/* Alle Avatar-Flächen verwenden dieselbe Geometrie. Das behebt auch iPad-Fälle,
   in denen Initialen oder echte Profilfotos optisch nach links rutschen. */
.user-avatar,
.chat-thread-avatar,
.profile-avatar,
.employee-directory-avatar,
.vacation-list-avatar,
.milestone-avatar,
.media-uploader-avatar,
.person-avatar {
  box-sizing:border-box !important;
  display:grid !important;
  place-items:center !important;
  align-items:center !important;
  justify-items:center !important;
  padding:0 !important;
  margin-left:0 !important;
  text-align:center !important;
  text-indent:0 !important;
  line-height:1 !important;
  overflow:hidden !important;
}
.avatar-photo { position:relative !important; overflow:hidden !important; }
.avatar-photo > img,
.user-avatar.avatar-photo > img,
.chat-thread-avatar.avatar-photo > img,
.profile-avatar.avatar-photo > img,
.employee-directory-avatar.avatar-photo > img,
.vacation-list-avatar.avatar-photo > img,
.milestone-avatar.avatar-photo > img,
.media-uploader-avatar.avatar-photo > img,
.person-avatar.avatar-photo > img {
  position:static !important;
  inset:auto !important;
  width:100% !important;
  height:100% !important;
  min-width:100% !important;
  min-height:100% !important;
  display:block !important;
  margin:0 !important;
  padding:0 !important;
  border-radius:inherit !important;
  object-fit:cover !important;
  object-position:50% 50% !important;
  transform:none !important;
}

/* Das Ende der Unterhaltung bleibt ein echter Scroll-Anker. */
.chat-end-anchor { width:100%; height:1px; flex:0 0 1px; }

/* Tablet bleibt wie PC zweispaltig – ohne mobile Vollbild-/Keyboard-Umbauten. */
@media (min-width:761px) and (max-width:1180px) {
  body.chat-phone-thread-open .sidebar,
  body.chat-phone-thread-open .topbar { display:initial; }
  .chat-page,
  .chat-page.has-active {
    position:static !important;
    inset:auto !important;
    display:grid !important;
    grid-template-columns:minmax(240px,31%) minmax(0,1fr) !important;
    width:100% !important;
    height:calc(100dvh - 126px) !important;
    min-height:430px !important;
    max-height:calc(100dvh - 126px) !important;
    margin:0 !important;
    overflow:hidden !important;
    border:1px solid var(--line) !important;
    border-radius:18px !important;
    box-shadow:var(--shadow-card) !important;
    background:#fff !important;
  }
  .chat-page .chat-list-panel {
    display:flex !important;
    flex-direction:column !important;
    min-height:0 !important;
    overflow:hidden !important;
  }
  .chat-page .chat-thread-list {
    flex:1 1 auto !important;
    min-height:0 !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
  }
  .chat-page .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    min-width:0 !important;
    min-height:0 !important;
    height:100% !important;
    overflow:hidden !important;
  }
  .chat-page .chat-back { display:none !important; }
  .chat-page .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    overflow-y:auto !important;
    overscroll-behavior:contain;
  }
  .chat-page .chat-composer {
    position:relative !important;
    inset:auto !important;
    padding:12px 14px max(12px,env(safe-area-inset-bottom)) !important;
  }
  .chat-thread-avatar,
  .chat-thread-avatar.large {
    border-radius:50% !important;
  }
}

/* iPhone/PWA: die Portal-Kopfleiste bleibt ein stabiles Fenster und wird nach
   Tastatur-/App-Wechseln nicht in den Inhalt hineingeschoben. */
@media (max-width:760px) {
  html.standalone-pwa body:not(.chat-phone-thread-open):not(.auth-mode) .topbar {
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    right:0 !important;
    width:100% !important;
    z-index:80 !important;
    transform:translateZ(0);
    -webkit-transform:translateZ(0);
  }
  html.standalone-pwa body:not(.chat-phone-thread-open):not(.auth-mode) .workspace {
    padding-top:66px !important;
  }

  /* Chatliste füllt den Bereich zwischen Kopf- und Bottom-Navigation sauber aus. */
  .chat-page:not(.has-active) {
    height:calc(100dvh - 160px - env(safe-area-inset-bottom)) !important;
    max-height:calc(100dvh - 160px - env(safe-area-inset-bottom)) !important;
    min-height:390px !important;
  }
  html.standalone-pwa .chat-page:not(.has-active) {
    height:calc(100dvh - 164px - env(safe-area-inset-bottom)) !important;
    max-height:calc(100dvh - 164px - env(safe-area-inset-bottom)) !important;
  }

  /* Geöffnete Unterhaltung: exakt der sichtbare Viewport, keine seitlichen Sprünge. */
  body.chat-phone-thread-open {
    overflow:hidden !important;
    width:100% !important;
    height:100dvh !important;
    overscroll-behavior:none !important;
  }
  body.chat-phone-thread-open .chat-page.has-active {
    position:fixed !important;
    left:0 !important;
    right:0 !important;
    bottom:auto !important;
    top:var(--rf-chat-phone-top,0px) !important;
    width:100vw !important;
    max-width:100vw !important;
    height:var(--rf-chat-phone-height,100dvh) !important;
    min-height:0 !important;
    max-height:none !important;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    overflow:hidden !important;
    background:#fff !important;
  }
  body.chat-phone-thread-open .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    overflow:hidden !important;
  }
  body.chat-phone-thread-open .chat-conversation-head {
    min-height:calc(66px + env(safe-area-inset-top)) !important;
    padding:calc(10px + env(safe-area-inset-top)) 20px 10px !important;
    flex:0 0 auto !important;
  }
  body.chat-phone-thread-open .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    padding:18px 20px 16px !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
  body.chat-phone-thread-open .chat-composer {
    position:relative !important;
    inset:auto !important;
    width:100% !important;
    padding:10px 18px calc(16px + env(safe-area-inset-bottom)) !important;
    gap:10px !important;
    background:#fff !important;
  }
  body.chat-phone-thread-open.chat-keyboard-open .chat-conversation-head {
    min-height:62px !important;
    padding-top:10px !important;
  }
  body.chat-phone-thread-open.chat-keyboard-open .chat-composer {
    padding-bottom:10px !important;
  }
}

@media (max-width:520px) {
  .vacation-requests-panel .request-top {
    grid-template-columns:minmax(0,1fr) auto !important;
    gap:10px !important;
  }
  .vacation-requests-panel .request-title {
    font-size:15px !important;
    line-height:1.25 !important;
  }
  .vacation-requests-panel .request-status-stack {
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-end !important;
    gap:6px !important;
  }
  .vacation-requests-panel .request-open-chevron { display:none !important; }
  .request-facts { gap:5px; margin-top:7px; }
  .request-facts > span { font-size:10px; min-height:24px; padding:4px 7px; }
  .request-submitted { margin-top:7px; font-size:10px; }
}

/* =========================================================
   V23.10.1 – finaler Chat-Viewport-Hotfix für iPhone/iPad
   ========================================================= */

/* iPhone: Der geöffnete Thread ist ein echtes App-Fenster. Der Browser darf
   den Dokumentkörper beim Öffnen der Tastatur nicht mehr verschieben. */
@media (max-width:760px) {
  body.chat-phone-thread-open {
    position:fixed !important;
    inset:0 !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.chat-phone-thread-open .chat-page.has-active {
    position:fixed !important;
    inset:0 auto auto 0 !important;
    top:0 !important;
    left:0 !important;
    right:auto !important;
    bottom:auto !important;
    width:100vw !important;
    max-width:100vw !important;
    height:var(--rf-chat-phone-height,100dvh) !important;
    max-height:var(--rf-chat-phone-height,100dvh) !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    background:#fff !important;
    transform:none !important;
  }
  body.chat-phone-thread-open .chat-page.has-active .chat-list-panel { display:none !important; }
  body.chat-phone-thread-open .chat-page.has-active .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    overflow:hidden !important;
  }
  body.chat-phone-thread-open .chat-conversation-head {
    position:relative !important;
    min-height:calc(68px + env(safe-area-inset-top)) !important;
    padding:calc(10px + env(safe-area-inset-top)) 18px 10px !important;
    flex:0 0 auto !important;
    background:#fff !important;
    z-index:3 !important;
  }
  body.chat-phone-thread-open .chat-messages {
    min-height:0 !important;
    height:auto !important;
    max-height:none !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    padding:16px 18px !important;
    overscroll-behavior:contain !important;
    -webkit-overflow-scrolling:touch;
  }
  body.chat-phone-thread-open .chat-composer {
    position:relative !important;
    inset:auto !important;
    z-index:4 !important;
    width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    padding:10px 16px calc(14px + env(safe-area-inset-bottom)) !important;
    grid-template-columns:46px minmax(0,1fr) 50px !important;
    gap:10px !important;
    background:#fff !important;
    border-top:1px solid var(--line) !important;
    box-shadow:0 -4px 16px rgba(26,30,35,.045) !important;
  }
  body.chat-phone-thread-open.chat-keyboard-open .chat-conversation-head {
    min-height:64px !important;
    padding-top:10px !important;
  }
  body.chat-phone-thread-open.chat-keyboard-open .chat-composer {
    padding-bottom:8px !important;
  }
  body.chat-phone-thread-open .chat-composer textarea {
    min-width:0 !important;
    width:100% !important;
    min-height:46px !important;
    max-height:104px !important;
    font-size:16px !important;
  }
}

/* iPad: exakt die PC-artige Zweispaltenansicht behalten. Bei geöffneter
   Bildschirmtastatur wird der Chat nur niedriger, niemals nach oben geschoben. */
@media (min-width:761px) and (max-width:1180px) and (pointer:coarse) {
  body.chat-tablet-keyboard {
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.chat-tablet-keyboard .chat-page,
  body.chat-tablet-keyboard .chat-page.has-active {
    position:static !important;
    inset:auto !important;
    display:grid !important;
    grid-template-columns:minmax(230px,30%) minmax(0,1fr) !important;
    width:100% !important;
    height:var(--rf-chat-tablet-height,calc(100dvh - 126px)) !important;
    max-height:var(--rf-chat-tablet-height,calc(100dvh - 126px)) !important;
    min-height:300px !important;
    margin:0 !important;
    overflow:hidden !important;
    border:1px solid var(--line) !important;
    border-radius:18px !important;
    box-shadow:var(--shadow-card) !important;
    background:#fff !important;
    transform:none !important;
  }
  body.chat-tablet-keyboard .chat-list-panel {
    display:flex !important;
    flex-direction:column !important;
    min-height:0 !important;
    overflow:hidden !important;
  }
  body.chat-tablet-keyboard .chat-thread-list {
    flex:1 1 auto !important;
    min-height:0 !important;
    overflow-y:auto !important;
  }
  body.chat-tablet-keyboard .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    min-width:0 !important;
    min-height:0 !important;
    height:100% !important;
    overflow:hidden !important;
  }
  body.chat-tablet-keyboard .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch;
  }
  body.chat-tablet-keyboard .chat-composer {
    position:relative !important;
    inset:auto !important;
    width:100% !important;
    margin:0 !important;
    padding:10px 12px !important;
    background:#fff !important;
  }
  body.chat-tablet-keyboard .chat-back { display:none !important; }
}

/* =========================================================
   V23.10.2 – iOS/iPadOS Chat-Viewport: VisualViewport-Anker
   =========================================================
   Wichtig: iOS Safari verschiebt beim Öffnen der Bildschirmtastatur nicht nur
   die sichtbare Höhe, sondern teils auch den VisualViewport. Deshalb wird die
   Chatkarte jetzt per JS exakt über den sichtbaren Bereich gelegt. Wir fixieren
   NICHT mehr den gesamten Body. */

@media (max-width:760px) {
  body.chat-phone-thread-open {
    position:static !important;
    inset:auto !important;
    width:auto !important;
    height:auto !important;
    min-height:100% !important;
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.chat-phone-thread-open .workspace,
  body.chat-phone-thread-open .content-shell,
  body.chat-phone-thread-open #app {
    position:static !important;
    overflow:visible !important;
  }
  body.chat-phone-thread-open .chat-page.has-active {
    position:absolute !important;
    top:var(--rf-chat-screen-top,0px) !important;
    left:var(--rf-chat-screen-left,0px) !important;
    right:auto !important;
    bottom:auto !important;
    width:var(--rf-chat-screen-width,100vw) !important;
    max-width:var(--rf-chat-screen-width,100vw) !important;
    height:var(--rf-chat-screen-height,100dvh) !important;
    max-height:var(--rf-chat-screen-height,100dvh) !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    z-index:1000 !important;
    overflow:hidden !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    transform:none !important;
    background:#fff !important;
  }
  body.chat-phone-thread-open .chat-page.has-active .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    overflow:hidden !important;
  }
  body.chat-phone-thread-open .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    height:auto !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
  }
  body.chat-phone-thread-open .chat-composer {
    position:relative !important;
    inset:auto !important;
    flex:0 0 auto !important;
    width:100% !important;
    min-width:0 !important;
    margin:0 !important;
  }
}

@media (min-width:761px) and (max-width:1180px) and (pointer:coarse) {
  body.chat-tablet-keyboard {
    position:static !important;
    inset:auto !important;
    width:auto !important;
    height:auto !important;
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.chat-tablet-keyboard .workspace,
  body.chat-tablet-keyboard .content-shell,
  body.chat-tablet-keyboard #app {
    position:static !important;
    overflow:visible !important;
  }
  body.chat-tablet-keyboard .chat-page,
  body.chat-tablet-keyboard .chat-page.has-active {
    position:absolute !important;
    top:var(--rf-chat-tablet-top,0px) !important;
    left:var(--rf-chat-tablet-left,0px) !important;
    right:auto !important;
    bottom:auto !important;
    width:var(--rf-chat-tablet-width,calc(100vw - 32px)) !important;
    max-width:var(--rf-chat-tablet-width,calc(100vw - 32px)) !important;
    height:var(--rf-chat-tablet-height,520px) !important;
    max-height:var(--rf-chat-tablet-height,520px) !important;
    min-height:280px !important;
    margin:0 !important;
    z-index:300 !important;
    display:grid !important;
    grid-template-columns:minmax(230px,30%) minmax(0,1fr) !important;
    overflow:hidden !important;
    transform:none !important;
  }
  body.chat-tablet-keyboard .chat-list-panel,
  body.chat-tablet-keyboard .chat-conversation {
    height:100% !important;
    min-height:0 !important;
    overflow:hidden !important;
  }
  body.chat-tablet-keyboard .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
  }
  body.chat-tablet-keyboard .chat-thread-list,
  body.chat-tablet-keyboard .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
    -webkit-overflow-scrolling:touch;
  }
  body.chat-tablet-keyboard .chat-composer {
    position:relative !important;
    inset:auto !important;
    width:100% !important;
    margin:0 !important;
    padding:10px 12px !important;
    background:#fff !important;
  }
}

/* =========================================================
   V23.10.3 – finaler Touch-Chat-Fix für iPhone/iPad
   =========================================================
   Keine Dokument-/Karten-Anker mehr. Auf Touch-Geräten wird beim Schreiben
   ausschließlich die echte VisualViewport-Höhe verwendet. Dadurch kann Safari
   den Chat nicht mehr aus dem sichtbaren Bereich pannen. */

@media (max-width:760px) {
  /* Untere Hauptnavigation bewusst weiter vom Displayrand / Home-Indikator weg. */
  body:not(.chat-phone-thread-open) {
    padding-bottom:calc(90px + env(safe-area-inset-bottom)) !important;
  }
  body:not(.chat-phone-thread-open) .mobile-nav {
    min-height:76px !important;
    padding-top:8px !important;
    padding-bottom:calc(14px + env(safe-area-inset-bottom)) !important;
  }

  /* Ein geöffneter Thread ist auf dem iPhone immer ein echtes Vollbild-Fenster. */
  body.chat-phone-thread-open {
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.chat-phone-thread-open .sidebar,
  body.chat-phone-thread-open .sidebar-backdrop,
  body.chat-phone-thread-open .topbar,
  body.chat-phone-thread-open .mobile-nav,
  body.chat-phone-thread-open .mobile-request {
    display:none !important;
  }
  body.chat-phone-thread-open .workspace,
  body.chat-phone-thread-open .content-shell,
  body.chat-phone-thread-open #app {
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
    overflow:visible !important;
  }
  body.chat-phone-thread-open .chat-page.has-active {
    position:fixed !important;
    inset:0 auto auto 0 !important;
    width:var(--rf-chat-vv-width,100vw) !important;
    max-width:var(--rf-chat-vv-width,100vw) !important;
    height:var(--rf-chat-vv-height,100dvh) !important;
    max-height:var(--rf-chat-vv-height,100dvh) !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    z-index:5000 !important;
    display:block !important;
    overflow:hidden !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    transform:none !important;
    background:#fff !important;
  }
  body.chat-phone-thread-open .chat-page.has-active .chat-list-panel {
    display:none !important;
  }
  body.chat-phone-thread-open .chat-page.has-active .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    overflow:hidden !important;
    background:#fff !important;
  }
  body.chat-phone-thread-open .chat-conversation-head {
    min-height:72px !important;
    padding:calc(10px + env(safe-area-inset-top)) 20px 10px !important;
    background:#fff !important;
    z-index:4 !important;
  }
  body.chat-phone-thread-open .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    height:auto !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    padding:16px 20px 18px !important;
    overscroll-behavior:contain !important;
    -webkit-overflow-scrolling:touch !important;
  }
  body.chat-phone-thread-open .chat-composer {
    position:relative !important;
    inset:auto !important;
    width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    grid-template-columns:48px minmax(0,1fr) 52px !important;
    gap:10px !important;
    padding:10px 18px calc(20px + env(safe-area-inset-bottom)) !important;
    background:#fff !important;
    border-top:1px solid var(--line) !important;
    box-shadow:0 -5px 18px rgba(26,30,35,.05) !important;
    z-index:5 !important;
  }
  body.chat-phone-thread-open.chat-keyboard-open .chat-conversation-head {
    min-height:62px !important;
    padding-top:8px !important;
  }
  body.chat-phone-thread-open.chat-keyboard-open .chat-composer {
    padding-bottom:12px !important;
  }
  body.chat-phone-thread-open .chat-composer textarea {
    width:100% !important;
    min-width:0 !important;
    min-height:46px !important;
    max-height:96px !important;
    font-size:16px !important;
  }
  body.chat-phone-thread-open .chat-attachment-preview {
    grid-column:1 / -1 !important;
    margin:0 !important;
  }
}

/* iPad: normal zweispaltig wie am PC. Sobald die Tastatur offen ist, wird genau
   dieselbe Zweispaltenansicht als stabiles Vollbild über den sichtbaren Bereich
   gelegt. Kein Nachführen einer alten Kartenposition, kein Hochschieben mehr. */
@media (min-width:761px) and (max-width:1180px) and (pointer:coarse) {
  body.chat-tablet-keyboard {
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.chat-tablet-keyboard .sidebar,
  body.chat-tablet-keyboard .sidebar-backdrop,
  body.chat-tablet-keyboard .topbar,
  body.chat-tablet-keyboard .mobile-nav,
  body.chat-tablet-keyboard .mobile-request {
    display:none !important;
  }
  body.chat-tablet-keyboard .workspace,
  body.chat-tablet-keyboard .content-shell,
  body.chat-tablet-keyboard #app {
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
    overflow:visible !important;
  }
  body.chat-tablet-keyboard .chat-page,
  body.chat-tablet-keyboard .chat-page.has-active {
    position:fixed !important;
    inset:0 auto auto 0 !important;
    width:var(--rf-chat-vv-width,100vw) !important;
    max-width:var(--rf-chat-vv-width,100vw) !important;
    height:var(--rf-chat-vv-height,100dvh) !important;
    max-height:var(--rf-chat-vv-height,100dvh) !important;
    min-height:0 !important;
    margin:0 !important;
    z-index:5000 !important;
    display:grid !important;
    grid-template-columns:minmax(240px,30%) minmax(0,1fr) !important;
    overflow:hidden !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    transform:none !important;
    background:#fff !important;
  }
  body.chat-tablet-keyboard .chat-list-panel,
  body.chat-tablet-keyboard .chat-conversation {
    height:100% !important;
    min-height:0 !important;
    overflow:hidden !important;
  }
  body.chat-tablet-keyboard .chat-list-panel {
    display:flex !important;
    flex-direction:column !important;
    border-right:1px solid var(--line) !important;
  }
  body.chat-tablet-keyboard .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
  }
  body.chat-tablet-keyboard .chat-thread-list,
  body.chat-tablet-keyboard .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
    -webkit-overflow-scrolling:touch !important;
  }
  body.chat-tablet-keyboard .chat-composer {
    position:relative !important;
    inset:auto !important;
    width:100% !important;
    margin:0 !important;
    padding:10px 14px 12px !important;
    background:#fff !important;
  }
  body.chat-tablet-keyboard .chat-back { display:none !important; }
}

/* =========================================================
   V23.10.4 – browserübergreifender Chat-Viewport (Touch)
   =========================================================
   Wichtig: keine Abhängigkeit mehr von `(pointer: coarse)` oder einem
   bestimmten Browser. JS erkennt Touchfähigkeit über maxTouchPoints und setzt
   die echte VisualViewport-Position/-Größe. Dadurch funktionieren iPhone/iPad
   auch in Edge/Chrome/Safari sowie Touch-Windows-Geräte mit virtueller Tastatur.
*/

@media (max-width:760px) {
  /* Mehr Luft zur unteren Displaykante/Home-Indikator in der normalen App. */
  body:not(.chat-phone-thread-open) {
    padding-bottom:calc(100px + env(safe-area-inset-bottom)) !important;
  }
  body:not(.chat-phone-thread-open) .mobile-nav {
    min-height:84px !important;
    padding-top:9px !important;
    padding-bottom:calc(20px + env(safe-area-inset-bottom)) !important;
  }

  /* Aktiver Handy-Thread exakt in den aktuell sichtbaren Browser-Viewport. */
  body.chat-phone-thread-open .chat-page.has-active {
    position:fixed !important;
    top:var(--rf-chat-vv-top,0px) !important;
    left:var(--rf-chat-vv-left,0px) !important;
    right:auto !important;
    bottom:auto !important;
    width:var(--rf-chat-vv-width,100vw) !important;
    max-width:var(--rf-chat-vv-width,100vw) !important;
    height:var(--rf-chat-vv-height,100dvh) !important;
    max-height:var(--rf-chat-vv-height,100dvh) !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    transform:none !important;
    overflow:hidden !important;
  }
  body.chat-phone-thread-open .chat-conversation {
    height:100% !important;
    min-height:0 !important;
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
  }
  body.chat-phone-thread-open .chat-messages {
    min-height:0 !important;
    height:auto !important;
    max-height:none !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
  }
  body.chat-phone-thread-open .chat-composer {
    position:relative !important;
    bottom:auto !important;
    margin:0 !important;
    padding:10px 18px calc(24px + env(safe-area-inset-bottom)) !important;
  }
  body.chat-phone-thread-open.chat-keyboard-open .chat-composer {
    padding-bottom:12px !important;
  }
}

/* Tablet: PC-artige Zweispaltenansicht, aber beim Tippen oder bei einem
   ausgewählten Foto als stabiler VisualViewport-Overlay. Kein Browser darf
   dabei die Seite/Chatkarte separat hoch- oder runterschieben. */
@media (min-width:761px) and (max-width:1366px) {
  body.chat-tablet-overlay {
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.chat-tablet-overlay .sidebar,
  body.chat-tablet-overlay .sidebar-backdrop,
  body.chat-tablet-overlay .topbar,
  body.chat-tablet-overlay .mobile-nav,
  body.chat-tablet-overlay .mobile-request {
    display:none !important;
  }
  body.chat-tablet-overlay .workspace,
  body.chat-tablet-overlay .content-shell,
  body.chat-tablet-overlay #app {
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
    overflow:visible !important;
  }
  body.chat-tablet-overlay .chat-page,
  body.chat-tablet-overlay .chat-page.has-active {
    position:fixed !important;
    top:var(--rf-chat-vv-top,0px) !important;
    left:var(--rf-chat-vv-left,0px) !important;
    right:auto !important;
    bottom:auto !important;
    width:var(--rf-chat-vv-width,100vw) !important;
    max-width:var(--rf-chat-vv-width,100vw) !important;
    height:var(--rf-chat-vv-height,100dvh) !important;
    max-height:var(--rf-chat-vv-height,100dvh) !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    z-index:6000 !important;
    display:grid !important;
    grid-template-columns:minmax(250px,31%) minmax(0,1fr) !important;
    overflow:hidden !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    background:#fff !important;
    transform:none !important;
  }
  body.chat-tablet-overlay .chat-list-panel,
  body.chat-tablet-overlay .chat-conversation {
    height:100% !important;
    min-height:0 !important;
    max-height:none !important;
    overflow:hidden !important;
  }
  body.chat-tablet-overlay .chat-list-panel {
    display:flex !important;
    flex-direction:column !important;
    border-right:1px solid var(--line) !important;
  }
  body.chat-tablet-overlay .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
  }
  body.chat-tablet-overlay .chat-thread-list,
  body.chat-tablet-overlay .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    overscroll-behavior:contain !important;
    -webkit-overflow-scrolling:touch !important;
  }
  body.chat-tablet-overlay .chat-composer {
    position:relative !important;
    inset:auto !important;
    width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    padding:10px 14px max(12px,env(safe-area-inset-bottom)) !important;
    background:#fff !important;
    border-top:1px solid var(--line) !important;
  }
  body.chat-tablet-overlay .chat-back { display:none !important; }
}

/* =========================================================
   V23.10.5 – Mobile Shell Hotfix
   Sidebar sicher schließbar + kompaktere Bottom-Navigation
   ========================================================= */
.sidebar-close { display:none; }

@media (max-width:760px) {
  /* Die Sidebar darf die untere Navigation nicht mehr überlagern/"festhängen".
     Beim geöffneten Menü ist ausschließlich Drawer + Backdrop bedienbar. */
  body.sidebar-open {
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.sidebar-open .mobile-nav {
    visibility:hidden !important;
    opacity:0 !important;
    pointer-events:none !important;
  }
  .sidebar {
    z-index:81 !important;
    height:100dvh !important;
    max-height:100dvh !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
    padding-top:max(18px, env(safe-area-inset-top)) !important;
    padding-bottom:max(16px, env(safe-area-inset-bottom)) !important;
  }
  .sidebar-backdrop,
  .sidebar-backdrop.show {
    z-index:80 !important;
  }
  .sidebar-close {
    position:absolute;
    top:max(12px, env(safe-area-inset-top));
    right:12px;
    z-index:3;
    width:42px;
    height:42px;
    display:grid;
    place-items:center;
    border:1px solid var(--line);
    border-radius:12px;
    background:#fff;
    color:#555c66;
    font-size:28px;
    line-height:1;
    box-shadow:0 4px 14px rgba(20,24,30,.07);
  }
  .sidebar .brand-block { padding-right:50px !important; }

  /* Nicht mehr künstlich hochziehen: klassischer App-Tabbar-Abstand plus
     ausschließlich die echte Safe-Area des Geräts. */
  body:not(.chat-phone-thread-open) {
    padding-bottom:calc(62px + env(safe-area-inset-bottom)) !important;
  }
  body:not(.chat-phone-thread-open) .content-shell {
    padding-bottom:calc(70px + env(safe-area-inset-bottom)) !important;
  }
  body:not(.chat-phone-thread-open) .mobile-nav {
    height:calc(58px + env(safe-area-inset-bottom)) !important;
    min-height:0 !important;
    padding-top:4px !important;
    padding-right:max(10px, env(safe-area-inset-right)) !important;
    padding-bottom:max(5px, env(safe-area-inset-bottom)) !important;
    padding-left:max(10px, env(safe-area-inset-left)) !important;
    align-items:start !important;
  }
  .mobile-nav-item {
    min-height:48px !important;
    padding:4px 2px !important;
    gap:2px !important;
  }
}

/* =========================================================
   V23.10.6 – Desktop/Tablet Chat bleibt als feste Chatkarte
   =========================================================
   Ab 761px greifen beim Tippen keinerlei Fullscreen-/VisualViewport-Overlays
   mehr. Das verhindert, dass Touch-Laptops als Tablet fehlklassifiziert werden
   und dass iPad/Tablet beim Fokus die zweispaltige Chatkarte plötzlich auf den
   ganzen Bildschirm vergrößert. Die Tastatur wird dort nativ vom Browser
   behandelt; nur das Handy (<761px) nutzt weiter den funktionierenden
   Vollbild-Chat aus V23.10.4/V23.10.5.
*/
@media (min-width:761px) {
  body.chat-tablet-overlay,
  body.chat-tablet-keyboard,
  body.chat-tablet-compose-focus {
    overflow:auto !important;
    overscroll-behavior:auto !important;
  }

  body.chat-tablet-overlay .sidebar,
  body.chat-tablet-overlay .sidebar-backdrop,
  body.chat-tablet-overlay .topbar,
  body.chat-tablet-overlay .mobile-nav,
  body.chat-tablet-overlay .mobile-request,
  body.chat-tablet-keyboard .sidebar,
  body.chat-tablet-keyboard .topbar {
    visibility:visible !important;
    pointer-events:auto !important;
  }

  body.chat-tablet-overlay .sidebar,
  body.chat-tablet-overlay .topbar,
  body.chat-tablet-keyboard .sidebar,
  body.chat-tablet-keyboard .topbar {
    display:flex !important;
  }
  body.chat-tablet-overlay .sidebar,
  body.chat-tablet-keyboard .sidebar { display:block !important; }

  body.chat-tablet-overlay .workspace,
  body.chat-tablet-overlay .content-shell,
  body.chat-tablet-overlay #app,
  body.chat-tablet-keyboard .workspace,
  body.chat-tablet-keyboard .content-shell,
  body.chat-tablet-keyboard #app {
    width:auto !important;
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
  }

  /* Die Chatkarte behält vor, während und nach dem Schreiben dieselbe Form. */
  body.chat-tablet-overlay .chat-page,
  body.chat-tablet-overlay .chat-page.has-active,
  body.chat-tablet-keyboard .chat-page,
  body.chat-tablet-keyboard .chat-page.has-active,
  body.chat-tablet-compose-focus .chat-page,
  body.chat-tablet-compose-focus .chat-page.has-active {
    position:relative !important;
    inset:auto !important;
    top:auto !important;
    left:auto !important;
    right:auto !important;
    bottom:auto !important;
    z-index:auto !important;
    width:100% !important;
    max-width:100% !important;
    height:calc(100dvh - 126px) !important;
    max-height:calc(100dvh - 126px) !important;
    min-height:390px !important;
    margin:0 !important;
    padding:0 !important;
    display:grid !important;
    grid-template-columns:260px minmax(0,1fr) !important;
    overflow:hidden !important;
    border:1px solid var(--line) !important;
    border-radius:18px !important;
    box-shadow:var(--shadow-card) !important;
    background:#fff !important;
    transform:none !important;
  }

  body.chat-tablet-overlay .chat-list-panel,
  body.chat-tablet-keyboard .chat-list-panel,
  body.chat-tablet-compose-focus .chat-list-panel {
    display:flex !important;
    flex-direction:column !important;
    min-height:0 !important;
    border-right:1px solid var(--line) !important;
  }
  body.chat-tablet-overlay .chat-conversation,
  body.chat-tablet-keyboard .chat-conversation,
  body.chat-tablet-compose-focus .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    min-height:0 !important;
    overflow:hidden !important;
  }
  body.chat-tablet-overlay .chat-thread-list,
  body.chat-tablet-overlay .chat-messages,
  body.chat-tablet-keyboard .chat-thread-list,
  body.chat-tablet-keyboard .chat-messages,
  body.chat-tablet-compose-focus .chat-thread-list,
  body.chat-tablet-compose-focus .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    overflow-y:auto !important;
  }
  body.chat-tablet-overlay .chat-composer,
  body.chat-tablet-keyboard .chat-composer,
  body.chat-tablet-compose-focus .chat-composer {
    position:relative !important;
    inset:auto !important;
    width:100% !important;
    margin:0 !important;
    padding:10px 12px !important;
    background:#fff !important;
    border-top:1px solid var(--line) !important;
  }
}

@media (min-width:761px) and (max-width:900px) {
  body.chat-tablet-overlay .chat-page,
  body.chat-tablet-overlay .chat-page.has-active,
  body.chat-tablet-keyboard .chat-page,
  body.chat-tablet-keyboard .chat-page.has-active,
  body.chat-tablet-compose-focus .chat-page,
  body.chat-tablet-compose-focus .chat-page.has-active {
    grid-template-columns:230px minmax(0,1fr) !important;
  }
}

/* =========================================================
   V23.10.7 – iPad/Tablet: PC-Chatkarte bleibt beim Tippen stehen
   =========================================================
   Desktop bleibt komplett unangetastet. Nur auf echten Tablets setzt app.js
   beim Fokus die Klasse `chat-tablet-stable`. Die Chatkarte behält dabei ihre
   ursprüngliche Breite und X-Position und wird lediglich in der Höhe bis ober-
   halb der Bildschirmtastatur verkürzt. VisualViewport offsetTop/offsetLeft
   werden laufend berücksichtigt, damit Edge/Chrome/Safari die Karte nicht aus
   dem sichtbaren Bereich pannen können.
*/
@media (min-width:761px) {
  body.chat-tablet-stable {
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }

  body.chat-tablet-stable .chat-page,
  body.chat-tablet-stable .chat-page.has-active {
    position:fixed !important;
    top:var(--rf-chat-tablet-stable-top, 12px) !important;
    left:var(--rf-chat-tablet-stable-left, 12px) !important;
    right:auto !important;
    bottom:auto !important;
    width:var(--rf-chat-tablet-stable-width, calc(100vw - 24px)) !important;
    max-width:var(--rf-chat-tablet-stable-width, calc(100vw - 24px)) !important;
    height:var(--rf-chat-tablet-stable-height, 520px) !important;
    max-height:var(--rf-chat-tablet-stable-height, 520px) !important;
    min-height:280px !important;
    margin:0 !important;
    padding:0 !important;
    z-index:120 !important;
    display:grid !important;
    grid-template-columns:260px minmax(0,1fr) !important;
    overflow:hidden !important;
    border:1px solid var(--line) !important;
    border-radius:18px !important;
    background:#fff !important;
    box-shadow:0 18px 50px rgba(25,31,39,.16) !important;
    transform:none !important;
  }

  body.chat-tablet-stable .chat-list-panel {
    display:flex !important;
    flex-direction:column !important;
    min-width:0 !important;
    min-height:0 !important;
    overflow:hidden !important;
    border-right:1px solid var(--line) !important;
    background:#fbfbfc !important;
  }

  body.chat-tablet-stable .chat-thread-list {
    min-height:0 !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
  }

  body.chat-tablet-stable .chat-conversation {
    display:grid !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    min-width:0 !important;
    min-height:0 !important;
    overflow:hidden !important;
    background:#fff !important;
  }

  body.chat-tablet-stable .chat-messages {
    min-height:0 !important;
    max-height:none !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
  }

  body.chat-tablet-stable .chat-composer {
    position:relative !important;
    inset:auto !important;
    width:100% !important;
    margin:0 !important;
    padding:10px 12px !important;
    border-top:1px solid var(--line) !important;
    background:#fff !important;
    z-index:2 !important;
  }
}

/* ================================================================
   V23.10.8 – Finaler Test-/Urlaubs-/Kalender-Polish
   ================================================================ */

/* Abwesenheitslimits: kompakte, sauber ausgerichtete Wochenbox. */
.limits-week-card {
  grid-template-columns:minmax(190px,.8fr) minmax(250px,1fr) 230px !important;
  gap:18px !important;
  align-items:end !important;
}
.limits-base-control.simplified {
  grid-template-columns:1fr !important;
  gap:7px !important;
  justify-items:start !important;
}
.limits-base-control.simplified > span { grid-column:auto !important; }
.limits-base-control.simplified .limit-base-stepper {
  width:220px !important;
  max-width:100% !important;
  grid-template-columns:46px minmax(0,1fr) 46px !important;
}
.compact-week-picker { grid-template-columns:minmax(200px,.8fr) minmax(260px,1fr) !important; }

/* Urlaubstage: Feiertage transparent ausweisen. */
.vacation-holiday-hint {
  display:grid;
  gap:3px;
  margin-top:10px;
  padding:9px 11px;
  border-radius:11px;
  background:#f0f7ff;
  border:1px solid #dbeaf8;
  color:#386a94;
  font-size:11px;
}
.vacation-holiday-hint strong { font-size:11.5px; }
.vacation-holiday-hint span { color:#668197; line-height:1.35; }
.vacation-metric-grid-status { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
.vacation-metric-grid-status > * { grid-column:auto !important; }
.vacation-metric-grid-status .available-metric { grid-column:auto !important; }

/* Kalender: Feiertage, Betriebsurlaub und Team-Momente. */
.event-dot.company_leave,.rf-cal-legend .company_leave i,.rf-day-event > i.company_leave,.dash-today-row i.company_leave { background:#ef5f7b !important; }
.event-dot.holiday,.rf-cal-legend .holiday i,.rf-day-event > i.holiday,.dash-today-row i.holiday { background:#2975b7 !important; }
.event-dot.birthday,.event-dot.anniversary,.rf-cal-legend .birthday i,.rf-day-event > i.birthday,.rf-day-event > i.anniversary,.dash-today-row i.birthday,.dash-today-row i.anniversary { background:#a36c17 !important; }
.rf-cal-mini-event.company_leave { background:#fff0f3; color:#b92e4c; }
.rf-cal-mini-event.holiday { background:#eef6ff; color:#2f6899; }
.rf-cal-mini-event.birthday,.rf-cal-mini-event.anniversary { background:#fff8e8; color:#8c621d; }
.rf-calendar-modern .rf-day-event.company_leave > span { background:#fff0f3; color:#b92e4c; }
.rf-calendar-modern .rf-day-event.holiday > span { background:#eef6ff; color:#2f6899; }
.rf-calendar-modern .rf-day-event.birthday > span,.rf-calendar-modern .rf-day-event.anniversary > span { background:#fff8e8; color:#8c621d; }

/* Betriebsurlaub-Verwaltung. */
.planning-hub-cards.three-cards { grid-template-columns:repeat(3,minmax(0,1fr)); }
.company-leave-admin { display:grid; gap:18px; }
.company-leave-form { display:grid; gap:12px; padding:16px; border:1px solid var(--line); border-radius:16px; background:var(--surface-alt); }
.company-leave-list { display:grid; gap:9px; }
.company-leave-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:16px;
  align-items:center;
  padding:14px 15px;
  border:1px solid var(--line);
  border-radius:15px;
  background:#fff;
}
.company-leave-row > div:first-child { min-width:0; display:grid; gap:3px; }
.company-leave-row strong { font-size:13px; }
.company-leave-row small { color:var(--muted); font-size:10.5px; line-height:1.4; }

/* Profilfoto: echter quadratischer Zuschnitt mit verschiebbarem Bild. */
.profile-crop-modal { display:grid; gap:16px; }
.profile-crop-stage {
  position:relative;
  width:min(100%,430px);
  aspect-ratio:1;
  margin:0 auto;
  overflow:hidden;
  border-radius:22px;
  background:#eceef1;
  box-shadow:inset 0 0 0 1px var(--line);
  touch-action:none;
  user-select:none;
}
.profile-crop-stage canvas { display:block; width:100%; height:100%; cursor:grab; touch-action:none; }
.profile-crop-stage canvas:active { cursor:grabbing; }
.profile-crop-ring {
  position:absolute;
  inset:2px;
  border:3px solid rgba(255,255,255,.94);
  border-radius:50%;
  box-shadow:0 0 0 999px rgba(20,25,32,.18),0 0 0 1px rgba(0,0,0,.12);
  pointer-events:none;
}
.profile-crop-zoom { display:grid; grid-template-columns:auto minmax(0,1fr); gap:12px; align-items:center; color:var(--muted); font-weight:700; font-size:11px; }
.profile-crop-zoom input { width:100%; }

/* Mediapool: Foto und Video identische Karten-/Preview-Fläche. */
.media-card-image .media-preview,
.media-card-video .media-preview,
.media-polaroid .media-preview {
  width:100% !important;
  aspect-ratio:4 / 5 !important;
  height:auto !important;
  min-height:0 !important;
  overflow:hidden !important;
}
.media-card-image .media-preview > img,
.media-card-video .media-preview > img,
.media-polaroid .media-preview > img,
.media-polaroid .media-file-placeholder {
  width:100% !important;
  height:100% !important;
  min-height:0 !important;
  object-fit:cover !important;
}

@media (min-width:761px) and (max-width:1199px) {
  .limits-week-card { grid-template-columns:minmax(180px,.8fr) minmax(220px,1fr) 210px !important; }
  .planning-hub-cards.three-cards { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
}

@media (max-width:760px) {
  .limits-week-card,.compact-week-picker { grid-template-columns:1fr !important; gap:12px !important; }
  .limits-base-control.simplified .limit-base-stepper { width:100% !important; }
  .vacation-metric-grid-status { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  .vacation-metric-grid-status > *,.vacation-metric-grid-status .available-metric { grid-column:auto !important; }
  .planning-hub-cards.three-cards { grid-template-columns:1fr !important; }
  .company-leave-row { grid-template-columns:1fr; }
  .company-leave-row .planning-entry-actions { justify-content:flex-start; }

  /* iOS/WebKit zoomt Eingabefelder unter 16px beim Fokussieren. */
  .media-upload-modal input,
  .media-upload-modal textarea,
  .media-upload-modal select,
  .media-selected-main input {
    font-size:16px !important;
  }
  .profile-crop-stage { width:min(100%,340px); border-radius:18px; }
}
.rf-toast {
  position:fixed;
  z-index:5000;
  left:50%;
  top:max(18px,env(safe-area-inset-top));
  transform:translate(-50%,-12px);
  max-width:min(92vw,420px);
  padding:11px 15px;
  border-radius:12px;
  background:#252a31;
  color:#fff;
  box-shadow:0 12px 34px rgba(20,25,32,.22);
  font-size:13px;
  font-weight:750;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease,transform .18s ease;
}
.rf-toast.show { opacity:1; transform:translate(-50%,0); }
.rf-toast.error { background:#a51f34; }
.rf-toast.success { background:#147a51; }

/* ================================================================
   V23.10.9 – Abwesenheitslimits sichtbar + Team-Momente Feinschliff
   ================================================================ */

/* Gespeicherte Wochen-/Tageslimits bleiben im Setup sichtbar und editierbar. */
.saved-limits-card { display:grid; gap:14px; }
.saved-limits-head { align-items:flex-start !important; }
.saved-limit-count {
  min-width:34px;
  height:34px;
  padding:0 10px;
  display:inline-grid;
  place-items:center;
  border-radius:999px;
  background:var(--brand-soft);
  color:var(--brand);
  font-size:12px;
  font-weight:800;
}
.saved-limit-list { display:grid; gap:9px; }
.saved-limit-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  align-items:center;
  padding:15px 16px;
  border:1px solid var(--line);
  border-radius:15px;
  background:linear-gradient(135deg,#fff 0%,#fbfbfc 100%);
}
.saved-limit-main { min-width:0; display:grid; gap:5px; }
.saved-limit-kicker {
  color:var(--muted);
  font-size:9px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.saved-limit-main > strong { font-size:13.5px; }
.saved-limit-meta { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:2px; }
.saved-limit-base,.saved-limit-chip {
  display:inline-flex;
  align-items:center;
  gap:4px;
  min-height:27px;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#f7f8fa;
  color:#626a75;
  font-size:10px;
}
.saved-limit-base { background:#fff3f5; border-color:#f8d9de; color:#a93848; }
.saved-limit-chip strong,.saved-limit-base b { color:inherit; font-weight:850; }
.saved-limit-chip.is-blocked { background:#fff0f1; border-color:#f5cdd2; color:#b12035; }
.saved-limit-chip.is-standard { color:#87909b; }
.saved-limit-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.saved-limit-actions .secondary { min-height:38px; padding:8px 11px; white-space:nowrap; }
.saved-limits-empty { margin:0; }

/* Geburtstage/Jubiläen: Icon exakt zentriert und freundlicher statt grau. */
.milestone-row .milestone-type {
  width:36px !important;
  height:36px !important;
  display:grid !important;
  place-items:center !important;
  align-self:center !important;
  margin:0 !important;
  border-radius:12px !important;
  border:1px solid transparent;
  box-shadow:0 5px 14px rgba(34,36,42,.08) !important;
}
.milestone-row .milestone-type.birthday {
  color:#ef4059 !important;
  background:linear-gradient(145deg,#fff0f4 0%,#fff8ec 100%) !important;
  border-color:#ffd7df !important;
}
.milestone-row .milestone-type.anniversary {
  color:#b87908 !important;
  background:linear-gradient(145deg,#fff8df 0%,#fff1d7 100%) !important;
  border-color:#f5dfaa !important;
}
.milestone-row .milestone-type .milestone-type-icon {
  display:block !important;
  width:19px !important;
  height:19px !important;
  margin:0 !important;
}

@media (max-width:760px) {
  .saved-limit-row { grid-template-columns:1fr; gap:12px; padding:14px; }
  .saved-limit-actions { justify-content:stretch; }
  .saved-limit-actions .secondary { flex:1 1 150px; white-space:normal; }
}


/* ================================================================
   V23.10.11 – Abwesenheitslimits: harte Belegungsprüfung + Warnung beim Speichern
   ================================================================ */
.saved-limit-chip-delete {
  appearance:none;
  border:0;
  background:rgba(255,255,255,.72);
  color:currentColor;
  width:19px;
  height:19px;
  display:inline-grid;
  place-items:center;
  border-radius:999px;
  margin-left:2px;
  padding:0;
  font:800 14px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  cursor:pointer;
}
.saved-limit-chip-delete:hover { background:#fff; box-shadow:0 0 0 1px rgba(0,0,0,.06); }
.saved-limit-actions .ghost.text-danger { min-height:38px; padding:8px 11px; white-space:nowrap; }
@media (max-width:760px) {
  .saved-limit-actions .ghost.text-danger { flex:1 1 150px; white-space:normal; }
}

/* V23.10.12 – tageweise Limitkonflikte im Urlaubsantrag */
.vacation-limit-conflicts{display:block!important}
.vacation-limit-conflicts>span{display:block;margin-bottom:8px}
.vacation-limit-conflicts>div{display:grid;gap:8px}
.vacation-limit-conflict-card{border:1px solid rgba(244,63,80,.18);background:rgba(244,63,80,.045);border-radius:14px;padding:11px 12px}
.vacation-limit-conflict-title{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:7px}
.vacation-limit-conflict-title strong{font-size:14px;color:#20242b}
.vacation-limit-conflict-title span{font-size:12px;color:#a82a38;text-align:right}
.vacation-limit-conflict-card ul{list-style:none;margin:0;padding:0;display:grid;gap:5px}
.vacation-limit-conflict-card li{display:flex;justify-content:space-between;gap:10px;font-size:12px}
.vacation-limit-conflict-card li strong{font-weight:700;color:#343942}
.vacation-limit-conflict-card li span{color:#777f8b;text-align:right}
@media(max-width:640px){.vacation-limit-conflict-title,.vacation-limit-conflict-card li{display:grid;grid-template-columns:1fr}.vacation-limit-conflict-title span,.vacation-limit-conflict-card li span{text-align:left}}

/* V23.10.13 – Mediapool-Notizen überall sichtbar */
.media-note-preview {
  margin: 6px 0 0;
  color: #626973;
  font-size: 11.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.media-card-expanded .media-note {
  display: block !important;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.media-video-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f8fa;
}
.media-video-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.media-video-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .media-note-preview { font-size: 12.5px; line-height: 1.45; }
  .media-card-expanded .media-note { display: block !important; font-size: 13px !important; }
}
