/* Luftbrücke look: warm, calm, playful. Soft wobbly blobs, no sharp boxes.
   Change colours and the font here; every page picks them up. */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #fbf3e8;          /* warm cream */
  --bg-deep: #f4e4d0;
  --surface: #fffaf3;
  --text: #3b2a2a;        /* deep warm brown instead of black */
  --muted: #8a7366;
  --line: #ecd9c4;
  --accent: #b5532f;      /* terracotta, for main buttons */
  --accent-text: #fffaf3;
  --danger: #b3261e;
  --ok: #3f7a4f;

  /* One colour per area of the app */
  --core: #f29e7f;        /* the main sphere */
  --calendar: #e8b04f;    /* mustard */
  --tasks: #86b89c;       /* sage */
  --contracts: #8fa9d4;   /* dusty blue */
  --feedback: #c4a0d4;    /* lavender */
  --members: #6fb3ae;     /* soft teal */
  --profile: #f0c39b;     /* sand */

  --font: "Fredoka", "Segoe UI", system-ui, sans-serif;
  --round: 28px;
  --shadow: 0 10px 30px -12px rgb(120 70 40 / .25);

}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  --tint: var(--calendar);
  --tint-2: var(--tasks);
  margin: 0; min-height: 100vh; color: var(--text);
  font: 17px/1.5 var(--font);
  background:
    radial-gradient(48rem 34rem at 0% 0%, color-mix(in srgb, var(--tint) 24%, transparent), transparent 70%),
    radial-gradient(40rem 30rem at 100% 100%, color-mix(in srgb, var(--tint-2) 18%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
/* Each area washes the page in its own colour */
body[data-area=calendar] { --tint: var(--calendar); --tint-2: var(--calendar); }
body[data-area=tasks] { --tint: var(--tasks); --tint-2: var(--tasks); }
body[data-area=members] { --tint: var(--members); --tint-2: var(--members); }
body[data-area=profile] { --tint: var(--profile); --tint-2: var(--profile); }

h1, h2, h3 { font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.9rem; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .25rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.loading { padding: 2rem; color: var(--muted); }

/* ---------- Round shapes (calm, no wobbling) ---------- */
.blob { border-radius: 50%; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding: .7rem 1rem; background: color-mix(in srgb, var(--surface) 80%, transparent);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 600; font-size: 1.1rem; color: var(--text); text-decoration: none;
}
.brand .dot { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--core); }
.menu { display: flex; gap: .2rem; flex: 1; }
.menu a {
  padding: .3rem .85rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500;
}
.menu a:hover { color: var(--text); background: var(--bg); }
.menu a.active { color: var(--text); background: color-mix(in srgb, var(--tint) 35%, var(--surface)); }
.who { display: flex; align-items: center; gap: .3rem; }
.pill {
  display: inline-flex; align-items: center; gap: .45rem; padding: .2rem .8rem .2rem .25rem;
  border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 500;
}
.pill:hover, .pill.active { background: var(--bg); }
.badge {
  display: inline-block; padding: .05rem .6rem; border-radius: 999px;
  background: var(--bg-deep); font-size: .8rem; font-weight: 500;
}

/* ---------- Pages ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: .5rem 1rem 3rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin: 1rem 0 1.25rem; }
.page-title { display: flex; align-items: center; gap: .75rem; margin: 0; }
.page-title .blob { width: 2.6rem; height: 2.6rem; background: var(--c, var(--core)); flex: none; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }

.card {
  background: var(--surface); border-radius: var(--round); padding: 1.4rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.card.narrow { width: 100%; max-width: 400px; }

/* ---------- Forms ---------- */
label { display: block; margin-bottom: 1rem; font-weight: 500; }
input, select {
  display: block; width: 100%; margin-top: .35rem; padding: .65rem .95rem;
  font: inherit; font-weight: 400; color: inherit; background: var(--bg);
  border: 2px solid transparent; border-radius: 18px;
}
input:disabled { color: var(--muted); }
input:focus, select:focus { outline: none; border-color: var(--core); background: var(--surface); }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
label.check input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--accent); }
.row { display: flex; gap: .5rem; align-items: center; }
.row input { flex: 1; }
.row .btn { margin-top: .35rem; white-space: nowrap; }

