.com-naturfreund-booking .lead { max-width: 70rem; }
.nf-calendar-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; font-size: .95rem; }
.nf-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 999px; margin-right: .35rem; vertical-align: middle; border: 1px solid rgba(0,0,0,.2); }
.nf-dot-available { background: #e8f5e9; }
.nf-dot-booked { background: #f8d7da; }
.nf-dot-blocked { background: #fff3cd; }
.nf-dot-selected { background: #cfe2ff; }
.nf-dot-today { background: #fff3cd; }
.nf-calendar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.nf-month { border: 1px solid var(--border-color, #dfe3e7); border-radius: .5rem; background: var(--body-bg, #fff); padding: .75rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.nf-month-title { font-weight: 700; margin-bottom: .5rem; text-align: center; }
.nf-weekdays, .nf-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: .2rem; }
.nf-weekday { font-size: .75rem; font-weight: 600; text-align: center; color: var(--secondary-color, #6c757d); }
.nf-day { border: 1px solid transparent; border-radius: .35rem; min-height: 2.25rem; padding: .25rem; text-align: center; background: #e8f5e9; cursor: pointer; }
.nf-day:hover { border-color: #0d6efd; }
.nf-day.is-empty { background: transparent; cursor: default; }
.nf-day.is-past { background: #f1f3f5; color: #999; cursor: not-allowed; }
.nf-day.is-booked { background: #f8d7da; color: #842029; cursor: not-allowed; font-style: italic;
    text-decoration: none; }
.nf-day.is-blocked { background: #fff3cd; color: #664d03; cursor: not-allowed; font-style: italic;
    text-decoration: none; }
.nf-day.is-today { background: #fff3cd; border-color: #ffc107; }
.nf-day.is-selected, .nf-day.is-in-range { background: #cfe2ff; border-color: #0d6efd; color: #084298; }
.nf-day.is-range-invalid { outline: 2px solid #dc3545; }
.nf-selection-panel { border: 1px solid var(--border-color, #dfe3e7); border-radius: .5rem; padding: 1rem; background: var(--body-bg, #fff); margin: 1rem 0; }
.nf-selection-panel-horizontal { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(18rem, 24rem); gap: 1rem; align-items: start; }
.nf-selection-panel h2 { margin-top: 0; font-size: 1.25rem; }
.nf-selection-summary { display: grid; grid-template-columns: repeat(3, max-content auto); gap: .5rem 1rem; align-items: baseline; }
.nf-selection-summary dt { font-weight: 600; }
.nf-selection-summary dd { margin: 0; }
@media (max-width: 1100px) { .nf-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nf-selection-panel-horizontal { grid-template-columns: 1fr; } .nf-selection-summary { grid-template-columns: 1fr auto; } }
@media (max-width: 700px) { .nf-calendar { grid-template-columns: 1fr; } }

.nf-booking-form {
    margin-top: 2rem;
}

.nf-person-table input[type="number"] {
    min-width: 5rem;
}

.nf-extra-card {
    cursor: pointer;
}

.nf-price-preview dt,
.nf-price-preview dd {
    padding-top: .15rem;
    padding-bottom: .15rem;
}

/* 0.6.2-alpha6a: visible blocked days and checkout/checkin half-day states. */
.nf-day { position: relative; overflow: hidden; }
.nf-day.is-blocked {
    background: #fff3cd;
    border-color: #ffc107;
    color: #664d03;
    font-weight: 700;
    cursor: not-allowed;
    font-style: italic;
    text-decoration: none;
}
.nf-day.is-booked {
    background: #f8d7da;
    color: #842029;
    cursor: not-allowed;
    font-style: italic;
    text-decoration: none;
}
.nf-day.is-departure-half:not(.is-booked):not(.is-blocked) {
    background: linear-gradient(135deg, #f8d7da 0 50%, #e8f5e9 50% 100%);
    color: #0f5132;
    text-decoration: none;
}
.nf-day.is-arrival-half:not(.is-blocked) {
    background: linear-gradient(135deg, #e8f5e9 0 50%, #f8d7da 50% 100%);
    color: #842029;
}
.nf-day.is-turnover:not(.is-blocked) {
    background: linear-gradient(135deg, #f8d7da 0 50%, #f8d7da 50% 100%);
    color: #842029;
    text-decoration: line-through;
}
.nf-day.is-today:not(.is-blocked):not(.is-booked):not(.is-arrival-half):not(.is-departure-half) {
    background: #fff3cd;
    border-color: #ffc107;
}
.nf-day.is-selected,
.nf-day.is-in-range {
    background: #cfe2ff;
    border-color: #0d6efd;
    color: #084298;
    text-decoration: none;
}
.nf-dot-halfday { background: linear-gradient(135deg, #f8d7da 0 50%, #e8f5e9 50% 100%); }


/* 0.6.2-alpha7: selectable-state affordance and keyboard focus. */
.nf-day.is-arrival-selectable:not(.is-past):not(.is-blocked):not(.is-booked) {
    box-shadow: inset 0 -2px 0 rgba(25, 135, 84, .35);
}

.nf-day:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

.nf-dot-buffer { background:#adb5bd; }
.nf-day.is-buffer-am:not(.is-blocked):not(.is-booked):not(.is-arrival-half):not(.is-departure-half) {
    background: linear-gradient(135deg, #e9ecef 0 50%, #e8f5e9 50% 100%);
    color:#495057;
}
.nf-day.is-buffer-pm:not(.is-blocked):not(.is-booked):not(.is-arrival-half):not(.is-departure-half) {
    background: linear-gradient(135deg, #e8f5e9 0 50%, #e9ecef 50% 100%);
    color:#495057;
}
/* Arrival day: buffer AM / booked PM. */
.nf-day.is-arrival-half.is-buffer-am:not(.is-blocked) {
    background: linear-gradient(135deg, #e9ecef 0 50%, #f8d7da 50% 100%);
    color:#842029;
}
/* Departure day: booked AM / buffer PM. */
.nf-day.is-departure-half.is-buffer-pm:not(.is-blocked) {
    background: linear-gradient(135deg, #f8d7da 0 50%, #e9ecef 50% 100%);
    color:#842029;
}


/* Optional graphical room/bed selector. This is a visual layer over the existing person matrix. */
.nf-room-layout { border: 1px solid var(--border-color, #dfe3e7); border-radius: .5rem; padding: 1rem; background: rgba(0,0,0,.015); }
.nf-room-card-disabled { opacity: .72; }
.nf-bed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: .5rem; }
.nf-bed-button { position: relative; min-height: 52px; border: 1px solid #adb5bd; border-radius: .45rem; background: #fff; color: #343a40; display: flex; align-items: center; justify-content: center; padding: .45rem .3rem; cursor: pointer; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.nf-bed-button svg { width: 30px; height: 23px; }
.nf-bed-button:hover:not(:disabled) { border-color: #6c757d; transform: translateY(-1px); }
.nf-bed-button.is-selected { box-shadow: 0 0 0 .12rem rgba(0,0,0,.08); }
.nf-bed-button.is-member { background: #d1e7dd; border-color: #198754; color: #0f5132; }
.nf-bed-button.is-nonmember { background: #cfe2ff; border-color: #0d6efd; color: #084298; }
.nf-bed-button.is-bunk { border-style: dashed; }
.nf-bed-button:disabled { cursor: not-allowed; background: #e9ecef; color: #868e96; }
.nf-bed-number { position: absolute; left: .28rem; bottom: .12rem; font-size: .68rem; line-height: 1; }
.nf-bed-assignment { position: absolute; right: .25rem; bottom: .15rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .2rem; border-radius: 999px; font-size: .68rem; line-height: 1.15rem; text-align: center; font-weight: 700; background: currentColor; color: #fff; }
.nf-bed-assignment:empty { display: none; }
.nf-bed-modal-open { overflow: hidden; }
.nf-bed-choice-backdrop { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0,0,0,.55); }
.nf-bed-choice-modal { width: min(460px, calc(100vw - 2rem)); padding: 1.25rem; border: 1px solid #ced4da; border-radius: .65rem; background: #fff; color: #212529; box-shadow: 0 .75rem 2rem rgba(0,0,0,.3); }
.nf-bed-choice-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }
.nf-bed-choice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.nf-bed-choice-btn { appearance: none; border: 0; border-radius: .45rem; padding: .8rem 1rem; font-weight: 700; line-height: 1.2; cursor: pointer; text-align: center; color: #fff !important; opacity: 1 !important; }
.nf-bed-choice-btn.is-member { background: #198754 !important; }
.nf-bed-choice-btn.is-nonmember { background: #0d6efd !important; }
.nf-bed-choice-btn.is-cancel { grid-column: 1 / -1; background: #6c757d !important; }
.nf-bed-choice-btn:hover, .nf-bed-choice-btn:focus { filter: brightness(.92); color: #fff !important; outline: 2px solid rgba(0,0,0,.18); outline-offset: 2px; }
.nf-bed-bunk-mark { position: absolute; right: .25rem; top: .15rem; font-size: .62rem; line-height: 1; font-weight: 700; border: 1px solid currentColor; border-radius: 50%; width: 1.1rem; height: 1.1rem; display: inline-flex; align-items: center; justify-content: center; }
.nf-room-card-selection { min-height: 1.2em; }
.nf-room-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: .4rem; }
.nf-room-images img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .35rem; border: 1px solid #dee2e6; }

/* Pflichtfeld-UX: fehlende Angaben klar markieren und beim Absenden anspringen. */
.nf-booking-form .form-control.is-invalid,
.nf-booking-form .form-select.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 .18rem rgba(220, 53, 69, .16) !important;
}

.nf-booking-form .form-check-input.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 .16rem rgba(220, 53, 69, .16) !important;
}

.nf-booking-form .nf-required-group-invalid,
.nf-calendar-panel.nf-required-group-invalid,
.nf-booking-selection.nf-required-group-invalid {
    border: 2px solid #dc3545 !important;
    border-radius: .5rem;
    box-shadow: 0 0 0 .18rem rgba(220, 53, 69, .12);
}

.nf-booking-form fieldset.nf-required-group-invalid {
    padding: .75rem;
}

/* rc58: blocked-range edge semantics in the public booking calendar. */
.nf-day.is-before-blocked:not(.is-blocked):not(.is-booked) {
    background: linear-gradient(135deg, #e8f5e9 0 50%, #fff3cd 50% 100%);
    color: #495057;
}
.nf-day.is-adjacent-block-unavailable:not(.is-blocked):not(.is-booked) {
    cursor: not-allowed;
    box-shadow: none;
}

/* rc60: visual buffer overlays must never hide a genuinely occupied full day.
   This matters when the buffer of an adjacent booking falls onto an already
   occupied day (e.g. consecutive bookings). Boundary half-days are still
   rendered by the dedicated arrival/departure rules above. */

/* rc59: directional buffer semantics and selected-state visibility. */
.nf-day.is-buffer-full:not(.is-blocked):not(.is-booked) {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
}

/* The selected arrival/departure must remain visibly selected even when the
   underlying day carries a visual buffer class. */
.nf-day.is-selected,
.nf-day.is-selected.is-buffer-am,
.nf-day.is-selected.is-buffer-pm,
.nf-day.is-selected.is-buffer-full,
.nf-day.is-in-range {
    background: #cfe2ff !important;
    border-color: #0d6efd !important;
    color: #084298 !important;
    text-decoration: none !important;
}


/* 0.6.4-rc74: public calendar cleanup and booking-type buttons. */
/* Unavailable states use italic text only; no strike-through. */
.nf-day.is-booked,
.nf-day.is-blocked,
.nf-day.is-turnover,
.nf-day.is-adjacent-block-unavailable,
.nf-day.is-buffer-full {
    text-decoration: none !important;
    font-style: italic;
}

/* Blocked dates are always shown as one consistent light-yellow state. */
.nf-day.is-blocked,
.nf-day.is-before-blocked {
    background: #fff3cd !important;
    border-color: #ffc107 !important;
    color: #664d03 !important;
}

/* Slightly darker grey for buffer/unavailable calendar states. */
.nf-day.is-buffer-full:not(.is-blocked):not(.is-booked),
.nf-day.is-adjacent-block-unavailable:not(.is-blocked):not(.is-booked) {
    background: #dee2e6;
    color: #5c636a;
}

/* Past dates have highest visual priority, regardless of booking/block/buffer state. */
.nf-day.is-past,
.nf-day.is-past.is-booked,
.nf-day.is-past.is-blocked,
.nf-day.is-past.is-buffer-am,
.nf-day.is-past.is-buffer-pm,
.nf-day.is-past.is-buffer-full,
.nf-day.is-past.is-arrival-half,
.nf-day.is-past.is-departure-half,
.nf-day.is-past.is-turnover,
.nf-day.is-past.is-before-blocked,
.nf-day.is-past.is-adjacent-block-unavailable {
    background: #dee2e6 !important;
    border-color: #ced4da !important;
    color: #5f6770 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    font-style: normal !important;
    text-decoration: none !important;
}

.nf-booking-type-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}
.nf-booking-type-option {
    display: block;
    margin: 0;
    cursor: pointer;
}
.nf-booking-type-option .form-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.nf-booking-type-option .form-check-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.25rem;
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid #adb5bd;
    border-radius: .5rem;
    background: #e9ecef;
    color: #343a40;
    font-weight: 700;
    text-align: center;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.nf-booking-type-option .form-check-input:checked + .form-check-label {
    background: #d1e7dd;
    border-color: #198754;
    color: #0f5132;
    box-shadow: inset 0 0 0 1px #198754;
}
.nf-booking-type-option .form-check-input:focus-visible + .form-check-label {
    outline: 3px solid rgba(13,110,253,.35);
    outline-offset: 2px;
}
@media (max-width: 700px) {
    .nf-booking-type-options { grid-template-columns: 1fr; }
}

/* 0.6.4-rc77: a free day immediately before a manual block remains usable as
   departure day. Show that boundary explicitly as green/yellow instead of
   making it look fully blocked. */
.nf-day.is-before-blocked:not(.is-blocked):not(.is-booked):not(.is-past) {
    background: linear-gradient(135deg, #e8f5e9 0 50%, #fff3cd 50% 100%) !important;
    border-color: #ffc107 !important;
    color: #495057 !important;
    cursor: pointer;
    font-style: normal;
}


/* 0.6.4-rc78: if neither arrival nor departure is possible on an otherwise
   non-booked/non-blocked day, the day is fully unavailable and must not keep
   a misleading green half from buffer styling. */
.nf-day.is-fully-unavailable:not(.is-blocked):not(.is-booked):not(.is-past) {
    background: #e9ecef !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    font-style: normal !important;
    text-decoration: none !important;
}


/* 0.6.4-rc80: future fully unavailable days use the same light grey as the
   grey half of directional buffer days. Darker grey is reserved for past dates. */
.nf-day.is-fully-unavailable:not(.is-blocked):not(.is-booked):not(.is-past) {
    background: #e9ecef !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
}
