/* ==========================================================================
   Vakantieplanner — styles
   Opbouw: 1) basis  2) scherm 1 (naam)  3) appbalk & tabs  4) kalender
           5) overzicht  6) menu/dialoog/toast  7) klein scherm
   ========================================================================== */

:root {
  --primary: #ff385c;
  --primary-dark: #e31c5f;
  --ink: #222222;
  --ink-soft: #484848;
  --muted: #717171;
  --line: #dddddd;
  --line-soft: #ebebeb;
  --bg: #f7f7f7;
  --card: #ffffff;
  --green: #2d6a4f;
  --green-line: #a8d5b8;
  --green-soft: #e7f5ec;
  --red: #d64545;
  --red-ink: #9b2c2c;
  --red-line: #f0b8b8;
  --red-soft: #fdecec;
  /* De kwastkleuren: groen = ik kan, geel = weet nog niet, rood = kan niet,
     grijs = wissen (dagen weer leegmaken). */
  --maybe: #f2b705;
  --maybe-ink: #7a5200;
  --maybe-soft: #fff4cc;
  --maybe-line: #e6c85c;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.12);
  /* Worden door app.js op de echte hoogte van de appbalk en tabs gezet. */
  --appbar-h: 57px;
  --tabs-h: 49px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; }

p { margin: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 5px;
}

.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.pad { padding: 12px 16px; }

/* ---------- 1. Basis ---------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover { box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Een uitgeschakelde knop moet er ook echt uitgeschakeld uitzien; anders lijkt
   bijvoorbeeld "Top 3 opslaan" klikbaar terwijl dat nog niet kan. */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn-primary:disabled:hover { background: var(--primary); }
.btn-ghost:disabled:hover { background: transparent; }

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-ghost:hover { background: #f2f2f2; }

.btn-sm { padding: 8px 12px; font-size: 14px; }
.btn-block { width: 100%; }

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  font: inherit;
  color: var(--ink);
}

.input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(34, 34, 34, 0.08);
}

.input-sm { width: 68px; padding: 7px 9px; text-align: center; }

.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
}

.hint {
  min-height: 18px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.hint[data-tone="warn"] { color: #b45309; font-weight: 600; }

/* ---------- 2. Scherm 1: naam invoeren ---------------------------------- */

.screen { min-height: 100%; }
.screen[hidden] { display: none; }
/* De app krijgt programmatisch focus na het kiezen van een naam; dat hoeft
   geen zichtbare focusring op de hele pagina op te leveren. */
#screen-app:focus { outline: none; }

.screen-name {
  display: grid;
  place-items: center;
  padding: 24px 16px 40px;
  background: linear-gradient(180deg, #fff5f7 0%, var(--bg) 55%);
}

.name-wrap {
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}

.hero { display: flex; flex-direction: column; gap: 10px; }
.hero-emoji { font-size: 56px; line-height: 1; }
.hero-title { font-size: 30px; letter-spacing: -0.5px; }
.hero-sub { color: var(--muted); font-size: 15px; }

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.name-card { text-align: left; display: flex; flex-direction: column; gap: 10px; }

.name-title { font-size: 18px; }
.name-sub { font-size: 13px; }
.name-back { align-self: center; }

/* De namenlijst: iedereen kiest zijn/haar eigen naam. */
.name-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.name-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--card);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
}

.name-option:hover { border-color: var(--ink); box-shadow: var(--shadow-sm); }
.name-option:active { transform: scale(0.99); }
.name-option:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.name-option.is-me { border-color: var(--primary); background: #fff7f9; }

.name-option-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.name-option-name { font-size: 14px; font-weight: 700; }
.name-option-tag { font-size: 11px; color: var(--muted); }

.name-option-tag[data-tag="ready"] { color: var(--green); font-weight: 600; }
.name-option-tag[data-tag="unsure"] { color: var(--maybe-ink); font-weight: 600; }
.name-option-tag[data-tag="declined"] { color: var(--red-ink); font-weight: 600; }

.name-option-check { color: var(--primary); font-weight: 800; opacity: 0; }
.name-option.is-me .name-option-check { opacity: 1; }

/* Het kwastje boven de kalender: ik kan (groen) / weet nog niet (geel) /
   kan niet (rood). */
.brush {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 2px 0 14px;
}

.brush-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--card);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.brush-btn:hover { border-color: var(--ink); }
.brush-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.brush-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--card);
}

.brush-btn[data-brush="yes"] .brush-dot { background: var(--green); border-color: var(--green); }
.brush-btn[data-brush="maybe"] .brush-dot { background: var(--maybe); border-color: var(--maybe); }
.brush-btn[data-brush="no"] .brush-dot { background: var(--red); border-color: var(--red); }
/* De grijze kwast ("wissen") heeft een leeg rondje met een rand. */
.brush-btn[data-brush="clear"] .brush-dot { background: var(--card); border-color: var(--muted); }

.brush-btn.is-active { border-color: var(--ink); background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }
.brush-btn[data-brush="yes"].is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}
.brush-btn[data-brush="maybe"].is-active {
  border-color: var(--maybe);
  background: var(--maybe-soft);
  color: var(--maybe-ink);
}
.brush-btn[data-brush="no"].is-active {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red-ink);
}
.brush-btn[data-brush="clear"].is-active {
  border-color: var(--muted);
  background: var(--bg);
  color: var(--ink);
}

/* ---------- 3. Appbalk, groep, tabs ------------------------------------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}

.appbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { font-size: 26px; }

.appbar-titles { display: flex; flex-direction: column; min-width: 0; }

.appbar-title {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appbar-sub { font-size: 12px; color: var(--muted); }

.appbar-right { display: flex; align-items: center; gap: 8px; }

.badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-demo { background: #fff4d6; color: #8a6100; border: 1px solid #ffe2a8; }

.avatar {
  --avatar-color: #888888;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--avatar-color);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  user-select: none;
}

.avatar-sm { width: 26px; height: 26px; font-size: 11px; }

.avatar.is-pending {
  background: #ffffff;
  color: var(--avatar-color);
  box-shadow: inset 0 0 0 2px var(--avatar-color);
}

.group-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--muted);
}

.group-avatars { display: flex; align-items: center; }
.group-avatars .avatar { margin-left: -8px; border: 2px solid var(--card); }
.group-avatars .avatar:first-child { margin-left: 0; }

.group-more {
  margin-left: -8px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--card);
  font-weight: 700;
  color: var(--ink-soft);
}

.group-empty { font-style: italic; }

.tabs {
  position: sticky;
  /* Precies onder de appbalk; app.js meet de echte hoogte. */
  top: var(--appbar-h, 57px);
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 6px 16px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}

