/* New design: simple, mobile-first, light/dark. */
:root {
  --bg: #f6f5f3;
  --surface: #ffffff;
  --text: #22201f;
  --muted: #6b6762;
  --line: #e4e1dc;
  --accent: #53577f;
  --accent-text: #ffffff;
  --mine: #3f7f99;
  --other: #5c6f8a;
  --part: #7d5aa6;
  --danger: #b3261e;
  --ok: #1f7a3a;
  --radius: 12px;
  --logo-a: #c06b9a;
  --logo-b: #53577f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --surface: #211f1e;
    --text: #f1eeea;
    --muted: #a8a29b;
    --line: #34312e;
    --accent: #8e93c9;
    --accent-text: #15161f;
    --mine: #6fb0cb;
    --other: #8aa0c0;
    --part: #b18ddc;
    --danger: #f2b8b5;
    --ok: #7fd49a;
    --logo-a: #e7a3c8;
    --logo-b: #9aa0dc;
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a {
  color: var(--accent);
}
h1 {
  font-size: 1.5rem;
  margin: 0.5rem 0 1rem;
}
h2 {
  font-size: 1.15rem;
  margin: 1.25rem 0 0.5rem;
}
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  text-decoration: none;
}
.brand img {
  display: block;
  height: 30px;
  width: auto;
}
@media (prefers-color-scheme: dark) {
  .brand img {
    filter: invert(1) hue-rotate(180deg);
  }
}
/* Wraps instead of scrolling, so no item is ever hidden off-screen (German labels are longer) */
.mainnav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
}
.mainnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.mainnav a:hover {
  background: var(--bg);
}
.content {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}
.footer {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer form {
  margin: 0;
}
.linkbutton {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
}

/* Forms (shared markup uses Bootstrap class names) */
.form-group {
  margin-bottom: 14px;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.form-control,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="date"] {
  width: 100%;
  height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
textarea.form-control {
  height: auto;
  min-height: 90px;
}
/* Native selects ignore height in Safari: draw our own so they match the text fields */
select,
select.form-control {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
/* iOS Safari shrinks date fields to their text unless told otherwise */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
  min-height: 44px;
  line-height: 26px;
  font-size: 16px;
}
input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  min-height: 26px;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.6;
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn-danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-sm {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 0.9rem;
}
.btn-link {
  border: 0;
  background: none;
  color: var(--accent);
}
.btn[disabled] {
  opacity: 0.6;
}
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  border: 1px solid;
}
.alert-danger {
  color: var(--danger);
  border-color: var(--danger);
}
.alert-success {
  color: var(--ok);
  border-color: var(--ok);
}
.alert-info {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface);
}
.auth-page {
  max-width: 420px;
  margin: 24px auto;
}
.auth-form .hint {
  color: var(--muted);
}
.code-input {
  font-size: 1.6rem;
  letter-spacing: 0.35em;
  text-align: center;
}
.notice {
  text-align: center;
  margin: 48px auto;
}

/* Cards and lists */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.announcement {
  white-space: pre-line;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.list li:last-child {
  border-bottom: 0;
}
.muted {
  color: var(--muted);
}
.room-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.room-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  margin-right: 6px;
  font-size: 0.9rem;
}

/* Day agenda */
.daynav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.daynav h1 {
  margin: 0;
  font-size: 1.2rem;
  text-align: center;
}
.daynav .btn {
  min-width: 44px;
}
.rooms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 760px) {
  .rooms-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}
.room-col h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--text);
}
.slot.free {
  border: 1px dashed var(--line);
  color: var(--muted);
}
.slot.free:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.slot.booked {
  background: var(--other);
  color: #fff;
}
.slot.booked.mine {
  background: var(--mine);
}
.slot.booked.participating {
  background: var(--part);
}
.slot.past {
  opacity: 0.5;
}
.slot .time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.9rem;
}
.fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* Month list */
.month-day {
  margin-bottom: 10px;
}
.month-day h3 {
  font-size: 0.95rem;
  margin: 0 0 4px;
  color: var(--muted);
}
.month-day.today h3 {
  color: var(--accent);
}

/* Booking form: sections are plain groups, labelled like the other fields */
.booking-page fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  min-width: 0;
}
.booking-page legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 6px;
}
.booking-page .repeat legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.participants .people {
  max-height: 232px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.participants .people .check {
  display: flex;
  margin: 0;
  min-height: 40px;
}
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
}
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
}
.chips button {
  border: 0;
  background: none;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.booking-page .rooms label,
.booking-page .weekdays label,
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: normal;
  margin: 0 14px 8px 0;
  min-height: 32px;
}
.booking-page input[type="checkbox"],
.booking-page input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}
.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
/* One date, then From/To side by side; the multi-day layout uses .inline-fields */
.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}
.date-row > .form-group:first-child {
  grid-column: 1 / -1;
}
@media (min-width: 640px) {
  .date-row {
    grid-template-columns: 2fr 1fr 1fr;
  }
  .date-row > .form-group:first-child {
    grid-column: auto;
  }
}
.booking-page .check.multi-day {
  margin: -4px 0 16px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Admin tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
.table th,
.table td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table-wrap {
  overflow-x: auto;
}

/* Logo (new design) */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.logo-word {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* Language switch (footer) */
.lang-switch {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}
.lang-switch [aria-current] {
  font-weight: 600;
}

/* Contact card */
.contact-card {
  margin: 24px 0 88px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.contact-card h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.contact-card p {
  margin: 0 0 12px;
  color: var(--muted);
}
.contact-card p a {
  color: inherit;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Admin tabs: wrap on small phones, full-size tap targets */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.admin-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}
.admin-search {
  max-width: 360px;
}
/* Footer links and buttons: 44px tap targets */
.footer a,
.footer .linkbutton,
.lang-switch [aria-current] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
}
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

/* Repeat: the select gets the full row until an interval/until field joins it */
.repeat .inline-fields > .form-group:only-child {
  grid-column: 1 / -1;
}
@media (max-width: 400px) {
  .mainnav a {
    padding: 0 9px;
  }
}
/* Small phones: the header wraps to two rows, so let it scroll away instead of staying pinned */
@media (max-width: 480px) {
  .topbar {
    position: static;
  }
}
