.res-primary, .res-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: .65rem 1rem; border-radius: .65rem;
    font-weight: 650; text-align: center;
}
.res-primary { background: #2c5e4a; color: #fff; }
.res-primary:not(:disabled):hover { background: #214638; }
.res-primary:disabled { background: #e6e9e5; color: #50584f; cursor: default; }
.res-secondary { color: #214638; border: 1px solid #89a092; }
.res-secondary:hover { background: #eaf1eb; }
.res-direct { display: grid; gap: .55rem; }
.res-calendar-entry { margin-top: 1.1rem; }
[data-res-open][hidden] { display: none; }

.res-dialog {
    position: fixed; inset: 0; margin: auto;
    width: min(870px, calc(100% - 2rem)); max-width: none;
    max-height: calc(100dvh - 2rem); padding: 0;
    border: 1px solid #dcd9d0; border-radius: 1rem;
    background: #faf8f3; color: #29362e;
    box-shadow: 0 18px 70px #11241e52; overflow: hidden;
}
.res-dialog::backdrop { background: #101b17b3; }
.res-panel { display: flex; flex-direction: column; max-height: calc(100dvh - 2rem); animation: res-reveal .18s ease-out; }
.res-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
    border-bottom: 1px solid #dedbd2; padding: 1rem 1.25rem; background: #f0eee6;
}
.res-header h2 { font-family: "Playfair Display", Georgia, serif; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
.res-header p { color: #46564c; font-size: .9rem; }
.res-icon {
    flex: none; width: 44px; height: 44px; border: 1px solid #c0cec3;
    border-radius: .6rem; color: #254c3e; background: white; font-size: 1.3rem;
}
.res-icon:disabled { opacity: .45; }
.res-dialog :is(button):focus-visible, [data-res-open]:focus-visible { outline: 2px solid #94452e; outline-offset: 2px; }
.res-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 1.1rem; padding: 1.05rem 1.25rem; overflow: auto; overscroll-behavior: contain; }
.res-calendar { min-width: 0; }
.res-month { display: flex; justify-content: space-between; align-items: center; gap: .45rem; }
.res-month h3 { font-weight: 700; }
.res-week, .res-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .2rem; text-align: center; }
.res-week { margin-block: .45rem .25rem; font-size: .75rem; color: #4a584f; }
.res-days button {
    min-width: 0; min-height: 36px; border: 1px solid #bac9bd; border-radius: .42rem;
    background: #f2f7f1; font-variant-numeric: tabular-nums; color: #223f32; font-weight: 600;
}
.res-legend { display: flex; flex-wrap: wrap; list-style: none; gap: .35rem .7rem; margin-top: .65rem; font-size: .73rem; }
.res-legend li::before { content: ''; display: inline-block; width: .75rem; height: .75rem; border: 1px solid #728076; margin-inline-end: .3rem; vertical-align: -.1rem; background: #f2f7f1; }
.res-days [data-state="occupied"], .res-legend [data-state="occupied"]::before { background: #f5e1dc; color: #793a2d; text-decoration: line-through; }
.res-days [data-state="unknown"], .res-legend [data-state="unknown"]::before { background: #fff2ce; color: #664513; border-style: dashed; }
.res-days [data-state="outside"], .res-legend [data-state="outside"]::before { background: #ebe9e5; color: #50564f; border-style: dotted; }
.res-days [aria-disabled="true"] { cursor: default; }
.res-clear { min-height: 44px; text-decoration: underline; font-size: .85rem; color: #2b5141; }
.res-dates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; padding-bottom: .7rem; border-bottom: 1px solid #e7e5df; }
.res-dates dt { color: #536056; }
.res-dates dd { font-weight: 650; overflow-wrap: anywhere; }
.res-guest, .res-guest div { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.res-guest { margin-block: .55rem; }
.res-guest output { min-width: 1rem; text-align: center; font-weight: 700; }
.res-status { grid-column: 1 / -1; margin: 0; padding-bottom: .35rem; border-bottom: 1px solid #e7e5df; color: #365044; }
.res-status:is([data-state="occupied"],[data-state="unknown"],[data-state="outside"],[data-state="order"]) { color: #793a2d; }
.res-includes { font-size: .8rem; color: #506055; border-top: 1px solid #e7e5df; padding-top: .6rem; }
.res-footer { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .55rem; padding: .7rem 1.25rem; border-top: 1px solid #dedbd2; background: #fff; font-size: .84rem; }
.res-footer strong { display: block; color: #214638; font-size: 1.28rem; }
.res-footer small { display: block; color: #49564f; font-size: .72rem; }
.res-footer button { width: 100%; margin-bottom: .22rem; }
@keyframes res-reveal { from { opacity: 0; transform: translateY(11px); } to { opacity: 1; transform: none; } }
@media (max-width: 767px) {
    .res-dialog { inset: auto 0 0; margin: 0; width: 100%; max-height: 96dvh; border-radius: 1rem 1rem 0 0; }
    .res-panel { max-height: 96dvh; }
    .res-header { padding: .65rem .75rem; }
    .res-body { grid-template-columns: minmax(0,1fr); gap: .6rem; padding: .65rem .75rem; }
    .res-footer { padding: .5rem .75rem max(.5rem, env(safe-area-inset-bottom)); }
    .res-days button { min-height: 36px; }
}
@media (max-height: 440px) {
    .res-header p { display: none; }
    .res-footer { padding-block-start: .35rem; }
}
@media (prefers-reduced-motion: reduce) { .res-panel { animation: none; } }

.res-body {
    grid-template-areas: "calendar dates" "calendar guests" "calendar includes";
    grid-template-rows: auto auto 1fr; gap: .45rem 1rem; padding-block: .7rem;
    min-height: 0;
}
.res-calendar { grid-area: calendar; }
.res-dialog button { user-select: none; }
.res-dates {
    grid-area: dates; align-self: start;
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; border: 0; padding: 0;
}
.res-date { min-width: 0; padding: .3rem .5rem; border: 1px solid #d5dbd2; border-radius: .5rem; background: #fff; }
.res-date[data-active="true"] { border-color: #426854; box-shadow: inset 0 0 0 1px #426854; }
.res-date dt { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .35rem; font-size: .73rem; }
.res-date dd { font-size: .86rem; }
.res-date-step { font-weight: 700; color: #254c3e; font-size: .68rem; }
.res-guest {
    grid-area: guests; margin: 0; padding: .14rem .5rem; border: 1px solid #deded5;
    border-radius: .5rem; background: #fff; font-size: .88rem; font-weight: 650;
}
.res-includes { grid-area: includes; border: 0; padding: .15rem 0; }
.res-week, .res-days { column-gap: 0; row-gap: .18rem; }
.res-week { margin-block: .25rem .18rem; }
.res-legend { gap: .2rem .55rem; margin-top: .45rem; }
.res-days [data-state="occupied"], .res-legend [data-state="occupied"]::before {
    background: repeating-linear-gradient(135deg,#f5e1dc 0 4px,#ebccc3 4px 5px);
}
.res-days [data-state="past"], .res-legend [data-state="past"]::before {
    background: #efede8; color: #666760; border-color: transparent;
}
.res-days [data-state="today"], .res-legend [data-state="today"]::before {
    background: #fff; color: #254c3e; border: 2px solid #426854; border-radius: .65rem;
}
.res-days [data-selection="range"] {
    background: #bbd5c1; color: #163726; border-block: 2px solid #52745c;
    border-inline: 0; border-radius: 0; box-shadow: none;
}
.res-days [data-selection="range"]:is([data-state="unknown"],[data-state="outside"]) {
    background: repeating-linear-gradient(135deg,#c8dccb 0 5px,#e6eee4 5px 8px); border-block-style: dashed;
}
.res-days [data-selection="arrival"] {
    background: #244e3c; color: #fff; border: 2px solid #244e3c; border-radius: .65rem 0 0 .65rem;
}
.res-days [data-selection="departure"] {
    background: #e5eee5; color: #173c2c; border: 2px solid #244e3c;
    border-radius: 0 .65rem .65rem 0; text-decoration: none;
}
.res-days button:focus-visible { z-index: 1; }
.res-footer { grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: .25rem .55rem; padding-block: .45rem; font-size: .79rem; }
.res-total strong { font-size: 1.55rem; line-height: 1.15; }
.res-footer-stay { margin-bottom: .15rem; font-weight: 700; color: #254c3e; }
.res-footer-stay span:empty { display: none; }
.res-footer-stay span:first-child:not([hidden])::after { content: ' · '; }
.res-footer button { gap: .38rem; margin-bottom: .14rem; }
.res-footer button i { font-size: 1.15rem; }

@media (max-width: 767px) {
    .res-header { padding: .48rem .7rem; }
    .res-header p { font-size: .82rem; }
    .res-body {
        grid-template-areas: "dates" "guests" "includes" "calendar";
        grid-template-rows: auto; gap: .35rem; padding: .32rem .65rem;
        scroll-padding-block-start: 4.5rem;
    }
    .res-dates { position: sticky; top: -.32rem; z-index: 2; background: #faf8f3; padding-block: .18rem; }
    .res-footer { padding: .36rem .65rem max(.36rem, env(safe-area-inset-bottom)); }
    .res-footer button { padding-inline: .5rem; }
}
@media (max-height: 440px) {
    .res-dates { position: static; }
    .res-body { scroll-padding-block-start: 0; }
}