.btn {
  font: inherit; font-weight: 500; padding: .55rem 1.2rem; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); color: var(--text);
  transition: background .2s, border-color .2s;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--danger); border-color: currentColor; }
.btn.small { padding: .25rem .8rem; font-size: .9rem; }
.btn.link { border: none; background: none; color: var(--accent); padding: .25rem .5rem; }

.message { padding: .65rem 1rem; border-radius: 18px; margin: 0 0 1rem; }
.message.error { background: #fbe3dd; color: var(--danger); }
.message.ok { background: #e3f1e6; color: var(--ok); }

/* ---------- Login / first setup ---------- */
.welcome { display: grid; justify-items: center; gap: 1.25rem; width: 100%; max-width: 400px; }
.welcome .sphere {
  width: 150px; height: 150px; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 35% 30%, #f8c3ad, var(--core) 70%);
  font-weight: 600; font-size: 1.15rem; line-height: 1.15; box-shadow: var(--shadow);
}


/* ---------- Members list ---------- */
table.members { width: 100%; border-collapse: collapse; }
.members th { text-align: left; font-size: .8rem; font-weight: 500; letter-spacing: .04em; color: var(--muted); }
.members th, .members td { padding: .65rem .5rem; border-bottom: 2px dotted var(--line); }
.members tr:last-child td { border-bottom: none; }
.members tr.inactive td { color: var(--muted); }

/* ---------- Pop-up editor ---------- */
dialog {
  border: none; border-radius: 34px; padding: 0; color: var(--text); background: var(--surface);
  width: min(480px, calc(100vw - 2rem)); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgb(59 42 42 / .35); }
.dialog-form { padding: 1.5rem; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.spacer { flex: 1; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .brand span:last-child { display: none; }
  .members thead { display: none; }
  .members tr { display: block; padding: .6rem 0; border-bottom: 2px dotted var(--line); }
  .members tr:last-child { border-bottom: none; }
  .members td { display: flex; justify-content: space-between; gap: 1rem; border: none; padding: .2rem 0; }
  .members td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .85rem; }
}

/* Less movement for people who ask their device for it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* ---------- Notifications (My profile) ---------- */
.notify-device { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; padding: .7rem .9rem; border-radius: 22px; background: var(--bg); }
.notify-device .dot { width: 1.2rem; height: 1.2rem; background: var(--line); }
.notify-device.on .dot { background: var(--tasks); }
.notify-device > span:nth-child(2) { flex: 1; }
.notify-help { padding: .7rem .9rem; border-radius: 22px; background: #fbe8c8; margin: 0; }
.switches { display: grid; gap: .5rem; margin-bottom: 1rem; }
.switch { display: flex; align-items: center; gap: .8rem; margin: 0; font-weight: 400; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; }
.switch small { display: block; color: var(--muted); }
.track { flex: none; width: 3rem; height: 1.7rem; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; }
.knob { position: absolute; top: .2rem; left: .2rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 6px rgb(0 0 0 / .15); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.switch input:checked + .track { background: var(--tasks); }
.switch input:checked + .track .knob { transform: translateX(1.3rem); }
.switch input:focus-visible + .track { outline: 2px solid var(--core); outline-offset: 2px; }

/* ---------- Profiles and member pages ---------- */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
textarea {
  display: block; width: 100%; margin-top: .35rem; padding: .65rem .95rem; font: inherit; font-weight: 400;
  color: inherit; background: var(--bg); border: 2px solid transparent; border-radius: 18px; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--core); background: var(--surface); }
.counter { display: block; text-align: right; margin-top: .2rem; }

.avatar {
  display: inline-grid; place-items: center; flex: none; object-fit: cover;
  width: 2.4rem; height: 2.4rem; background: var(--profile); font-weight: 600; font-size: .85rem; color: var(--text);
}
.avatar.small { width: 2rem; height: 2rem; font-size: .75rem; }
.avatar.tiny { width: 1.8rem; height: 1.8rem; font-size: .65rem; }
.avatar.big { width: 6.5rem; height: 6.5rem; font-size: 1.8rem; }
.photo-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.photo-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.photo-actions label.btn, label.btn { display: inline-block; margin: 0; }

.member-link { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 500; }
.member-link:hover span { text-decoration: underline; }
.back { text-decoration: none; }
.member-head { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.member-head h1 { margin: 0 0 .2rem; }
.member-head p { margin: .2rem 0; }
.tagline { font-style: italic; }
.facts-list { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; overflow-wrap: anywhere; }
.admin-only { border: 2px dashed var(--line); }
.admin-only h2 .badge { font-weight: 500; margin-left: .3rem; vertical-align: middle; }
.timeline { background: var(--bg); border-radius: 22px; padding: .8rem 1rem; margin-bottom: 1rem; }
.stage { margin: 0 0 .4rem; }
.steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.steps li span { display: block; color: var(--muted); font-size: .85rem; }
.files { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.files li { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; background: var(--bg); border-radius: 18px; padding: .5rem .8rem; }
.file-icon { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; background: var(--contracts); }
.file-text { flex: 1; min-width: 10rem; }
.file-text small { display: block; }
.upload { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; }
.upload label:first-child { flex: 1; min-width: 14rem; margin: 0; }
.upload label.btn { margin: 0; }

@media (max-width: 640px) {
  .two { grid-template-columns: 1fr; }
  .members td .member-link { justify-content: flex-end; }
}

/* Narrow screens: brand and you on the first row, the menu on its own row below */
@media (max-width: 760px) {
  .topbar { gap: .4rem .8rem; }
  .menu { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
  .menu a { white-space: nowrap; }
  .who { margin-left: auto; }
}
@media (max-width: 480px) {
  .pill span:not(.avatar) { display: none; }
}

.private-head { margin: 1.4rem 0 .2rem; font-size: 1rem; }

.waiting-count { display: inline-grid; place-items: center; min-width: 1.2rem; height: 1.2rem; margin-left: .35rem; padding: 0 .3rem; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .7rem; font-weight: 600; }

/* ---------- Invite link and approvals (Members page) ---------- */
.invite-row input { margin: 0; font-size: .85rem; }
.invite h2, .waiting h2 { display: flex; align-items: center; gap: .3rem; }
.waiting { border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.waiting-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.waiting-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; padding: .6rem .8rem; border-radius: 18px; background: var(--bg); }
.who-waits { flex: 1; min-width: 12rem; }
.who-waits small { display: block; }
.waiting-list select { width: auto; margin: 0; padding: .35rem .8rem; border-radius: 999px; background: var(--surface); }

/* ---------- Feedback ---------- */
body[data-area=feedback] { --tint: var(--feedback); --tint-2: var(--feedback); }
.feedback-btn {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 30;
  padding: .45rem .9rem; border: none; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; font-weight: 500;
  box-shadow: 0 6px 18px -8px rgb(80 40 20 / .4); opacity: .85;
}
.feedback-btn:hover { opacity: 1; }
.feedback-form textarea { margin-bottom: .8rem; }
.feedback-form h3 { margin: 1.2rem 0 .4rem; font-size: 1rem; }
.fb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.fb-list li { background: var(--bg); border-radius: 18px; padding: .6rem .9rem; }
.fb-list small { display: block; }
.fb-text { margin: 0 0 .2rem; white-space: pre-wrap; }
.fb-result { margin: .4rem 0 0; font-size: .9rem; padding-left: .6rem; border-left: 3px solid var(--feedback); }
.fb-section summary { list-style: none; cursor: pointer; }
.fb-section summary::-webkit-details-marker { display: none; }
.fb-section summary h2 { display: flex; gap: .4rem; align-items: center; margin: 0; }
.fb-section[open] summary h2 { margin-bottom: .8rem; }
.fb-status { display: inline-block; margin-right: .4rem; padding: 0 .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--line); }
.fb-status.approved { background: #fbe3c2; }
.fb-status.done { background: #dcedc6; }
.fb-status.declined { background: var(--bg-deep); color: var(--muted); }
.fb-status.talk { background: #f4d6ef; }
@media (max-width: 640px) { .feedback-btn { right: .6rem; bottom: .6rem; } }

/* ---------- Booking rules (Members page, admins) ---------- */
.rules-card summary { list-style: none; cursor: pointer; }
.rules-card summary::-webkit-details-marker { display: none; }
.rules-card summary h2 { margin: 0; }
.rules-card summary h2::after { content: " ▾"; color: var(--muted); font-size: .9rem; }
.rules-card[open] summary h2 { margin-bottom: .8rem; }
.rules-hint { margin: 0 0 .6rem; }

/* ---------- Install prompt (phones, until installed) ---------- */
.install-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: .8rem; }
.install-card {
  display: grid; grid-template-columns: auto 1fr; gap: .4rem .8rem; align-items: start;
  max-width: 480px; margin: 0 auto; padding: 1rem; border-radius: 24px;
  background: var(--surface); box-shadow: 0 -6px 30px -8px rgb(80 40 20 / .35);
}
.install-icon { width: 3rem; height: 3rem; border-radius: 14px; }
.install-text { font-size: .95rem; }
.install-title { display: block; font-size: 1.05rem; margin-bottom: .2rem; }
.install-steps { margin: .3rem 0 0; padding-left: 1.2rem; }
.install-steps li { margin-bottom: .2rem; }
.install-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .5rem; }

.guest-list { margin: 0; padding-left: 1.2rem; }
.host-of { display: inline; }

/* ---------- Polls ---------- */
body[data-area=polls] { --tint: var(--feedback); --tint-2: var(--feedback); }
.poll h2 { margin-bottom: .2rem; }
.poll-options { display: grid; gap: .45rem; margin: .8rem 0 .4rem; }
.poll-option {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 .6rem;
  width: 100%; padding: .6rem .9rem; border-radius: 16px; border: 2px solid var(--line); background: var(--surface);
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.poll-option:disabled { cursor: default; }
.poll-option.chosen { border-color: var(--feedback); }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--feedback) 30%, transparent); transition: width .4s; }
.poll-label, .poll-count, .poll-who { position: relative; }
.poll-count { font-weight: 600; }
.poll-who { grid-column: 1 / -1; color: var(--muted); font-size: .78rem; }
.poll-inputs { display: grid; gap: .4rem; margin-bottom: .5rem; }
.poll-inputs input { margin: 0; }
.new-poll .btn.small { margin-bottom: 1rem; }

/* ---------- External bookings ---------- */
:root { --requests: #e89a9a; }
body[data-area=requests] { --tint: var(--requests); --tint-2: var(--requests); }
.welcome.wide { max-width: 680px; }
.request-form { width: 100%; }
.request-form fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.request-form legend { font-weight: 600; margin-bottom: .5rem; }
.request-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.request-form .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) { .request-form .two { grid-template-columns: 1fr; } }
.share-link .copy-row { display: flex; gap: .5rem; align-items: center; }
.share-link .copy-row input { margin: 0; flex: 1; min-width: 0; }
.request-head { display: flex; gap: .6rem; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.request-head h2 { margin: 0; }
.status-pill { font-size: .78rem; padding: .15rem .6rem; border-radius: 999px; background: var(--line); white-space: nowrap; }
.request.status-new .status-pill { background: var(--requests); color: #fff; }
.request.status-confirmed .status-pill { background: var(--ok); color: #fff; }
.request-text { white-space: pre-wrap; }
.request .facts-list { margin: .6rem 0 1rem; font-size: .92rem; }
.take-box { display: grid; gap: .35rem; justify-items: start; }
.contact-line { margin: 0 0 .4rem; }
.share-link p { margin-top: 0; }
