:root {
  color-scheme: light;
  --green-900: #183725;
  --green-800: #274c35;
  --green-700: #315f3d;
  --green-100: #dfeadd;
  --cream: #f6f0e4;
  --roof: #a74732;
  --roof-dark: #7d3124;
  --white: #ffffff;
  --text: #1d2a21;
  --muted: #627066;
  --line: #d9ded8;
  --pending: #9a6a15;
  --pending-bg: #fff0c9;
  --danger: #9b2d2d;
  --shadow: 0 16px 36px rgba(24, 55, 37, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #fbfaf6 0%, var(--cream) 260px, var(--cream) 100%); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--green-800); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 16ch; margin-bottom: 0.75rem; font-size: clamp(1.85rem, 3.2vw, 2.8rem); line-height: 1.08; }
h2 { margin-bottom: 0; font-size: clamp(1.08rem, 1.4vw, 1.28rem); }

.page-width { width: min(1100px, calc(100% - 1.5rem)); margin-inline: auto; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(217, 222, 216, 0.85);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 82px; padding-block: 0.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.85rem; text-decoration: none; color: inherit; }
.brand img { display: block; width: 74px; height: 74px; object-fit: contain; }
.brand-copy { display: grid; gap: 0.08rem; }
.brand-copy strong { font-size: 1rem; line-height: 1.2; }
.brand-copy span { color: var(--muted); font-size: 0.8rem; }
.admin-link { padding: 0.68rem 0.88rem; border-radius: 0.65rem; background: var(--green-100); font-size: 0.88rem; font-weight: 750; text-decoration: none; white-space: nowrap; }

.hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.82fr); gap: 1.2rem; align-items: start; padding-block: 1.2rem 1.45rem; }
.hero-copy { padding-top: 0.35rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.eyebrow, .mini-label { margin-bottom: 0.26rem; color: var(--roof-dark); font-size: 0.72rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.mini-label { color: var(--muted); }
.lead { max-width: 58ch; margin-bottom: 1rem; color: var(--muted); font-size: 0.96rem; line-height: 1.58; }
.contact-card {
  padding: 0.95rem; border: 1px solid rgba(217, 222, 216, 0.9); border-top: 0.35rem solid var(--roof); border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.95); box-shadow: var(--shadow);
}
.contact-card-header { display: flex; gap: 0.85rem; align-items: center; }
.contact-logo { width: 70px; height: 70px; object-fit: contain; flex: 0 0 auto; }
.contact-card h2 { margin-bottom: 0.5rem; }
.contact-card p { margin-bottom: 0.24rem; line-height: 1.4; font-size: 0.93rem; }
.contact-details { display: grid; gap: 0.38rem; margin-top: 0.75rem; font-size: 0.92rem; }
.contact-details:empty::after { content: "Kontakt bestyrelsen via bookingformularen."; color: var(--muted); }
.muted { color: var(--muted); }

.booking-section { padding-bottom: 2.25rem; }
.booking-shell {
  padding: 0.9rem; border: 1px solid rgba(217, 222, 216, 0.95); border-radius: 1rem; background: rgba(255, 255, 255, 0.9); box-shadow: var(--shadow);
}
.booking-shell-header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 0.65rem; }
.room-filter { min-width: min(285px, 100%); }
.room-filter span, .form-grid label > span { display: block; margin-bottom: 0.28rem; font-size: 0.78rem; font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; gap: 0.55rem 1rem; margin-bottom: 0.8rem; color: var(--muted); font-size: 0.79rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.36rem; }
.legend-dot { width: 0.62rem; height: 0.62rem; border-radius: 50%; background: var(--line); }
.legend-dot.approved { background: var(--green-700); }
.legend-dot.pending { background: #d79b2a; }
.legend-dot.free { background: var(--white); border: 1px solid var(--line); }

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.85fr); gap: 0.9rem; align-items: start; }
.calendar-card, .selected-day-card {
  padding: 0.8rem; border: 1px solid var(--line); border-radius: 0.92rem; background: linear-gradient(180deg, #ffffff 0%, #fdfdfb 100%);
}
.calendar-card-top, .selected-day-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.calendar-toolbar { display: flex; align-items: center; gap: 0.4rem; }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday-row { padding: 0 0.1rem 0.35rem; color: var(--muted); font-size: 0.72rem; font-weight: 750; text-align: center; }
.calendar-grid { gap: 0.26rem; }
.day-cell {
  min-height: 4.8rem; padding: 0.38rem; overflow: hidden; border: 1px solid #e3e7e1; border-radius: 0.7rem; background: #fcfcfa; color: var(--text); cursor: pointer; text-align: left;
  transition: border-color 120ms ease, transform 120ms ease, background-color 120ms ease;
}
.day-cell:hover { border-color: var(--green-700); background: #ffffff; transform: translateY(-1px); }
.day-cell.outside-month { opacity: 0.45; background: #f7f6f2; }
.calendar-placeholder {
  display: block; min-height: 4.8rem; border: 0; background: transparent; pointer-events: none;
}
.day-cell.selected { outline: 2px solid var(--roof); outline-offset: -2px; background: #fffdfa; }
.day-cell.today .day-number { background: var(--green-800); color: var(--white); }
.day-number { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; font-size: 0.78rem; font-weight: 850; }
.calendar-booking {
  display: block; margin-top: 0.22rem; padding: 0.2rem 0.3rem; overflow: hidden; border-radius: 0.3rem; background: var(--green-100); color: var(--green-900);
  font-size: 0.64rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap;
}
.calendar-booking.pending { border-left-color: #d79b2a; background: #fff7df; color: var(--pending); }
.calendar-more { display: block; margin-top: 0.18rem; color: var(--muted); font-size: 0.63rem; }

.selected-day-card { min-height: 100%; }
.public-booking-list { display: grid; gap: 0.5rem; }
.public-booking-item {
  display: grid; grid-template-columns: 5.8rem 1fr; gap: 0.75rem; align-items: start; padding: 0.72rem; border: 1px solid var(--line); border-radius: 0.72rem; background: #fff;
}
.public-booking-item strong { color: var(--green-800); font-size: 0.9rem; }
.public-booking-item div { display: grid; gap: 0.1rem; }
.public-booking-item span { font-size: 0.92rem; }
.public-booking-item small { font-size: 0.74rem; }
.public-booking-item p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.88rem; }
.status-text { color: var(--green-700); }
.status-text.pending { color: var(--pending); }
.empty-state { padding: 0.75rem 0; color: var(--muted); }

.button, .icon-button { border: 0; border-radius: 0.66rem; cursor: pointer; font-weight: 800; text-decoration: none; }
.button { padding: 0.64rem 0.9rem; font-size: 0.9rem; }
.button.primary { background: var(--green-700); color: var(--white); }
.button.primary:hover { background: var(--green-800); }
.button.secondary { background: var(--green-100); color: var(--green-900); }
.icon-button { display: inline-grid; place-items: center; width: 2.35rem; height: 2.35rem; background: #f4f7f2; color: var(--green-900); font-size: 1.22rem; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
input, select, textarea { width: 100%; padding: 0.64rem 0.72rem; border: 1px solid #cbd4cc; border-radius: 0.62rem; background: var(--white); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(49, 95, 61, 0.22); border-color: var(--green-700); }

.dialog { width: min(740px, calc(100% - 1rem)); max-height: calc(100vh - 1rem); padding: 0; border: 0; border-radius: 1rem; box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28); }
.dialog::backdrop { background: rgba(16, 33, 22, 0.64); backdrop-filter: blur(2px); }
.dialog form { padding: 1.1rem; }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dialog-heading { margin-bottom: 0.55rem; }
.dialog-actions { justify-content: flex-end; margin-top: 0.9rem; }
.form-intro { color: var(--muted); font-size: 0.93rem; }
.booking-notice {
  display: grid; gap: 0.18rem; margin: 0 0 0.85rem; padding: 0.75rem 0.85rem; border-left: 0.28rem solid var(--roof);
  border-radius: 0.62rem; background: #fff7ed; color: var(--text); font-size: 0.9rem; line-height: 1.45;
}
.booking-notice strong { color: var(--roof-dark); }
.success-access-note { padding-top: 0.45rem; border-top: 1px solid rgba(49, 95, 61, 0.2); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.78rem; }
.form-grid .wide { grid-column: 1 / -1; }
.form-message { min-height: 1.3rem; margin: 0.75rem 0 0; color: var(--danger); font-weight: 750; }
.success-box { margin-top: 0.75rem; padding: 0.95rem; border-radius: 0.75rem; background: var(--green-100); }
.success-box p { margin: 0.35rem 0 0; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.hidden { display: none !important; }

.site-footer { padding: 1.1rem 0; background: var(--green-900); color: var(--white); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.45rem 1rem; font-size: 0.9rem; }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 30; max-width: min(28rem, calc(100% - 2rem)); padding: 0.9rem 1rem; border-radius: 0.75rem; background: var(--green-900); color: var(--white); opacity: 0; pointer-events: none; transform: translateY(1rem); transition: 180ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
  .calendar-layout { grid-template-columns: 1fr; }
  .selected-day-card { order: 2; }
}

@media (max-width: 760px) {
  .booking-shell-header, .calendar-card-top, .selected-day-heading { align-items: stretch; flex-direction: column; }
  .room-filter { min-width: 0; }
}

@media (max-width: 560px) {
  .header-inner { min-height: 72px; }
  .brand { gap: 0.55rem; }
  .brand img { width: 58px; height: 58px; }
  .brand-copy strong { font-size: 0.9rem; }
  .brand-copy span { font-size: 0.76rem; }
  .admin-link { padding: 0.52rem 0.62rem; font-size: 0.76rem; }
  .page-width { width: min(100% - 1rem, 1100px); }
  .hero { padding-block: 1rem 1.2rem; }
  h1 { font-size: 1.7rem; }
  .contact-card-header { align-items: flex-start; }
  .contact-logo { width: 60px; height: 60px; }
  .booking-shell { padding: 0.7rem; }
  .calendar-card { padding: 0.45rem; border-radius: 0.75rem; }
  .selected-day-card { padding: 0.65rem; border-radius: 0.75rem; }
  .weekday-row { font-size: 0.61rem; }
  .calendar-grid { gap: 0.2rem; }
  .day-cell, .calendar-placeholder { min-height: 3.9rem; }
  .day-cell { padding: 0.28rem; border-radius: 0.52rem; }
  .day-number { width: 1.28rem; height: 1.28rem; font-size: 0.72rem; }
  .calendar-booking { height: 0.36rem; padding: 0; font-size: 0; }
  .selected-day-heading { align-items: stretch; }
  .public-booking-item { grid-template-columns: 1fr; gap: 0.24rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .dialog-actions .button { flex: 1; }
}
