/* „Mein Kalender“ – gleiche Formensprache wie die E-Mail-Ansicht. */
.kal-shell { --kal-linie: #e4eaf2; --kal-text: #243650; --kal-leise: #6b7d93; --kal-blau: #2563eb; --kal-google: #1a73e8; --kal-microsoft: #c2570c; box-sizing: border-box; width: min(1440px, calc(100vw - 40px)); max-width: none; height: min(940px, calc(100dvh - 40px)); max-height: none; padding: 0; border: 1px solid var(--kal-linie); border-radius: 22px; background: #fff; color: var(--kal-text); font-family: Inter, system-ui, sans-serif; box-shadow: 0 30px 100px #12274b30; }
.kal-shell[open] { display: flex; flex-direction: column; }
.kal-shell::backdrop { background: #14264080; backdrop-filter: blur(5px); }
.kal-shell *, .kal-callback * { box-sizing: border-box; }
.kal-shell [hidden] { display: none !important; }
.kal-shell :is(button, input, select, textarea) { font: inherit; }
.kal-shell button { min-height: 42px; padding: 9px 14px; border: 1px solid #dce5f1; border-radius: 9px; background: #fff; color: #31577f; cursor: pointer; font-size: 13px; font-weight: 600; }
.kal-shell button:hover:not(:disabled) { background: #f0f5ff; }
.kal-shell button:disabled { opacity: .5; cursor: default; }
.kal-shell :is(input, select, textarea) { min-height: 44px; padding: 10px 12px; border: 1px solid #dce4ef; border-radius: 9px; background: #fff; color: var(--kal-text); font-size: 14px; width: 100%; }
.kal-shell :is(button, input, select, textarea):focus-visible { outline: 3px solid #80b2ff; outline-offset: 2px; }
.kal-shell .kal-primaer { background: var(--kal-blau); border-color: var(--kal-blau); color: #fff; }
.kal-shell .kal-primaer:hover:not(:disabled) { background: #1d50c3; }
.kal-shell .kal-gefahr { margin-left: auto; color: #a33a22; border-color: #f0d2c9; }
.kal-shell .kal-gefahr:hover:not(:disabled) { background: #fff3ef; }
.kal-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.kal-kopf { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 30px; border-bottom: 1px solid var(--kal-linie); }
.kal-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .14em; color: #71849e; }
.kal-kopf h1 { margin: 4px 0 0; font-size: 26px; letter-spacing: -.6px; }
.kal-shell .kal-schliessen { font-size: 24px; line-height: 1; padding: 6px 14px; }
.kal-hinweis { padding: 13px 30px; background: #ecf8f0; color: #27633b; font-size: 13px; line-height: 1.6; }
.kal-hinweis.is-error { background: #fff2ee; color: #8a3925; }
.kal-hinweis a { color: inherit; font-weight: 700; }
.kal-main { flex: 1; overflow: auto; padding: 22px 30px 28px; }

.kal-werkzeuge { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.kal-navigation, .kal-aktionen-oben { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kal-navigation h2 { margin: 0 0 0 8px; font-size: 18px; letter-spacing: -.3px; }
.kal-datum input { width: auto; min-height: 42px; }

.kal-problem { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; padding: 12px 16px; border: 1px solid #f3dcb0; border-radius: 12px; background: #fff8ea; color: #744d12; font-size: 13px; line-height: 1.6; }
.kal-problem strong { margin-right: 4px; }
.kal-problem button { flex-shrink: 0; }

.kal-raster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--kal-linie); border-radius: 14px; overflow: hidden; }
.kal-raster.is-tag { grid-template-columns: minmax(0, 1fr); }
.kal-raster[aria-busy="true"] { opacity: .65; }
.kal-raster > section { min-height: 360px; padding: 10px; border-right: 1px solid var(--kal-linie); }
.kal-raster > section:last-child { border-right: 0; }
.kal-raster > section.is-heute { background: #f4f8ff; }
.kal-raster h3 { margin: 4px 0 12px; text-align: center; font-size: 13px; color: #3d5474; }
.kal-raster h3 span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8494a9; }
.kal-raster .is-heute h3 { color: var(--kal-blau); }
.kal-shell .kal-termin { display: flex; flex-direction: column; gap: 3px; width: 100%; min-height: 0; margin: 0 0 7px; padding: 8px 9px; border: 0; border-left: 3px solid var(--kal-google); border-radius: 7px; background: #eaf2fe; color: #1f3552; text-align: left; font-weight: 400; }
.kal-shell .kal-termin.is-microsoft { border-left-color: var(--kal-microsoft); background: #fdf0e6; }
.kal-shell .kal-termin:hover:not(:disabled) { filter: brightness(.97); background: #e1ecfd; }
.kal-shell .kal-termin.is-microsoft:hover:not(:disabled) { background: #fbe6d6; }
.kal-termin strong { font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.kal-termin small, .kal-zeit { font-size: 11px; line-height: 1.35; color: #5a6d85; overflow-wrap: anywhere; }
.kal-zeit { font-weight: 600; color: #3a5373; }
.kal-quelle { opacity: .8; }
.kal-frei { margin: 18px 4px; color: #9aa8b9; font-size: 12px; text-align: center; }
.kal-klein { color: var(--kal-leise); font-size: 12px; line-height: 1.7; }

.kal-leer { max-width: 620px; margin: 6vh auto; text-align: center; }
.kal-leer h2 { font-size: 24px; margin: 0 0 10px; }
.kal-leer > p { color: var(--kal-leise); font-size: 14px; line-height: 1.7; }
.kal-vorlage-hinweis { font-weight: 600; color: #2d5c96 !important; }
.kal-anbieter-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0 14px; }
.kal-shell .kal-anbieter { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; border-left: 4px solid var(--kal-google); text-align: left; }
.kal-shell .kal-anbieter.is-microsoft { border-left-color: var(--kal-microsoft); }
.kal-anbieter strong { font-size: 15px; color: #1f3552; }
.kal-anbieter small { font-weight: 400; color: var(--kal-leise); }

.kal-formular { max-width: 760px; }
.kal-formular-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.kal-formular-kopf h2 { margin: 0; font-size: 20px; }
.kal-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kal-felder label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: #5c6f88; }
.kal-felder .kal-breit { grid-column: 1 / -1; }
.kal-felder .kal-check { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; color: var(--kal-text); }
.kal-felder .kal-check input { width: 18px; min-height: 18px; margin: 0; }
.kal-felder p { margin: 0; }
.kal-felder textarea { resize: vertical; }
.kal-formular-aktionen { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--kal-linie); }

.kal-callback { margin: 0; background: #f5f8fd; color: #263c5a; font: 16px/1.7 system-ui, sans-serif; }
.kal-callback main { max-width: 530px; margin: 15vh auto; padding: 35px; background: #fff; border: 1px solid #e0e8f4; border-radius: 20px; }
.kal-callback main > p:first-child { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: #71849e; }
.kal-callback a { color: #2563eb; }
.kal-callback a.nativ-rueckkehr { display: inline-block; padding: 12px 22px; border-radius: 999px; background: #2563eb; color: #fff; font-weight: 600; text-decoration: none; }

/* Integrationen: Kalenderkarten unter den Postfächern */
.kal-integrationen-kopf { margin-top: 44px; padding-top: 32px; border-top: 1px solid #dfe7ef; }
#kalender-integrationen { font-size: 14px; color: #233c59; }
#kalender-integrationen * { box-sizing: border-box; }
#kalender-integrationen [hidden] { display: none !important; }
#kalender-integrationen button { font: inherit; border: 1px solid #dce5ee; border-radius: 9px; background: #fff; padding: 10px 14px; color: #315474; cursor: pointer; }
#kalender-integrationen button:disabled { opacity: .6; cursor: default; }
#kalender-integrationen button:focus-visible { outline: 3px solid #80b2ff; outline-offset: 3px; }
#kalender-integrationen .mi-connect { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; min-height: 44px; font-size: 13px; font-weight: 600; text-align: left; }
#kalender-integrationen .mi-connect.is-primary { color: #fff; background: var(--primary, #0284c7); border-color: var(--primary, #0284c7); }
#kalender-integrationen .mi-accounts button { padding: 5px 9px; font-size: 11px; }
#kalender-integrationen .mi-badge.is-warning { background: #fff4e0; color: #8a5a12; }
#kalender-integrationen .kal-warnung { display: block; margin-top: 4px; font-size: 11px; color: #8a5a12; }

/* Einsatzplanung: Einsatz in den eigenen Kalender übernehmen */
.bp-event .kal-uebernehmen { display: block; width: auto; margin: 4px 0 0 auto; padding: 4px 8px; border: 0; background: transparent; color: #0b756b; font-size: 11px; font-weight: 600; text-align: right; }
.bp-event .kal-uebernehmen:hover { text-decoration: underline; background: transparent; }

@media (max-width: 900px) {
    .kal-raster { grid-template-columns: minmax(0, 1fr); }
    .kal-raster > section { min-height: 0; border-right: 0; border-bottom: 1px solid var(--kal-linie); display: grid; grid-template-columns: 58px minmax(0, 1fr); column-gap: 10px; align-items: start; }
    .kal-raster > section:last-child { border-bottom: 0; }
    .kal-raster > section > :not(h3) { grid-column: 2; }
    .kal-raster h3 { grid-row: 1 / span 20; margin: 2px 0; text-align: left; }
    .kal-raster .kal-frei { margin: 6px 0; text-align: left; }
}
@media (max-width: 760px) {
    .kal-shell { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
    .kal-kopf { padding: 16px 18px; }
    .kal-kopf h1 { font-size: 22px; }
    .kal-hinweis { padding: 12px 18px; }
    .kal-main { padding: 16px 16px 24px; }
    .kal-navigation h2 { flex-basis: 100%; margin: 6px 0 0; font-size: 16px; }
    .kal-aktionen-oben { width: 100%; }
    .kal-aktionen-oben .kal-primaer { margin-left: auto; }
    .kal-problem { flex-direction: column; align-items: flex-start; }
    .kal-anbieter-liste, .kal-felder { grid-template-columns: minmax(0, 1fr); }
    .kal-shell .kal-gefahr { margin-left: 0; }
    .kal-callback main { margin: 8vh 16px; padding: 24px; }
}