.tab {
  position: relative;
  padding: 12px 14px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab:hover { color: var(--ink); }
.tab:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.tab-dot {
  position: absolute;
  top: 10px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* ---------- 3b. Fasebalk ------------------------------------------------ */

.phase-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: linear-gradient(90deg, #fff7f9, var(--card) 55%);
  border-bottom: 1px solid var(--line-soft);
}

.phase-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.phase-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.phase-step:hover:not(.is-current):not(:disabled) { border-color: var(--ink); color: var(--ink); }
.phase-step:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.phase-step-num {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  flex: none;
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.phase-step.is-done {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.phase-step.is-done .phase-step-num { background: var(--green); color: #fff; }

.phase-step.is-current {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.phase-step.is-current .phase-step-num { background: rgba(255, 255, 255, 0.2); color: #ffffff; }

.phase-step.is-locked { opacity: 0.55; cursor: not-allowed; background: transparent; }

.phase-arrow { color: var(--muted); font-size: 12px; }

.phase-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.phase-now { font-size: 12px; font-weight: 600; color: var(--muted); }
.phase-admin-btn { background: var(--card); }

.phase-dialog-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13px;
}

.phase-dialog-badge {
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  background: #fff0f3;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.phase-dialog-actions { flex-wrap: wrap; }
#phase-error:empty { display: none; }

/* ---------- 3c. Fase 2: villa's ---------------------------------------- */

.villa-list { display: flex; flex-direction: column; gap: 22px; }

.villa-summary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--ink-soft);
}

.villa-summary-sep { color: var(--line); margin: 0 4px; }

/* Instelling: aantal gasten waarop alle villa-prijzen worden berekend. */
.villa-guest-setting {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.villa-guest-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.villa-guest-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.villa-guest-input { width: 72px; text-align: center; }
.villa-guest-hint { flex-basis: 100%; }
.villa-guest-error { margin: 0; }
.villa-guest-error:empty { display: none; }

.villa-admin-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.villa-admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.villa-admin-label {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

#villas-root { display: flex; flex-direction: column; gap: 16px; }

.villa-map-card { padding-bottom: 14px; }
.villa-map-sub { margin: 6px 0 0; max-width: 62ch; font-size: 13px; }

.villa-map-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.villa-map-style {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--bg);
}

.villa-map-style-btn {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.villa-map-style-btn:hover { color: var(--ink); }

.villa-map-style-btn.is-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.villa-map {
  height: 340px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--bg);
}

.villa-map.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.villa-map-empty {
  max-width: 44ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.villa-map-popup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  line-height: 1.35;
}

.villa-map-popup strong { font-size: 14px; }
.villa-map-popup a { margin-top: 3px; font-weight: 700; color: var(--primary-dark); }

.villa-map .leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.2);
}

.villa-map .leaflet-popup-content { margin: 12px 14px; }
.villa-map .leaflet-popup-tip { box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12); }

.villa-map .leaflet-control-zoom a {
  color: var(--ink);
  border-radius: 8px;
}

.villa-map .leaflet-control-attribution {
  border-radius: 6px 0 0 0;
  background: rgba(255, 255, 255, 0.82);
  font-size: 10px;
}

.villa-map-photo-wrap { background: transparent; border: 0; }
.villa-map-photo-wrap:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 12px;
}

.villa-map-photo-marker {
  position: relative;
  display: block;
  width: 96px;
  padding-bottom: 6px;
  cursor: pointer;
}

.villa-map-photo-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 3px solid #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
  transform-origin: 50% 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.villa-map-photo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 64px;
  overflow: hidden;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.villa-map-photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.villa-map-photo-empty {
  font-size: 26px;
  line-height: 1;
  opacity: 0.7;
}

.villa-map-photo-price {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 4px;
  border-top: 1px solid var(--line-soft);
  background: var(--card);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.villa-map-photo-tail {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid #ffffff;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.2));
}

.villa-map-photo-wrap:hover .villa-map-photo-card,
.villa-map-photo-wrap:focus-visible .villa-map-photo-card {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.38);
}

.villa-map-button { align-self: flex-start; margin-top: 8px; }

.villa-location-status { display: block; margin-top: -2px; }
.villa-location-status[data-tone="ok"] { color: var(--green); }
.villa-location-status[data-tone="warn"] { color: var(--primary-dark); }

.villa-country { display: flex; flex-direction: column; gap: 16px; }
.villa-country + .villa-country {
  margin-top: 10px;
  padding-top: 22px;
  border-top: 2px solid var(--line);
}

/* Landenkop als duidelijke band, zodat je ziet wanneer er een nieuw land begint. */
.villa-country-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.villa-country-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.villa-country-name { font-size: 22px; letter-spacing: -0.3px; }
.villa-add-btn { flex: none; }

/* Stedenkop blijft onder de tabs plakken, met het land erbij. Zo zie je tijdens
   het scrollen altijd in welk land en welke stad je zit. */
.villa-group-head {
  position: sticky;
  top: calc(var(--appbar-h, 57px) + var(--tabs-h, 49px));
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.villa-group-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.villa-group-country {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.villa-city { font-size: 18px; }
.villa-city-sep { color: var(--line); margin: 0 1px; }
.villa-city-count { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }

.villa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.villa-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.villa-photo {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f3e7ea, #e9eef0);
}

.villa-photo-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #f3e7ea, #e9eef0);
}

/* Alleen bij meerdere foto's: horizontaal vegen zelf afhandelen, verticaal
   scrollen en knijpzoomen gewoon aan de browser laten. */
.villa-photo-frame.has-gallery {
  touch-action: pan-y pinch-zoom;
  user-select: none;
  cursor: grab;
}

.villa-photo-frame.has-gallery:active { cursor: grabbing; }

.villa-photo-frame.is-dragging .villa-photo-img,
.villa-photo-frame.is-animating .villa-photo-img { will-change: transform; }

.villa-photo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

/* De inkomende foto tijdens het vegen, bovenop de huidige foto. */
.villa-photo-clone {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.villa-photo-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.15s ease, opacity 0.15s ease;
}

.villa-photo-nav:hover { background: rgba(0, 0, 0, 0.75); }
.villa-photo-nav:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.45);
}
.villa-photo-nav.is-prev { left: 10px; }
.villa-photo-nav.is-next { right: 10px; }
.villa-photo-frame.is-animating .villa-photo-nav {
  opacity: 0.5;
  pointer-events: none;
}

.villa-photo-count {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.villa-gallery {
  display: flex;
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
  background: var(--card);
  scrollbar-width: thin;
}

.villa-gallery-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.villa-gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.villa-gallery-thumb:hover { opacity: 1; }
.villa-gallery-thumb.is-active { border-color: var(--green); opacity: 1; }
.villa-gallery-thumb:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.villa-photo-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.villa-photo-empty span:first-child { font-size: 30px; line-height: 1; }

.villa-price {
  position: absolute;
  z-index: 2;
  left: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.villa-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 9px;
  padding: 14px;
}

.villa-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Land en stad ook op de kaart zelf, zodat je niet terug hoeft te scrollen. */
.villa-location {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 5px;
  padding: 2px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--bg);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.villa-location-country { color: var(--primary-dark); }
.villa-location-sep { color: var(--line); }
.villa-location-city { color: var(--ink-soft); }

.villa-name { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.villa-author { margin-top: 2px; font-size: 12px; color: var(--muted); }
.villa-desc { font-size: 14px; color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }

.villa-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff0f3;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.villa-link:hover { background: #ffe3e9; }
.villa-link.is-broken { background: var(--bg); color: var(--muted); }

.villa-distance { font-size: 12px; font-weight: 600; color: var(--ink-soft); }

.villa-cost-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #fcfcfc;
}

.villa-cost-preview-main { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }
.villa-cost-rate { font-size: 17px; font-weight: 800; color: var(--green); }
.villa-cost-rate-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.villa-cost-meta { flex-basis: 100%; font-size: 11px; color: var(--muted); }

.villa-cost-remainder {
  font-size: 12px;
  color: var(--maybe-ink);
  background: var(--maybe-soft);
  border: 1px solid var(--maybe-line);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
}

.villa-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.vote-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: var(--bg);
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.vote-btn:hover:not(.is-active) { background: var(--card); }
.vote-btn[data-vote-value="1"].is-active { background: var(--green); color: #ffffff; }
.vote-btn[data-vote-value="-1"].is-active { background: var(--red); color: #ffffff; }
.vote-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.vote-count { font-size: 12px; opacity: 0.9; }

.vote-net {
  min-width: 24px;
  padding: 0 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.vote-net.is-positive { color: var(--green); }
.vote-net.is-negative { color: var(--red-ink); }

.villa-comment-count { font-size: 12px; font-weight: 600; color: var(--muted); }
.villa-owner-actions { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.villa-delete { color: var(--red-ink); }

.villa-comments {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.villa-comments-list { display: flex; flex-direction: column; gap: 10px; }
.villa-comments-empty { font-size: 12px; color: var(--muted); font-style: italic; }

.villa-comment { display: flex; align-items: flex-start; gap: 8px; }

.villa-comment-body {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.villa-comment-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.villa-comment-head strong { font-size: 13px; }
.villa-comment-head .muted { margin-left: auto; font-size: 11px; }
.villa-comment-text { margin-top: 3px; font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }

.comment-delete {
  padding: 0 3px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.comment-delete:hover { background: var(--red-soft); color: var(--red-ink); }

.villa-comment-form { display: flex; flex-direction: column; gap: 6px; }
.villa-comment-form .input { padding: 8px 10px; font-size: 13px; }
.villa-comment-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Formulier in de villa-dialoog */

.villa-dialog { width: min(560px, 94vw); max-height: 92vh; overflow: auto; }
.villa-form { display: flex; flex-direction: column; gap: 12px; padding: 20px; }

.villa-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.villa-form-sub { margin-top: 3px; font-size: 12px; line-height: 1.45; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-soft);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.icon-btn:hover { background: var(--bg); }
.icon-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field .field-label { margin-bottom: 0; }
.field-hint { font-size: 12px; line-height: 1.45; color: var(--muted); }
.field-hint[data-tone="warn"] { color: #b45309; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid-price {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr) minmax(0, 0.8fr);
}

/* Kosten verdelen */

.villa-cost-dialog { width: min(720px, 96vw); max-height: 92vh; overflow: auto; }

.villa-cost-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.villa-cost-summary-main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.villa-cost-summary-main > span { display: flex; flex-direction: column; min-width: 0; }
.villa-cost-summary-main strong { font-size: 20px; line-height: 1.2; }
.villa-cost-summary-main small { font-size: 11px; color: var(--muted); }

.villa-cost-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 45vh;
  overflow: auto;
  padding-right: 4px;
}

.villa-cost-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto minmax(150px, 1.35fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.villa-cost-row:last-child { border-bottom: 0; }
.villa-cost-person { font-weight: 700; }
.villa-cost-nights-wrap { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }

.villa-cost-select {
  width: 72px;
  padding: 6px 8px;
  text-align: center;
  font-size: 13px;
}

.villa-cost-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
}

.villa-cost-person-total {
  min-width: 74px;
  text-align: right;
  font-size: 14px;
  white-space: nowrap;
}

.villa-cost-note {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
  font-size: 12px;
  line-height: 1.45;
}

/* Let op: er zijn nog geen nachten ingevuld, dus het restbedrag kan nog niet
   worden verdeeld. */
.villa-cost-note[data-tone="warn"] {
  background: var(--maybe-soft);
  border-color: var(--maybe-line);
  color: var(--maybe-ink);
}

.villa-cost-actions { flex-wrap: wrap; }
.villa-cost-actions [data-reset-costs] { margin-right: auto; }

.input-with-button { display: flex; align-items: center; gap: 8px; }
.input-with-button .input { flex: 1; min-width: 0; }
.input-with-button .btn { flex: none; }

.image-preview {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.image-preview img {
  display: block;
  width: 180px;
  max-width: 55%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

.photo-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.photo-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.photo-picker-grid {
  display: flex;
  gap: 8px;
  padding: 2px 2px 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.photo-option {
  position: relative;
  flex: 0 0 auto;
  width: 92px;
  height: 68px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  scroll-snap-align: start;
}

.photo-option img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-option:hover { border-color: var(--line); }
.photo-option.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.18);
}
.photo-option:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.photo-option-check {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.photo-option.is-selected .photo-option-check { display: flex; }

.content {
  max-width: 940px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.view { display: flex; flex-direction: column; gap: 16px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head-wrap { flex-wrap: wrap; }
.card-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.card-title { font-size: 17px; }
.card-sub { font-size: 13px; margin-top: 3px; }

/* Regel die vertelt over welke periode het gaat (1 juli t/m 31 augustus). */
.period-note {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.cal-footer { margin-top: 14px; }
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.bulk-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.bulk-hint:empty { display: none; }

.save-status {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}

.save-status[data-state="saved"] { color: var(--green); }
.save-status[data-state="error"] { color: #c0392b; }

.hint-card { background: #fffdf5; border-color: #f3e9c9; font-size: 14px; }

.notice {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: #fff8e6;
  border: 1px solid #f5e2b6;
  font-size: 14px;
  color: #6b4e00;
}

/* ---------- 4a. Kalender: stappenbalk -------------------------------- */
/* Legt uit dat je twee dagen tikt: eerst de eerste, dan de laatste. De
   regel onder de twee stappen laat live zien wat er komt te staan. */
.cal-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg);
  touch-action: manipulation;
}

.cal-steps-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.cal-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.cal-step-num {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.cal-step.is-active {
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.cal-step.is-active .cal-step-num { background: var(--ink); color: #ffffff; }

.cal-step.is-done {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}
.cal-step.is-done .cal-step-num { background: var(--green); color: #ffffff; }

.cal-step-arrow { color: var(--muted); font-size: 12px; }

.cal-step-cancel {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.cal-step-cancel:hover { border-color: var(--ink); color: var(--ink); }

.cal-step-hint { font-size: 12px; color: var(--muted); }
.cal-step-hint strong { color: var(--ink); font-weight: 700; }

/* ---------- 4b. Kalender: kop, weekdagen -------------------------------- */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.cal-title { font-size: 16px; font-weight: 700; text-transform: capitalize; }

.cal-nav {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

.cal-nav:hover:not(:disabled) { background: #f2f2f2; }
.cal-nav:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cal-nav:disabled { opacity: 0.35; cursor: not-allowed; }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

/* ---------- 4b. Kalender: dagen ---------------------------------------- */

.cal-grid { display: flex; flex-direction: column; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); }

.cal-day {
  position: relative;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.cal-day::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  right: 0;
  background: transparent;
}

.cal-day-inner {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 5px auto;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}

.cal-day:hover:not(.is-disabled) .cal-day-inner { background: var(--bg); }

/* Groen = "ik kan", geel = "weet nog niet", rood = "kan niet". */
.cal-day.is-selected::before { background: var(--green-soft); }
.cal-day.is-selected .cal-day-inner { background: var(--green); color: #ffffff; font-weight: 700; }
.cal-day.is-single::before { background: transparent; }
.cal-day.is-range-start::before { left: 50%; border-radius: 999px 0 0 999px; }
.cal-day.is-range-end::before { right: 50%; border-radius: 0 999px 999px 0; }

/* "Weet nog niet": zelfde vorm, maar geel. */
.cal-day.is-maybe::before { background: var(--maybe-soft); }
.cal-day.is-maybe .cal-day-inner {
  background: var(--maybe);
  color: var(--maybe-ink);
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--maybe-line);
}

/* "Kan niet": zelfde vorm, maar rood. Die blijft rood staan tot je hem met de
   grijze kwast "Wissen" weer weghaalt. */
.cal-day.is-no::before { background: var(--red-soft); }
.cal-day.is-no .cal-day-inner {
  background: var(--red);
  color: #ffffff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--red-ink);
}

/* De dag die je als EERSTE hebt getikt, wacht op de tweede tik: badge "1" en
   een dikke ring eromheen, zodat je altijd ziet waar de periode begint. */
.cal-day.is-start .cal-day-inner {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  animation: cal-start-pulse 1.7s ease-in-out infinite;
}

/* De dag waar de periode nu zou eindigen (onder de muis of je vinger):
   badge "2" en een gestippelde ring. */
.cal-day.is-preview-end .cal-day-inner {
  outline: 2px dashed var(--primary);
  outline-offset: 2px;
}

.cal-day-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.cal-day.is-preview-end .cal-day-badge { background: var(--primary); }

/* Met de rode kwast worden de dagen "kan niet": laat alvast zien wat er rood
   wordt (lichtrood vlak met een rode rand). */
.cal-day.is-preview-no::before { background: var(--red-soft); }
.cal-day.is-preview-no .cal-day-inner {
  background: var(--red-soft);
  color: var(--red-ink);
  box-shadow: inset 0 0 0 2px var(--red);
}
.cal-day.is-preview-no.is-preview-end .cal-day-inner { outline-color: var(--red); }

/* Met de grijze kwast verdwijnt de dag: laat zien wat er weggaat. */
.cal-day.is-preview-clear::before { background: var(--bg); }
.cal-day.is-preview-clear .cal-day-inner {
  background: transparent;
  color: var(--muted);
  text-decoration: line-through;
  box-shadow: inset 0 0 0 1.5px var(--line);
}

@keyframes cal-start-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.cal-day.is-today .cal-day-inner { box-shadow: inset 0 0 0 1.5px var(--line); }
.cal-day.is-today.is-selected .cal-day-inner { box-shadow: none; }

.cal-day.is-disabled { color: #c9c9c9; cursor: not-allowed; }
.cal-day.is-disabled .cal-day-inner { background: transparent; }
.cal-day.is-disabled::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 1px;
  background: #dcdcdc;
  transform: translate(-50%, -50%) rotate(-20deg);
  z-index: 2;
}

.cal-day.is-outside { opacity: 0.3; }
.cal-day:focus-visible .cal-day-inner { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- 4c. Periode-chips ------------------------------------------ */

.cal-periods { margin-top: 16px; }

.cal-empty { font-size: 13px; color: var(--muted); }

.period-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.period-total { font-weight: 700; }
.period-count { color: var(--muted); }

.period-head-maybe { margin-top: 12px; }
.period-total.is-maybe { color: var(--maybe-ink); }

.period-list { display: flex; flex-wrap: wrap; gap: 8px; }

.period-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  font-size: 13px;
}

.period-chip-text { font-weight: 600; white-space: nowrap; }
.period-chip-days { color: var(--muted); }

.period-chip-remove {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #e6e6e6;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.period-chip-remove:hover { background: var(--primary); color: #fff; }

/* Periode-chips van "weet nog niet". */
.period-chip.is-maybe {
  background: var(--maybe-soft);
  border-color: var(--maybe-line);
}

.period-chip.is-maybe .period-chip-remove { background: var(--maybe-line); }
.period-chip.is-maybe .period-chip-remove:hover { background: var(--maybe); }

/* Periode-chips van "kan niet" (rood). */
.period-head-no { margin-top: 12px; }
.period-total.is-no { color: var(--red-ink); }

.period-chip.is-no {
  background: var(--red-soft);
  border-color: var(--red-line);
}

.period-chip.is-no .period-chip-remove { background: var(--red-line); }
.period-chip.is-no .period-chip-remove:hover { background: var(--red); }

/* ---------- 4d. Heatmap (overzicht) ------------------------------------ */

.heat-grid { display: flex; flex-direction: column; gap: 4px; }

.heat-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 56px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}

.heat-day.has-data { color: var(--ink); }
.heat-day:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.heat-day:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.heat-day.is-outside { opacity: 0; pointer-events: none; }
.heat-day.is-today { border-color: var(--ink); }
.heat-day.is-selected { box-shadow: inset 0 0 0 2px var(--ink); }
.heat-day.is-full.has-data { border-color: var(--green); }

.heat-day.is-none.has-data {
  background: repeating-linear-gradient(
    135deg,
    #f1f3f5 0 5px,
    #e9ecef 5px 10px
  ) !important;
  color: var(--muted) !important;
}

.heat-num { font-size: 11px; font-weight: 600; opacity: 0.7; }
.heat-count { font-size: 15px; font-weight: 800; }

.heat-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.heat-legend-scale { display: flex; }

.heat-legend-scale i {
  width: 22px;
  height: 12px;
}

.heat-legend-scale i:first-child { border-radius: 999px 0 0 999px; }
.heat-legend-scale i:last-child { border-radius: 0 999px 999px 0; }
.heat-legend-label { font-weight: 700; color: var(--ink-soft); }

.heat-legend-maybe { display: inline-flex; align-items: center; gap: 5px; }

.heat-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--maybe);
}

/* Kleine oranje teller in een heatmap-vak: zoveel mensen weten het nog niet. */
.heat-maybe {
  font-size: 10px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--maybe-soft);
  color: var(--maybe-ink);
}

.heat-day.has-maybe:not(.has-data) { border-color: var(--maybe-line); }

/* ---------- 5a. Statistieken -------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-num { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 13px; font-weight: 600; }
.stat-sub { font-size: 12px; color: var(--muted); }

/* ---------- 5b. Beste periodes ----------------------------------------- */

.window {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
}

.window + .window { margin-top: 10px; }

.window.is-best { background: var(--green-soft); border-color: var(--green-line); }

.window-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
}

.window.is-best .window-rank { background: var(--green); color: #fff; border-color: var(--green); }

.window-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.window-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.window-dates { font-size: 15px; font-weight: 700; }
.window-meta { font-size: 12px; color: var(--muted); }

/* Tellingen van de weging: twijfeldagen (geel) wegen lichter dan harde nee's (rood). */
.window-meta .is-maybe { color: var(--maybe-ink); font-weight: 700; }
.window-meta .is-no { color: var(--red-ink); font-weight: 700; }

/* Uitleg onder de periodes: kan = 1, weet nog niet = ½, kan niet = 0. */
.window-legend { margin: 12px 2px 0; font-size: 12px; line-height: 1.5; }

/* Meer of minder periodekaarten bekijken: je ziet standaard de beste drie en
   haalt er met de knop telkens twee alternatieven bij. */
.window-more {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 2px 0;
}

.window-more .tiny { margin-left: 2px; }

.window-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
}

.window-badge.is-perfect { background: var(--green); color: #fff; border-color: var(--green); }
.window-badge.is-good { background: #fff8e6; border-color: #f5e2b6; color: #6b4e00; }
.window-badge.is-bad { background: var(--red-soft); border-color: var(--red-line); color: var(--red-ink); }

.window-people { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }

.people-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.people-label {
  flex: none;
  min-width: 104px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

.people-label.is-no { color: var(--red-ink); }
.people-label.is-maybe { color: var(--maybe-ink); }
.people-label.is-partial { color: var(--ink-soft); }

/* Wie nog een deel van de periode kan: er zijn dagen die hij/zij niet kan.
   Iets minder hard dan "kan 0 dagen", maar wel met rood erin. */
.people-label.is-partly { color: var(--red-ink); }

/* Wie een deel van de periode nog niet weet: er zijn dagen waarop het antwoord
   nog "weet nog niet" is, terwijl de rest al zeker kan. Zelfde kleur als "weet
   nog niet"; het verschil zit in het aantal dagen dat nog openligt. */
.people-label.is-partly-maybe { color: var(--maybe-ink); }

/* Iemand die maar een deel van de vakantie meegaat (later komen of eerder weg).
   De chip laat meteen zien welk aaneengesloten blok diegene er is. */
.chip-partial {
  border-style: dashed;
  background: var(--bg);
}

.chip-days {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.chip-x {
  margin-left: 2px;
  padding: 0 4px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.chip-x:hover { background: var(--bg); color: var(--ink); }
.chip-x:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* Wie gaat een deel mee? Instelling boven de beste periodes. */
.partial-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 13px;
}

.partial-tools select.input-sm {
  width: auto;
  min-width: 132px;
  text-align: left;
}

.partial-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.partial-list:empty { display: none; }
.partial-note { margin: -4px 0 14px; }

/* ---------- 5c. Chips (namen) ------------------------------------------ */

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  --chip-color: #888;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.chip-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--chip-color);
}

.chip-no {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--muted);
}

.chip-no .chip-dot { background: var(--red); }

/* Chip voor wie maar een deel van de periode kan: de naam met daarnaast hoeveel
   dagen er niet kunnen (bijv. "Lotte kan 1 dag niet"). */
.chip-partly {
  background: var(--red-soft);
  border-color: var(--red-line);
  color: var(--red-ink);
}

.chip-partly .chip-dot { background: var(--red); }
.chip-partly .chip-days { color: inherit; opacity: 0.85; }

/* Chip voor wie een deel van de periode nog niet weet: dezelfde vorm als "kan
   een deel", maar in de kleur van "weet nog niet". */
.chip-partly-maybe {
  background: var(--maybe-soft);
  border-color: var(--maybe-line);
  color: var(--maybe-ink);
}

.chip-partly-maybe .chip-dot { background: var(--maybe); }
.chip-partly-maybe .chip-days { color: inherit; opacity: 0.85; }

/* Chip voor iemand die het nog niet weet. */
.chip-maybe {
  background: var(--maybe-soft);
  border-color: var(--maybe-line);
  color: var(--maybe-ink);
}

.chip-maybe .chip-dot { background: var(--maybe); }
.chips-maybe { opacity: 0.95; }

.chips-none { color: var(--muted); font-size: 13px; }
.chips-no { opacity: 0.9; }

/* ---------- 5d. Check een periode -------------------------------------- */
/* Zelf een reeks dagen kiezen: wie kan die dagen, wie twijfelt en wie niet. */

.range-tools { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }

.input-date { width: auto; min-width: 158px; padding: 8px 10px; text-align: left; }

.range-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 2px 2px 0;
}

.range-title { font-size: 15px; }

.range-count {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

.range-count.is-perfect { background: var(--green); color: #fff; border-color: var(--green); }
.range-count.is-good { background: #fff8e6; border-color: #f5e2b6; color: #6b4e00; }
.range-count.is-bad { background: var(--red-soft); border-color: var(--red-line); color: var(--red-ink); }

.range-meta { margin: 4px 2px 10px; font-size: 12px; color: var(--muted); }
.range-meta .is-maybe { color: var(--maybe-ink); font-weight: 700; }
.range-meta .is-no { color: var(--red-ink); font-weight: 700; }

.range-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

.range-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.range-item { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.range-days { font-size: 12px; color: var(--muted); }

.window-actions { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ---------- 5d. Detail van één dag ------------------------------------- */

.day-detail { margin-top: 16px; }

.dd-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dd-title { font-size: 15px; text-transform: capitalize; }

.dd-count {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

.dd-count.is-perfect { background: var(--green); color: #fff; }

.dd-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.dd-col {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--line-soft);
}

.dd-col-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-bottom: 8px;
}

.dd-col-title.is-yes { color: var(--green); }
.dd-col-title.is-maybe { color: var(--maybe-ink); }
.dd-col-title.is-no { color: var(--red-ink); }
.dd-col-title.is-partly { color: var(--red-ink); }
.dd-col-title.is-partly-maybe { color: var(--maybe-ink); }
.dd-col-title.is-partial { color: var(--ink-soft); }

.dd-maybe { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--maybe-ink); }
.dd-no { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--red-ink); }
.dd-note { margin-top: 10px; font-size: 13px; }

/* ---------- 5e. Alle dagen op een rij ---------------------------------- */

.daytable { max-height: 560px; overflow: auto; }

.dayrow { padding: 10px 4px; border-bottom: 1px solid var(--line-soft); }
.dayrow:last-child { border-bottom: 0; }

.dayrow-head { display: flex; align-items: center; gap: 10px; }

.dayrow-date {
  flex: none;
  min-width: 92px;
  font-size: 14px;
  font-weight: 600;
  text-transform: capitalize;
}

.bar-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #ededed;
  overflow: hidden;
}

.bar-fill { display: block; height: 100%; border-radius: 999px; }

.dayrow-count {
  flex: none;
  min-width: 46px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.dayrow-people {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.mini-label {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--green);
}

.mini-label.is-no { color: var(--red-ink); }
.mini-label.is-maybe { color: var(--maybe-ink); }
.mini-label.is-blank { color: var(--muted); }

/* ---------- 5f. Wie doen er mee ---------------------------------------- */

.people { display: flex; flex-direction: column; }

.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.person:last-child { border-bottom: 0; }
.person.is-pending { opacity: 0.62; }
.person-body { flex: 1; min-width: 0; }
.person-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.person-dates { font-size: 12px; color: var(--muted); }

.you-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.maybe-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--maybe-soft);
  border: 1px solid var(--maybe-line);
  color: var(--maybe-ink);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.no-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--red-soft);
  border: 1px solid var(--red-line);
  color: var(--red-ink);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

/* Iemand die maar een deel van de vakantie meegaat. */
.part-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

/* ---------- 5h. Banner: je had je dagen al ingevuld --------------------- */

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #cbe8d4;
  border-radius: var(--radius);
  background: var(--green-soft);
  box-shadow: var(--shadow-sm);
}

.banner-emoji { font-size: 22px; line-height: 1; }
.banner-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.banner-title { font-size: 15px; }
.banner-text { font-size: 13px; }

.person-count { flex: none; font-size: 13px; font-weight: 700; color: var(--ink-soft); }

/* ---------- 5g. Lege staat --------------------------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty-emoji { font-size: 34px; line-height: 1; }
.empty-title { font-size: 16px; }
.empty .chips { justify-content: center; }

/* ---------- 6a. Kleine instellingen in de kaartkop --------------------- */

.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  overflow: hidden;
}

.segmented button {
  padding: 6px 12px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.segmented button.is-active { background: var(--ink); color: #ffffff; }
.segmented button:hover:not(.is-active) { background: var(--bg); }
.segmented button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

/* ---------- 6b. Accountmenu -------------------------------------------- */

.menu {
  position: fixed;
  top: calc(var(--appbar-h, 57px) + 6px);
  right: 12px;
  z-index: 60;
  width: min(300px, calc(100vw - 24px));
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}

.menu-name { font-size: 14px; font-weight: 700; }
.menu-sub { font-size: 12px; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover { background: var(--bg); }
.menu-item:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.menu-sep { height: 1px; background: var(--line-soft); margin: 6px 0; }

.menu-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px 4px;
  font-size: 12px;
}

.menu-info-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.menu-info-row code {
  max-width: 170px;
  text-align: right;
  overflow-wrap: anywhere;
}

/* ---------- 6c. Dialoog (naam wijzigen) -------------------------------- */

.dialog {
  width: min(420px, 92vw);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.dialog::backdrop { background: rgba(0, 0, 0, 0.4); }

.dialog-form { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.dialog-title { font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ---------- 6d. Toastjes ---------------------------------------------- */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 14px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.22s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.is-error { background: #9b2c2c; }
.toast.is-out { opacity: 0; transform: translateY(8px); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 6b. Fase 3: top 3 en ranking ------------------------------ */

#ranking-root { display: flex; flex-direction: column; gap: 16px; }

.ranking-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.ranking-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
}

.ranking-legend-item strong { color: var(--ink); }

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ranking-card-title { margin: 0 0 6px; font-size: 18px; }
.ranking-form-note { margin: 0 0 13px; font-size: 13px; line-height: 1.5; }
.ranking-form { display: flex; flex-direction: column; gap: 10px; }

.rank-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--bg);
}

.rank-slot-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rank-slot-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: var(--muted);
}

.rank-slot.has-villa { background: var(--card); }
.rank-slot-content { display: block; min-width: 0; }

.rank-slot-empty {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  color: var(--muted);
  font-size: 13px;
}

.rank-slot-plus {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.rank-slot-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.rank-slot-thumb {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--bg);
}

.rank-slot-thumb img,
.rank-choice-thumb img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-slot-thumb-empty { font-size: 19px; line-height: 1; }

.rank-slot-villa {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.rank-slot-villa strong,
.rank-slot-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-slot-villa strong { font-size: 13px; line-height: 1.25; }
.rank-slot-meta { color: var(--muted); font-size: 10.5px; }
.rank-slot-price { color: var(--primary-dark); font-size: 11px; font-weight: 800; }

.rank-slot-clear {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.rank-slot-clear:hover { color: var(--red); border-color: var(--red-line); }

.rank-picker {
  margin-top: 3px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--bg);
}

.rank-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--card);
}

.rank-picker-head strong { font-size: 12px; }
.rank-picker-head .muted { font-size: 11px; }

.rank-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rank-picker-empty {
  padding: 12px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.rank-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--card);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.rank-choice.is-picked {
  border-color: #f2c9d3;
  background: #fff8fa;
}

.rank-choice-thumb {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--bg);
}

.rank-choice-thumb-empty { font-size: 20px; line-height: 1; }

.rank-choice-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rank-choice-title,
.rank-choice-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-choice-title { font-size: 13px; line-height: 1.25; }
.rank-choice-meta { color: var(--muted); font-size: 10.5px; }
.rank-choice-price { color: var(--primary-dark); font-size: 11px; font-weight: 800; }

.rank-choice-actions { flex: none; display: flex; gap: 4px; }

.rank-choice-btn {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rank-choice-btn:hover { color: var(--ink); border-color: var(--line); }
.rank-choice-btn.is-active { border-color: transparent; }
.rank-choice-btn-1.is-active { background: #f1d27a; color: #6b4700; }
.rank-choice-btn-2.is-active { background: #cfd8e3; color: #334155; }
.rank-choice-btn-3.is-active { background: #e8c1a5; color: #6b3a17; }

.rank-choice-btn:focus-visible,
.rank-slot-clear:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.rank-slot-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--line-soft);
}

.rank-slot-1 .rank-slot-badge {
  background: #fff2c6;
  border-color: #f1d27a;
  color: #8a5a00;
}

.rank-slot-2 .rank-slot-badge {
  background: #f1f5f9;
  border-color: #cfd8e3;
  color: #475569;
}

.rank-slot-3 .rank-slot-badge {
  background: #fff0e5;
  border-color: #e8c1a5;
  color: #8b4513;
}

.rank-slot-points {
  flex: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ranking-save { width: 100%; margin-top: 3px; }
.ranking-result-sub { margin: 6px 0 0; font-size: 13px; }
.ranking-result { margin-top: 14px; }

.ranking-winner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #f0d58a;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff7db, #fffdf4);
}

.ranking-winner-icon { font-size: 28px; line-height: 1; }

.ranking-winner div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ranking-winner-label {
  color: #8a5a00;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.ranking-winner strong { font-size: 16px; }

.ranking-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 32px 16px;
  text-align: center;
}

.ranking-empty-icon { font-size: 30px; line-height: 1; }
.ranking-empty p { margin: 0; max-width: 44ch; font-size: 13px; }

.rank-row {
  display: grid;
  grid-template-columns: 36px 58px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--card);
}

.rank-row + .rank-row { margin-top: 10px; }

.rank-row.is-podium {
  background: linear-gradient(90deg, rgba(255, 247, 219, 0.75), var(--card) 62%);
}

.rank-pos-1 { border-color: #efd487; }
.rank-pos-2 { border-color: #cfd8e3; }
.rank-pos-3 { border-color: #e5c1a6; }

.rank-position {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.rank-pos-1 .rank-position { background: #ffe9a8; color: #7a4c00; }
.rank-pos-2 .rank-position { background: #e8eef5; color: #475569; }
.rank-pos-3 .rank-position { background: #ffe1cc; color: #8b4513; }

.rank-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg);
}

.rank-thumb-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rank-thumb-empty { font-size: 24px; }
.rank-main { min-width: 0; }

.rank-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.rank-title { margin: 0; font-size: 15px; line-height: 1.3; }
.rank-villa-link { color: inherit; text-decoration: none; }
.rank-villa-link:hover { text-decoration: underline; }

.rank-points {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff0f3;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.rank-meta { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.rank-breakdown { margin: 2px 0 0; color: var(--muted); font-size: 11px; }

.rank-voters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.rank-voter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 11px;
}

.rank-voter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--voter-color, var(--muted));
}

.rank-voter strong { color: var(--ink); }

@media (max-width: 900px) {
  .ranking-layout { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .rank-slot-points { display: none; }
  .rank-slot { gap: 8px; padding: 8px; }
  .rank-slot-thumb { width: 38px; height: 38px; }
  .rank-row { grid-template-columns: 30px 46px minmax(0, 1fr); gap: 9px; padding: 10px; }
  .rank-thumb { width: 46px; height: 46px; }
  .rank-position { width: 28px; height: 28px; font-size: 13px; }
  .rank-title-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .ranking-legend-item { font-size: 11px; }
  .rank-choice { gap: 7px; padding: 6px; }
  .rank-choice-thumb { width: 42px; height: 42px; }
  .rank-choice-btn { width: 28px; height: 28px; }
  .rank-picker-list { max-height: 320px; }
}

/* ---------- 7. Klein scherm ------------------------------------------- */

@media (max-width: 700px) {
  body { font-size: 15px; }
  .card { padding: 14px; }
  .content { padding: 12px; gap: 12px; }

  .hero-title { font-size: 26px; }
  .hero-emoji { font-size: 46px; }

  .cal-day { height: 46px; }
  .cal-day-inner { width: 38px; height: 38px; margin: 4px auto; font-size: 15px; }

  .cal-steps { padding: 8px 10px; }
  .cal-step { font-size: 11px; }
  .cal-step-hint { font-size: 11px; }

  .heat-day { height: 46px; border-radius: 8px; }
  .heat-num { font-size: 10px; }
  .heat-count { font-size: 13px; }
  .heat-legend-text { display: none; }

  .name-list { grid-template-columns: 1fr; }
  .banner { flex-wrap: wrap; }
  .banner-body { flex-basis: 100%; order: 2; }

  .dd-cols { grid-template-columns: 1fr; }
  .range-cols { grid-template-columns: 1fr; }
  .people-label { min-width: 100%; }
  .dayrow-date { min-width: 74px; font-size: 13px; }
  .window { padding: 12px; }
  .window-people .chips { gap: 4px; }

  .phase-bar { padding: 8px 12px; gap: 6px; }
  .phase-steps { width: 100%; }
  .phase-now { width: 100%; }
  .phase-side { width: 100%; margin-left: 0; justify-content: space-between; }
  .phase-step { font-size: 12px; }
  .villa-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid-price { grid-template-columns: 1fr; }
  .villa-form { padding: 16px; }
  .villa-form-head .villa-form-sub { max-width: 100%; }

  .villa-country-head, .villa-group-head { align-items: flex-start; }
  .villa-cost-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .villa-cost-breakdown {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .villa-cost-person-total { grid-column: 2; grid-row: 1; }
}

@media (max-width: 520px) {
  .appbar { padding: 8px 12px; }
  .appbar-sub { display: none; }
  .appbar-right { gap: 4px; }
  .appbar .btn-sm { padding: 6px 9px; font-size: 13px; }
  .group-strip { padding: 8px 12px; }
  .tabs { padding: 4px 12px 0; overflow-x: auto; }
  .tab { padding: 11px 11px; white-space: nowrap; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 12px; }
  .stat-num { font-size: 22px; }
  .person-count { display: none; }
  .input-with-button { flex-wrap: wrap; }
  .input-with-button .btn { width: 100%; }
  .image-preview { flex-wrap: wrap; }
  .image-preview img { width: 100%; max-width: 100%; max-height: 160px; }
  .villa-gallery-thumb { width: 54px; height: 42px; }
  .villa-photo-nav { width: 32px; height: 32px; font-size: 20px; }
  .villa-photo-nav.is-prev { left: 6px; }
  .villa-photo-nav.is-next { right: 6px; }
  .photo-option { width: 76px; height: 58px; }
  .phase-dialog-actions .btn { flex: 1 1 auto; }
  .villa-card-head { flex-direction: column; }
  .villa-owner-actions { align-self: flex-start; }
  .villa-map { height: 260px; }
  .villa-cost-summary-main { grid-template-columns: 1fr; }
  .villa-cost-summary-main strong { font-size: 18px; }
  .villa-cost-actions .btn { flex: 1 1 auto; }
  .villa-cost-actions [data-reset-costs] { margin-right: 0; }
}

@media (max-width: 460px) {
  #btn-excel .btn-text,
  #btn-share .btn-text,
  #btn-account .btn-text { display: none; }
  #btn-account { padding: 4px; }
  .phase-step-label { font-size: 11px; }
  .villa-dialog, .villa-cost-dialog {
    width: 100%;
    max-height: 94vh;
    border-radius: var(--radius) var(--radius) 0 0;
    margin: auto 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
