/* Kipdorp39 — "cozy kraft" stijl, 1-op-1 naar het goedgekeurde design */

:root {
  --bg: #FAF1DC;
  --bg-start: #FBF3E7;
  --card: #FFFBF2;
  --white: #fff;
  --ink: #3E2A1E;
  --ink-2: #7A6A57;
  --muted: #A0907A;
  --terracotta: #B14B34;
  --burgundy: #7A2E2E;
  --burgundy-2: #A63346;
  --mustard: #C68A2E;
  --cocoa: #5C3A28;
  --sage: #6B7A4F;
  --wood: #8C5A3C;
  --chip-bg: #F0DDB0;
  --chip-ink: #8A5A16;
  --note-bg: #F0E2C4;
  --dash: #D8C6A8;
  --divider: #E9D9B8;
  --bar-bg: #F0E2C4;
  --bar: #E3CBA0;

  --shadow: 0 8px 20px rgba(62, 42, 30, 0.08);
  --shadow-sm: 0 6px 16px rgba(62, 42, 30, 0.07);
  --shadow-xs: 0 4px 12px rgba(62, 42, 30, 0.07);

  --font-head: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --accent: var(--terracotta);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #EFE3C8;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-head); margin: 0; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; color: inherit; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: var(--ink); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }

.app {
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.loading { margin: auto; color: var(--muted); font-weight: 700; }

/* ---------- Start ---------- */
.start { background: var(--bg-start); flex: 1; display: flex; flex-direction: column; }
.hero { height: 320px; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.start-body { flex: 1; padding: 28px 24px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 18px; }
.eyebrow { color: var(--wood); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.start h1 { font-size: 28px; line-height: 1.2; margin-top: 8px; }
.info-card {
  background: var(--white); border-radius: 20px; padding: 18px;
  box-shadow: 0 8px 22px rgba(62, 42, 30, 0.08);
  display: flex; flex-direction: column; gap: 9px;
}
.info-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.info-row .ico { font-size: 18px; }
.info-row strong { font-weight: 700; }
.avatars { display: flex; }
.avatar {
  width: 40px; height: 40px; border-radius: 999px; border: 3px solid var(--bg-start);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px; margin-right: -12px;
}
.avatar:last-child { margin-right: 0; }
.avatar.klein { font-size: 11px; letter-spacing: -0.02em; }
.avatars.ruim .avatar { margin-right: -4px; }
.avatars.ruim .avatar:last-child { margin-right: 0; }
.spacer { flex: 1; }
.cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: var(--sage); color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 17px;
  border-radius: 999px; padding: 18px; box-shadow: 0 12px 24px rgba(107, 122, 79, 0.3);
}
.small-link {
  align-self: center; font-size: 13px; font-weight: 700; color: var(--wood);
  padding: 8px 12px; margin-top: -6px;
}
.small-link:hover { text-decoration: underline; }

/* ---------- Hoofdmenu ---------- */
.menu-head {
  padding: calc(28px + var(--safe-top)) 24px 20px;
  background: linear-gradient(135deg, var(--burgundy), var(--terracotta));
  color: #fff;
}
.menu-top { display: flex; align-items: center; gap: 12px; }
.menu-head .eyebrow { color: #fff; }
.menu-head h1 { color: #fff; font-size: 26px; margin-top: 10px; }
.menu-head .sub { color: rgba(255, 255, 255, 0.9); font-size: 13px; }
.tiles {
  flex: 1;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
  /* Tegels vullen de rest van het scherm, zoals in het design */
  grid-auto-rows: minmax(130px, 1fr); align-content: stretch;
}
.tile {
  border-radius: 20px; padding: 18px; min-height: 130px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .12s ease;
}
.tile:active { transform: scale(0.97); }
.tile .ico { font-size: 26px; }
.tile .label { color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 16px; }

/* ---------- Subscherm-kop ---------- */
.head {
  position: sticky; top: 0; z-index: 5;
  padding: calc(20px + var(--safe-top)) 20px 16px;
  background: var(--accent);
  display: flex; align-items: center; gap: 12px;
}
.head h1 { color: #fff; font-size: 20px; }
.back {
  width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.25); color: #fff; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.body {
  flex: 1; padding: 16px 20px calc(24px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.body.gap-l { gap: 20px; }

/* ---------- Kaarten ---------- */
.card {
  display: block; background: var(--card); border-radius: 18px; padding: 16px;
  box-shadow: var(--shadow);
}
a.card, a.row { transition: transform .12s ease; }
a.card:active, a.row:active { transform: scale(0.985); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card .ico { font-size: 26px; line-height: 1.2; }
.card h3 { font-size: 16px; margin-top: 10px; }
.card .desc { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.4; white-space: pre-line; }
.card-foot { margin-top: 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.meta { font-size: 12px; color: var(--accent-text, var(--accent)); font-weight: 700; }
.ext { font-size: 12px; font-weight: 700; color: var(--accent-text, var(--accent)); white-space: nowrap; margin-left: auto; }
.chip {
  background: var(--chip-bg); color: var(--chip-ink); font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-text, var(--accent));
}
.section-label.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.stack.tight { gap: 8px; margin-top: 8px; }
.toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  min-height: 32px; text-align: left;
}
.toggle .chev { font-size: 13px; font-weight: 700; color: var(--accent-text, var(--accent)); }
.note { font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; }
.empty {
  border: 2px dashed var(--dash); border-radius: 18px; padding: 20px; text-align: center;
  font-size: 13px; color: var(--muted); line-height: 1.4;
}

/* Compacte rij (Eten & drinken) */
.row {
  background: var(--card); border-radius: 14px; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-xs);
}
.row .name { font-size: 14px; font-weight: 600; }
.row .row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row .row-sub { font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.row .tag { margin-left: auto; font-size: 10px; color: var(--muted); font-weight: 700; text-align: right; }
.row .ext { margin-left: 0; }
.row .row-end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------- Planning ---------- */
.tabs { display: flex; gap: 8px; padding: 16px 20px 8px; }
.tab {
  flex: 1; padding: 10px; border-radius: 999px; min-height: 44px;
  background: var(--card); color: var(--cocoa);
  font-family: var(--font-head); font-weight: 600; font-size: 13px;
}
.tab[aria-selected="true"] { background: var(--mustard); color: #fff; }
.timeline { padding: 12px 20px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; }
.slot { display: flex; gap: 12px; }
.slot .time { width: 52px; flex-shrink: 0; font-weight: 700; color: var(--cocoa); font-size: 13px; padding-top: 14px; }
.slot .item {
  flex: 1; background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm);
  display: flex; gap: 10px; align-items: flex-start;
}
.slot .item .ico { font-size: 20px; }
.slot .item .label { font-size: 14px; line-height: 1.4; }
.slot .item .sub { font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; white-space: pre-line; }
.slot .item .ext { margin-top: 4px; display: inline-block; }

/* ---------- Huisje ---------- */
.contact h3 { font-size: 15px; }
.contact p { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.6; }
.contact a { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--dash); text-underline-offset: 3px; }
.duo { display: flex; gap: 10px; }
.duo .card { flex: 1; padding: 14px; }
.kv-label { font-size: 11px; color: var(--muted); font-weight: 700; }
.kv-value { font-size: 17px; font-weight: 700; margin-top: 2px; }
.kv-note { font-size: 11px; color: var(--muted); margin-top: 2px; }
.card h3.small { font-size: 14px; margin-top: 0; }
.facilities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.facility { text-align: center; }
.facility .ico { font-size: 22px; }
.facility .label { font-size: 11px; color: var(--ink-2); margin-top: 4px; }
.highlight { background: var(--note-bg); border-radius: 18px; padding: 16px; }
.highlight h3 { font-size: 14px; color: var(--wood); }
.highlight p { font-size: 13px; color: var(--wood); margin-top: 6px; white-space: pre-line; line-height: 1.45; }

/* ---------- Poll & suggesties ---------- */
.name-card {
  background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px;
}
.name-card label { font-size: 11px; font-weight: 700; color: var(--muted); }
.name-card input { border: none; outline: none; background: transparent; font-weight: 700; font-size: 16px; padding: 0; }
.name-card.needs-name { box-shadow: 0 0 0 2px var(--mustard), var(--shadow-sm); }
.status { font-size: 11px; color: var(--muted); text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }
.status .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted); }
.status[data-state="live"] .dot { background: var(--sage); }
.status[data-state="fout"] .dot { background: var(--terracotta); }
.poll { display: flex; flex-direction: column; gap: 10px; }
.poll h3 { font-size: 15px; }
.option {
  width: 100%; text-align: left; background: var(--card); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow-sm); border: 2px solid transparent; display: block;
}
.option[aria-pressed="true"] { border-color: var(--mustard); }
.option .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.option .label { font-size: 14px; font-weight: 600; }
.option .pct { font-size: 13px; font-weight: 700; color: var(--wood); white-space: nowrap; }
.bar { display: block; height: 8px; background: var(--bar-bg); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--bar); transition: width .35s ease; }
.option[aria-pressed="true"] .bar > span { background: var(--mustard); }
.voters { display: block; font-size: 11px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.polls { display: flex; flex-direction: column; gap: 18px; }
.divider { height: 1px; background: var(--divider); margin: 2px 0; }
.bring-item {
  background: var(--card); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-sm);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.bring-item .label { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.bring-item .end { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.remove {
  width: 32px; height: 32px; border-radius: 999px; color: var(--muted); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.remove:hover { background: var(--note-bg); color: var(--wood); }
.add-form {
  background: var(--card); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-sm);
  display: flex; gap: 8px; align-items: center;
}
.add-form input, .add-form textarea {
  flex: 1; border: none; outline: none; background: transparent; font-size: 16px; min-width: 0;
}
.add-form textarea { resize: none; min-height: 64px; line-height: 1.4; padding: 4px 2px; }
.add-form.col { flex-direction: column; align-items: stretch; }
.add-form.col .btn { align-self: flex-end; }
.hint { font-size: 11px; color: var(--muted); }
.hint.warn { color: var(--terracotta); font-weight: 700; }
.btn {
  background: var(--wood); color: #fff; font-weight: 700; font-size: 13px;
  border-radius: 999px; padding: 9px 16px; min-height: 40px; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--sage); font-family: var(--font-head); font-weight: 600; font-size: 16px; padding: 14px 20px; }
.btn-danger { background: var(--terracotta); }
.suggestion { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.suggestion p { font-size: 14px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.suggestion .by { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--muted); }
.admin { border-top: 1px solid var(--divider); padding-top: 14px; margin-top: 6px; }
.admin-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.admin-body input {
  background: var(--card); border: 2px solid var(--divider); border-radius: 12px; padding: 10px 12px; font-size: 16px; outline: none;
}
.admin-body input:focus { border-color: var(--mustard); }

/* ---------- Naam-dialoog ---------- */
.dialog {
  border: none; border-radius: 22px; padding: 24px; width: min(360px, calc(100vw - 32px));
  background: var(--bg-start); color: var(--ink); box-shadow: 0 20px 50px rgba(62, 42, 30, 0.3);
}
.dialog::backdrop { background: rgba(62, 42, 30, 0.45); }
.dialog form { display: flex; flex-direction: column; gap: 14px; }
.dialog h2 { font-size: 22px; }
.dialog p { font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.dialog input {
  border: 2px solid var(--divider); border-radius: 14px; padding: 12px 14px; font-size: 16px;
  font-weight: 700; background: var(--white); outline: none;
}
.dialog input:focus { border-color: var(--mustard); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
