:root {
  --bg: #f4f1e9;
  --surface: #fffdf8;
  --surface-2: #ece8dc;
  --text: #1d241f;
  --muted: #687068;
  --border: #d9d4c7;
  --accent: #c95f2d;
  --accent-dark: #9f431c;
  --green: #243b2b;
  --green-2: #31523b;
  --danger: #a92b2b;
  --shadow: 0 12px 35px rgba(35, 41, 36, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .75rem 1rem;
  background: var(--text);
  color: white;
  border-radius: 10px;
}
.skip-link:focus { top: 1rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1.25rem;
  background: rgba(255, 253, 248, .93);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  margin-right: auto;
}
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--green);
  font-size: 1.7rem;
  box-shadow: var(--shadow);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.08rem; }
.brand small { color: var(--muted); font-size: .78rem; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
}
.topbar-navigation,
.topbar-utilities {
  display: flex;
  align-items: center;
}
.topbar-navigation { gap: .35rem; }
.topbar-utilities {
  gap: .5rem;
  padding-left: .8rem;
  border-left: 1px solid var(--border);
}
.topbar .button,
.topbar .icon-button,
.topbar .sync-status {
  min-height: 46px;
}
.topbar .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.topbar-link {
  background: transparent;
  color: var(--text);
}
.topbar-link:hover,
.topbar-link[aria-current="page"] {
  background: var(--surface-2);
}
.account-button {
  background: var(--surface-2);
  color: var(--text);
}

.button, .icon-button {
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  transition: .18s ease;
}
.button { padding: .72rem 1rem; }
.button:hover, .icon-button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover { background: var(--accent-dark); }
.button-ghost { background: var(--surface-2); color: var(--text); }
.button-danger { background: #f3dddd; color: var(--danger); }
.icon-button {
  width: 42px;
  height: 42px;
  background: transparent;
  font-size: 1.5rem;
}

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  padding: 1.25rem 1rem;
  background: var(--green);
  color: white;
  overflow-y: auto;
}
.nav-label {
  margin: 1.35rem .75rem .5rem;
  color: #b8c8bc;
  font-size: .73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.nav-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .72rem .8rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #eef4ef;
  text-align: left;
}
.nav-item:hover, .nav-item.active { background: var(--green-2); color: white; }
.count {
  min-width: 26px;
  padding: .05rem .4rem;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  text-align: center;
  font-size: .78rem;
}
.sidebar-note {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 15px;
  color: #d7e3d9;
  font-size: .84rem;
}
.sidebar-note p { margin: .35rem 0 0; }

.content { width: min(1240px, 100%); margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 3rem) 4rem; }
.hero {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 480px);
  align-items: end;
  gap: 2rem;
  padding: 1.6rem 0 2rem;
}
.eyebrow {
  margin: 0 0 .35rem;
  color: var(--accent-dark);
  font-weight: 850;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}
h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.05; letter-spacing: -.04em; }
.hero p:not(.eyebrow) { color: var(--muted); max-width: 700px; }
.search-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow);
}
.search-wrap input { min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1rem; }
kbd { padding: .1rem .42rem; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: var(--bg); }

.filter-row, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.filter-row { margin-bottom: 1.5rem; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  padding: .5rem .78rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 750;
}
.chip.active { border-color: var(--green); background: var(--green); color: white; }
.select-wrap { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .85rem; }
.select-wrap select { padding: .5rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.section-heading h2 { margin: 0; font-size: 1.25rem; }
.muted { color: var(--muted); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 245px;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 20px rgba(35, 41, 36, .045);
  transition: .18s ease;
  overflow: hidden;
}
.card-with-image { padding-top: 0; }
.card-image {
  width: calc(100% + 2.3rem);
  height: 155px;
  margin: 0 -1.15rem 1rem;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c9c2b2; }
.card::after {
  content: "";
  position: absolute;
  right: -25px;
  top: -25px;
  width: 85px;
  height: 85px;
  border-radius: 50%;
  background: rgba(201,95,45,.08);
}
.card-top { display: flex; justify-content: space-between; gap: .75rem; align-items: start; }
.type-badge {
  display: inline-flex;
  padding: .28rem .58rem;
  border-radius: 999px;
  background: #e8eee9;
  color: var(--green);
  font-size: .72rem;
  font-weight: 850;
}
.favorite-button { border: 0; background: transparent; color: #b1aa9b; font-size: 1.25rem; z-index: 1; }
.favorite-button.active { color: #d3901b; }
.card h3 { margin: .9rem 0 .3rem; font-size: 1.2rem; line-height: 1.2; }
.card .path { color: var(--accent-dark); font-size: .8rem; font-weight: 760; }
.card p { color: var(--muted); margin: .65rem 0 1rem; }
.card-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: end; gap: .7rem; }
.meta { display: flex; flex-wrap: wrap; gap: .35rem .7rem; color: var(--muted); font-size: .8rem; }
.open-button { border: 0; background: transparent; color: var(--accent-dark); font-weight: 850; }

.empty-state { text-align: center; padding: 5rem 1rem; color: var(--muted); }
.empty-icon { font-size: 3rem; }
.hidden { display: none !important; }
.mobile-only { display: none; }

/* Dialogs */
dialog { border: 0; padding: 0; color: var(--text); background: var(--surface); box-shadow: 0 25px 80px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(18, 24, 20, .58); backdrop-filter: blur(3px); }
.detail-dialog { width: min(760px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); border-radius: 22px; }
.detail-dialog article { padding: clamp(1.2rem, 4vw, 2rem); }
.detail-image {
  width: 100%;
  max-height: 360px;
  margin: .8rem 0 1rem;
  border-radius: 16px;
  object-fit: cover;
  background: var(--surface-2);
}
.detail-header { display: flex; gap: 1rem; justify-content: space-between; align-items: start; }
.detail-header h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: .2rem 0; letter-spacing: -.03em; }
.detail-actions { display: flex; gap: .45rem; flex-wrap: wrap; margin: 1.2rem 0; }
.detail-summary { color: var(--muted); font-size: 1.05rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.4rem; }
.meta-pill { padding: .4rem .65rem; background: var(--surface-2); border-radius: 999px; font-size: .82rem; }
.steps { list-style: none; margin: 1rem 0; padding: 0; counter-reset: steps; }
.steps li { counter-increment: steps; display: grid; grid-template-columns: 38px 1fr; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.steps li::before { content: counter(steps); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-weight: 850; }
.tip-box { padding: 1rem; border-left: 4px solid var(--accent); background: #f7ece5; border-radius: 0 12px 12px 0; }
.tip-box ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.ingredient-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .45rem 1.25rem;
  margin: .8rem 0 1.5rem;
  padding: 0;
  list-style: none;
}
.ingredient-list li {
  position: relative;
  padding: .55rem .7rem .55rem 1.55rem;
  border-radius: 10px;
  background: var(--surface-2);
}
.ingredient-list li::before {
  content: "•";
  position: absolute;
  left: .65rem;
  color: var(--accent-dark);
  font-weight: 900;
}
.detail-dialog h3 small { color: var(--muted); font-size: .8rem; font-weight: 600; }
.related-list { display: flex; gap: .45rem; flex-wrap: wrap; }
.related-button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: .45rem .7rem; }

.editor-dialog { width: min(820px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); border-radius: 22px; }
.editor-dialog form { padding: 1.5rem; overflow-y: auto; max-height: calc(100vh - 2rem); }
.dialog-header, .dialog-footer { display: flex; align-items: center; gap: .8rem; }
.dialog-header { justify-content: space-between; margin-bottom: 1rem; }
.dialog-header h2 { margin: 0; }
.dialog-footer { margin-top: 1rem; }
.spacer { flex: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.editor-dialog label { display: grid; gap: .35rem; margin-bottom: .8rem; font-weight: 750; }
.editor-dialog label small { color: var(--muted); font-weight: 500; }
.editor-dialog input, .editor-dialog textarea, .editor-dialog select {
  width: 100%;
  padding: .75rem .85rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: white;
}
.editor-dialog textarea { resize: vertical; }

.cook-dialog { width: 100vw; height: 100vh; max-width: none; max-height: none; background: var(--green); color: white; }
.cook-shell { height: 100%; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(1rem, 4vw, 3rem); }
.cook-shell header, .cook-shell footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cook-shell main { display: grid; place-content: center; text-align: center; width: min(900px, 100%); margin: auto; }
.cook-shell .eyebrow { color: #eab08f; }
.cook-step { font-size: clamp(2rem, 5vw, 4.7rem); font-weight: 780; line-height: 1.12; letter-spacing: -.035em; }
.cook-shell .button-ghost { background: rgba(255,255,255,.12); color: white; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  z-index: 100;
  transform: translate(-50%, 130%);
  padding: .8rem 1rem;
  border-radius: 12px;
  background: #161b17;
  color: white;
  opacity: 0;
  transition: .25s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 900px) {
  .mobile-only { display: inline-grid; place-items: center; }
  .topbar-actions .admin-action.button-ghost { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 76px auto 0 0;
    z-index: 25;
    width: min(320px, 86vw);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .hero { grid-template-columns: 1fr; gap: 1rem; }
}

@media (max-width: 620px) {
  .topbar { padding-inline: .7rem; }
  .brand small { display: none; }
  .topbar-actions .button-primary { padding: .65rem .75rem; font-size: .85rem; }
  .content { padding-inline: 1rem; }
  .filter-row { align-items: start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .detail-actions .button { flex: 1; }
  .cook-shell footer .button { flex: 1; }
}

/* Server-, login- en synchronisatiestatus */
.sync-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-width: 46px;
  padding: .45rem .72rem;
  border: 1px solid #d7e5d9;
  border-radius: 12px;
  background: #eef5ef;
  color: #536158;
  font-size: .78rem;
  font-weight: 650;
  white-space: nowrap;
}
.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #3d8b52;
  box-shadow: 0 0 0 3px rgba(61, 139, 82, .12);
}
.sync-status[data-mode="working"] {
  border-color: #ead9b7;
  background: #fff8e9;
  color: #74581e;
}
.sync-status[data-mode="working"] .status-dot { background: #c98a20; box-shadow: 0 0 0 3px rgba(201, 138, 32, .15); }
.sync-status[data-mode="error"] {
  border-color: #edcaca;
  background: #fff0f0;
  color: var(--danger);
}
.sync-status[data-mode="error"] .status-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(169, 43, 43, .13); }
.sync-status[data-mode="locked"] {
  border-color: var(--border);
  background: var(--surface-2);
}
.sync-status[data-mode="locked"] .status-dot { background: #7a807b; box-shadow: 0 0 0 3px rgba(122, 128, 123, .13); }

.security-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #e0b7a6;
  border-radius: 15px;
  background: #fff0e9;
}
.security-banner p { margin: .2rem 0 0; color: var(--muted); }

.locked-state {
  max-width: 620px;
  margin: 2rem auto;
  padding: clamp(2rem, 6vw, 4rem);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.locked-state h2 { margin-bottom: .3rem; }
.locked-state p { color: var(--muted); margin: 0 0 1.2rem; }

.auth-dialog {
  width: min(520px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  border-radius: 22px;
}
.auth-dialog form,
.account-shell {
  padding: 1.5rem;
}
.auth-dialog label {
  display: grid;
  gap: .35rem;
  margin-bottom: .85rem;
  font-weight: 750;
}
.auth-dialog input {
  width: 100%;
  padding: .75rem .85rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: white;
}
.account-section {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.account-section h3 { margin: 0 0 .75rem; }
.account-section p { color: var(--muted); }
.account-section form { padding: 0; }
.account-footer { padding-top: 1rem; border-top: 1px solid var(--border); }
.form-error {
  margin: .6rem 0;
  padding: .65rem .75rem;
  border-radius: 10px;
  background: #f7dddd;
  color: var(--danger);
  font-size: .88rem;
  font-weight: 700;
}
button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none !important;
}
.related-button:disabled { cursor: default; opacity: .62; }
.favorite-button:focus-visible,
.open-button:focus-visible,
.related-button:focus-visible,
.button:focus-visible,
.icon-button:focus-visible,
.nav-item:focus-visible,
.chip:focus-visible {
  outline: 3px solid rgba(201, 95, 45, .3);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .sync-status span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .sync-status { width: 46px; padding-inline: 0; }
}

@media (max-width: 620px) {
  .security-banner { align-items: stretch; flex-direction: column; }
  .topbar-actions { gap: .3rem; }
  .topbar-utilities { gap: .3rem; padding-left: .45rem; }
  .topbar-actions .button { padding: .63rem .7rem; font-size: .82rem; }
  .sync-status { display: none; }
  .account-button { max-width: 108px; overflow: hidden; text-overflow: ellipsis; }
}

/* Community en afbeeldingsbeheer (v0.4) */
.form-span-2 { grid-column: 1 / -1; }
.draft-badge {
  padding: .24rem .5rem;
  border-radius: 999px;
  background: #fff4d6;
  color: #7a4b00;
  font-size: .72rem;
  font-weight: 750;
}
.community-meta,
.byline {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .84rem;
}
.community-meta { margin-top: auto; padding-top: .65rem; }
.author-link,
.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.author-link:hover,
.link-button:hover { text-decoration: underline; }
.danger-link { color: var(--danger); }

.image-editor {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.image-editor legend { padding: 0 .4rem; font-weight: 750; }
.image-editor legend small { color: var(--muted); font-weight: 500; }
.image-editor-layout {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 1rem;
  align-items: center;
}
.image-preview {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--border-strong, var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface-soft, #f6f7f4);
  color: var(--muted);
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-button { display: inline-flex; margin-right: .5rem; margin-bottom: .5rem; }
.field-help { margin: .6rem 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }

.comments-section { border-top: 1px solid var(--border); padding-top: 1.2rem; }
.comment {
  padding: .9rem 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: 0; }
.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .82rem;
}
.comment p { margin: .55rem 0; line-height: 1.55; }
.comment-actions { display: flex; gap: .8rem; font-size: .82rem; }
.comment-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.comment-form > div { display: flex; justify-content: flex-end; }
.login-prompt { margin: 1rem 0 0; color: var(--muted); }

.profile-body { padding: 0 1.25rem 1.25rem; }
.profile-stats {
  display: flex;
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}
.profile-stats span {
  padding: .65rem .85rem;
  border-radius: var(--radius);
  background: var(--surface-soft, #f6f7f4);
}
.profile-stats strong { display: block; font-size: 1.2rem; }
.profile-items { display: grid; gap: .5rem; }
.profile-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: .75rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.profile-item:hover { border-color: var(--primary); }
.profile-item small { color: var(--muted); }
.wide-dialog { width: min(680px, calc(100vw - 1.5rem)); }
.auth-footer { flex-wrap: wrap; }

@media (max-width: 640px) {
  .image-editor-layout { grid-template-columns: 1fr; }
  .image-preview { max-width: 100%; }
  .comment-head { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .profile-item { align-items: flex-start; flex-direction: column; gap: .2rem; }
}

/* Deelbare pagina's en profielpagina's (v0.5) */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Houd tellers compact wanneer een categorienaam op twee regels staat. */
.nav-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}
.nav-item > span:first-child {
  min-width: 0;
  line-height: 1.45;
}
.nav-item .count {
  align-self: start;
  justify-self: end;
  height: max-content;
  line-height: 1.55;
  white-space: nowrap;
}

/* Methode en kooktijd blijven op één vaste regel onder iedere kaart. */
.card-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.card-cooking-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  min-width: 0;
  color: var(--muted);
  font-size: .8rem;
}
.method-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.time-meta,
.open-button { white-space: nowrap; }

/* Rustig en volledig breed reactieveld. */
.comment-form {
  display: grid;
  gap: .75rem;
}
.comment-form textarea {
  display: block;
  width: 100%;
  min-height: 112px;
  padding: .85rem .95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}
.comment-form textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(201, 95, 45, .16);
}
.comment-form-actions {
  display: flex;
  justify-content: flex-end;
}
.comment-form .form-error { margin: 0; }

.profile-page { padding: .4rem 0 2rem; }
.back-link {
  margin: .2rem 0 1.25rem;
  padding: .35rem 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.back-link:hover { text-decoration: underline; }
.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.35rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.profile-avatar {
  width: clamp(72px, 9vw, 104px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 850;
}
.profile-identity h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -.035em;
}
.profile-handle { margin: .45rem 0 0; color: var(--muted); }
.profile-bio {
  max-width: 720px;
  margin: .9rem 0 0;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-line;
}
.profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 180px));
  gap: .75rem;
  margin: 1rem 0 2rem;
}
.profile-stats span {
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
}
.profile-stats strong {
  display: block;
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1.1;
}
.profile-contributions { margin-top: .25rem; }
.profile-loading {
  padding: 4rem 1rem;
  color: var(--muted);
  text-align: center;
}
.account-profile-link { margin-top: .8rem; }

@media (max-width: 760px) {
  .profile-hero { grid-template-columns: auto 1fr; align-items: start; }
  .profile-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .profile-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
  .profile-hero { grid-template-columns: 1fr; }
  .profile-avatar { width: 76px; }
  .profile-stats { grid-template-columns: 1fr; }
  .profile-actions .button { flex: 1; }
  .card-cooking-meta { gap: .35rem; }
}


/* Ratings, kaartuitlijning en meldingen (v0.6) */
.toast {
  pointer-events: none;
  z-index: 10000;
  max-width: min(520px, calc(100vw - 2rem));
  text-align: center;
  white-space: normal;
}

/* Reserveer dezelfde ruimte voor pad, titel en samenvatting zodat auteurs per rij gelijk uitlijnen. */
.card .path {
  min-height: 1.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-title {
  min-height: calc(1.2em * 2);
  max-height: calc(1.2em * 2);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.card-summary {
  min-height: calc(1.5em * 3);
  max-height: calc(1.5em * 3);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.community-meta {
  min-height: 1.55rem;
  margin-top: 0;
  padding-top: .45rem;
  justify-content: space-between;
  flex-wrap: nowrap;
}
.community-author {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.community-author .author-link {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.community-stats {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  flex: 0 0 auto;
  white-space: nowrap;
}
.rating-meta {
  color: #9a6710;
  font-weight: 800;
}
.rating-meta small {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 650;
}
.rating-empty {
  color: var(--muted);
  font-weight: 650;
}

.rating-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}
.rating-overview {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding-right: 1.25rem;
  border-right: 1px solid var(--border);
}
.rating-score {
  min-width: 2.2ch;
  color: #9a6710;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}
.rating-overview > span:last-child {
  display: grid;
  line-height: 1.2;
}
.rating-overview strong {
  font-size: .82rem;
}
.rating-overview small,
.rating-help {
  color: var(--muted);
  font-size: .82rem;
}
.rating-help {
  margin: 0;
}
.your-rating {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: .75rem;
}
.your-rating > span {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 750;
}
.rating-stars {
  display: inline-flex;
  gap: .08rem;
}
.rating-star {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #bdb5a5;
  font-size: 1.55rem;
  line-height: 1;
  transition: color .15s ease, transform .15s ease;
}
.rating-star:hover,
.rating-star:focus-visible,
.rating-star.active {
  color: #d3901b;
}
.rating-star:hover {
  transform: translateY(-1px) scale(1.06);
}
.rating-star:focus-visible {
  outline: 3px solid rgba(211, 144, 27, .22);
  outline-offset: 2px;
  border-radius: 8px;
}

@media (max-width: 620px) {
  .rating-panel {
    grid-template-columns: 1fr;
    gap: .85rem;
  }
  .rating-overview {
    padding-right: 0;
    padding-bottom: .85rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .your-rating {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: .45rem;
  }
  .community-stats {
    gap: .45rem;
  }
}

/* Keukentafel community (v0.7) */
.topbar-link { text-decoration: none; }
.notification-button {
  position: relative;
  width: 46px;
  height: 46px;
  background: var(--surface-2);
  font-size: 1.05rem;
}
.notification-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 .3rem;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: .68rem;
  line-height: 1;
}

.forum-page { padding: .4rem 0 2rem; }
.forum-hero,
.forum-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.forum-hero h1,
.forum-list-header h1,
.forum-topic-detail h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.forum-hero p:not(.eyebrow),
.forum-list-header p:not(.eyebrow) { max-width: 700px; margin-bottom: 0; color: var(--muted); }
.forum-hero-actions,
.forum-topic-actions,
.moderator-controls { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.forum-section { margin: 1.5rem 0 2rem; }
.forum-category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-top: 1rem; }
.forum-category-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  transition: .18s ease;
}
.forum-category-card:hover { transform: translateY(-2px); border-color: #c9c2b2; box-shadow: var(--shadow); }
.forum-category-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: #e8eee9; font-size: 1.45rem; }
.forum-category-copy { min-width: 0; display: grid; gap: .18rem; }
.forum-category-copy strong { font-size: 1rem; }
.forum-category-copy small { color: var(--muted); line-height: 1.4; }
.forum-category-count { min-width: 76px; text-align: right; color: var(--muted); }
.forum-category-count strong, .forum-category-count small { display: block; }
.forum-category-count strong { color: var(--text); font-size: 1.25rem; }
.forum-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.forum-topic-list { display: grid; gap: .7rem; margin-top: .9rem; }
.forum-topic-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.forum-topic-row.compact { padding: .85rem; }
.forum-topic-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); font-size: 1.15rem; }
.forum-topic-main { min-width: 0; }
.forum-topic-labels { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .18rem; color: var(--muted); font-size: .74rem; font-weight: 750; }
.forum-badge { padding: .17rem .4rem; border-radius: 999px; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
.forum-badge.pinned { background: #f4e6bd; color: #79520d; }
.forum-badge.closed { background: #ece8dc; color: #62675f; }
.forum-topic-title { display: block; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 1.04rem; font-weight: 850; line-height: 1.3; text-align: left; }
.forum-topic-title:hover { color: var(--accent-dark); }
.forum-topic-main > p { display: -webkit-box; max-height: 3em; margin: .35rem 0; overflow: hidden; color: var(--muted); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.forum-topic-byline { display: flex; align-items: center; gap: .25rem; min-width: 0; color: var(--muted); font-size: .78rem; }
.forum-topic-stats { display: grid; gap: .18rem; min-width: 72px; color: var(--muted); font-size: .77rem; text-align: right; white-space: nowrap; }
.forum-toolbar { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; }
.forum-search { flex: 1; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .55rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.forum-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; }

.forum-topic-detail {
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.forum-topic-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.25rem; }
.forum-topic-detail-header h1 { margin: .35rem 0 .45rem; }
.forum-topic-detail-header p { margin: 0; color: var(--muted); }
.forum-topic-image { width: 100%; max-height: 520px; margin: 1.25rem 0; border-radius: 16px; object-fit: cover; background: var(--surface-2); }
.forum-topic-body,
.forum-post-body { line-height: 1.7; overflow-wrap: anywhere; }
.forum-topic-body { margin: 1.5rem 0; font-size: 1.02rem; }
.forum-topic-metrics { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; }
.active-like { color: #9f431c; box-shadow: inset 0 0 0 1px rgba(159,67,28,.25); }
.moderator-controls { margin-top: 1rem; padding: .85rem; border-radius: 12px; background: #f3eee4; }
.linked-recipe-card { display: grid; gap: .12rem; width: 100%; margin: 1.25rem 0; padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: #eef3ef; color: inherit; text-align: left; }
.linked-recipe-card span, .linked-recipe-card small { color: var(--muted); }
.linked-recipe-card strong { font-size: 1.05rem; }
.forum-replies { margin-top: 1.5rem; }
.forum-post-list { display: grid; gap: .8rem; }
.forum-post { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.forum-post header { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .8rem; }
.forum-post-body { margin: .75rem 0; }
.forum-post footer { display: flex; gap: .75rem; flex-wrap: wrap; }
.forum-reply-form { display: grid; gap: .75rem; margin-top: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.forum-reply-form textarea,
.topic-editor-dialog textarea,
#reportDialog textarea { width: 100%; padding: .85rem .95rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--text); resize: vertical; }
.forum-reply-form textarea:focus,
.topic-editor-dialog textarea:focus,
#reportDialog textarea:focus { border-color: var(--accent); outline: 3px solid rgba(201,95,45,.16); }
.forum-reply-form > div { display: flex; justify-content: flex-end; }
.closed-notice { margin-top: 1rem; padding: .9rem 1rem; border-radius: 12px; background: var(--surface-2); color: var(--muted); }

.profile-tabs { display: flex; gap: .5rem; margin: 0 0 1.25rem; border-bottom: 1px solid var(--border); }
.profile-tab { padding: .7rem .85rem; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 800; }
.profile-tab.active { border-bottom-color: var(--accent); color: var(--text); }
.profile-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.notification-list,
.moderation-list { display: grid; gap: .65rem; max-height: 65vh; overflow-y: auto; padding: .25rem 0; }
.notification-item { display: grid; grid-template-columns: auto 1fr; gap: .75rem; width: 100%; padding: .85rem; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: inherit; text-align: left; }
.notification-item.unread { border-color: rgba(201,95,45,.45); background: #fff7f1; }
.notification-item small { display: block; margin-top: .2rem; color: var(--muted); }
.moderation-report { padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.moderation-report.resolved { opacity: .7; }
.moderation-report header, .moderation-report footer { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.moderation-report blockquote { margin: .7rem 0; padding: .65rem .8rem; border-left: 3px solid var(--border); background: var(--surface-2); color: var(--muted); }
.moderation-report small { color: var(--muted); }

@media (max-width: 900px) {
  .forum-columns { grid-template-columns: 1fr; }
  .forum-category-grid { grid-template-columns: 1fr; }
  .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar-link { display: none; }
  .forum-hero,
  .forum-list-header,
  .forum-topic-detail-header { align-items: flex-start; flex-direction: column; }
  .forum-topic-actions { width: 100%; }
  .forum-topic-row { grid-template-columns: auto minmax(0, 1fr); }
  .forum-topic-stats { grid-column: 2; display: flex; gap: .7rem; text-align: left; }
  .forum-toolbar { flex-direction: column; }
}

@media (max-width: 520px) {
  .forum-category-card { grid-template-columns: auto minmax(0, 1fr); }
  .forum-category-count { grid-column: 2; text-align: left; }
  .forum-topic-icon { display: none; }
  .forum-topic-row { grid-template-columns: 1fr; }
  .forum-topic-stats { grid-column: 1; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .forum-topic-actions .button { flex: 1; }
}


/* Compacte, gegroepeerde header (v0.7.1) */
.account-action-row {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.account-action-row .button { flex: 1 1 150px; }

@media (max-width: 900px) {
  .topbar-utilities { border-left: 0; padding-left: 0; }
  .topbar-navigation { display: none; }
}

@media (max-width: 700px) {
  .notification-button { width: 42px; height: 42px; min-height: 42px; }
  .topbar .button { min-height: 42px; }
}

/* Vaste keuzes voor nieuwe kookbijdragen (v0.8) */
.contribution-choice-help {
  margin: -.15rem 0 1rem;
  padding: .75rem .9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-2));
}
.editor-dialog select:required:invalid {
  color: var(--muted);
}

/* Smulboek 0.9: accountmail en notificatievoorkeuren */
.auth-help-row,
.email-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.text-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent, #9c3f13);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: .2rem 0;
  text-decoration: underline;
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

.text-button:hover { text-decoration-thickness: .14em; }
.text-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent, #9c3f13) 32%, transparent); outline-offset: 3px; }

.email-status {
  border-radius: 999px;
  background: #fff1e8;
  color: #8a3410;
  font-size: .9rem;
  font-weight: 750;
  padding: .4rem .65rem;
}

.email-status[data-verified="true"] {
  background: #e8f3eb;
  color: #245736;
}

.notification-preferences {
  border: 1px solid var(--border, #ddd6c7);
  border-radius: 14px;
  display: grid;
  gap: .65rem;
  margin: 1rem 0;
  padding: .9rem 1rem 1rem;
}

.notification-preferences legend {
  font-weight: 800;
  padding: 0 .35rem;
}

.checkbox-label {
  align-items: center;
  display: flex !important;
  flex-direction: row !important;
  gap: .55rem;
  margin: 0;
}

.checkbox-label input {
  height: 1.1rem;
  margin: 0;
  width: 1.1rem;
}

.dialog-intro {
  color: var(--muted, #66706a);
  line-height: 1.55;
  margin: 0 0 1rem;
}

@media (max-width: 640px) {
  .auth-help-row { align-items: flex-start; flex-direction: column; }
  .email-status-row { align-items: flex-start; }
}
.email-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Smulboek 0.10 — rollen, klassen en redactie */
.rank-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: .25rem .62rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #53745a) 14%, white);
  border: 1px solid color-mix(in srgb, var(--accent, #53745a) 35%, white);
  color: var(--accent-strong, #284a31);
  font-size: .78rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}
.rank-badge.compact { min-height: 1.45rem; padding: .18rem .48rem; font-size: .7rem; margin-inline: .35rem; }
.user-class-inline { color: var(--muted); font-size: .68rem; white-space: nowrap; }
.community-author { display: inline-flex; align-items: center; gap: .38rem; min-width: 0; }
.account-rank-section > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.account-rank-section p { margin: .65rem 0 0; color: var(--muted); }
.status-chip, .draft-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .22rem .55rem;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1;
  background: #eef2ed;
  color: #38513e;
}
.status-submitted { background: #fff3ce; color: #765800; }
.status-in_review { background: #e5efff; color: #28538a; }
.status-changes_requested { background: #fff0df; color: #834b18; }
.status-rejected { background: #fde8e7; color: #8a2e2a; }

.management-dialog {
  width: min(1050px, calc(100vw - 2rem));
  max-height: min(88vh, 920px);
  padding: 0;
  border: 0;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 24px 80px rgb(18 34 22 / .28);
}
.management-dialog::backdrop { background: rgb(18 27 20 / .58); backdrop-filter: blur(3px); }
.management-shell { display: flex; flex-direction: column; max-height: inherit; background: var(--panel, #fff); }
.management-shell > .dialog-header, .management-shell > .dialog-footer { padding: 1.1rem 1.35rem; flex: none; }
.management-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
  padding: 0 1.35rem 1rem;
}
.management-stats span {
  display: flex;
  flex-direction: column;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: .9rem;
  background: var(--surface-soft, #f7f8f5);
  color: var(--muted);
  font-size: .78rem;
}
.management-stats strong { color: var(--text); font-size: 1.55rem; line-height: 1.1; }
.management-tabs { display: flex; gap: .3rem; padding: 0 1.35rem .85rem; overflow-x: auto; border-bottom: 1px solid var(--border); }
.management-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  padding: .58rem .78rem;
  border-radius: .65rem;
  white-space: nowrap;
  cursor: pointer;
}
.management-tabs button.active { background: #edf2ec; color: #294532; }
.management-content { padding: 1.1rem 1.35rem; overflow: auto; min-height: 240px; }
.management-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: .95rem;
  background: #fff;
  margin-bottom: .8rem;
}
.management-card h3 { margin: .35rem 0 .2rem; }
.management-card p { margin: .2rem 0; color: var(--muted); }
.management-card blockquote { margin: .75rem 0 0; padding: .7rem .85rem; background: #f7f8f5; border-left: 3px solid #8ca28e; border-radius: 0 .6rem .6rem 0; }
.management-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; max-width: 390px; }
.user-management-card { grid-template-columns: minmax(210px, .75fr) minmax(330px, 1.25fr); }
.user-admin-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.user-admin-fields label { margin: 0; }
.user-admin-fields textarea, .user-admin-fields button { grid-column: 1 / -1; }
.revision-entry { padding: .9rem 0; border-bottom: 1px solid var(--border); }
.revision-entry > div { display: flex; justify-content: space-between; gap: 1rem; }
.revision-entry span, .revision-entry small { color: var(--muted); }
.revision-entry p { margin: .4rem 0; }
.revision-entry button { margin-top: .65rem; }
.empty-state.compact { min-height: 180px; padding: 2rem; }

@media (max-width: 760px) {
  .management-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-card, .user-management-card { grid-template-columns: 1fr; }
  .management-card-actions { justify-content: flex-start; max-width: none; }
  .user-admin-fields { grid-template-columns: 1fr; }
  .account-rank-section > div { align-items: flex-start; flex-direction: column; gap: .55rem; }
}

/* Smulboek 0.10.1: veilige Markdown-opmaak aan De Keukentafel */
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p { margin: 0 0 1rem; }
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 1.65em 0 .65em;
  color: var(--text);
  line-height: 1.2;
}
.markdown-body h2 { font-size: clamp(1.45rem, 2.2vw, 1.9rem); }
.markdown-body h3 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); }
.markdown-body h4 { font-size: 1.08rem; }
.markdown-body ul,
.markdown-body ol { margin: .7rem 0 1rem; padding-left: 1.5rem; }
.markdown-body li { margin: .32rem 0; }
.markdown-body li::marker { color: var(--accent-dark); font-weight: 800; }
.markdown-body blockquote {
  margin: 1rem 0;
  padding: .85rem 1rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--surface-2);
  color: var(--muted);
}
.markdown-body blockquote > :last-child { margin-bottom: 0; }
.markdown-body hr { margin: 1.7rem 0; border: 0; border-top: 1px solid var(--border); }
.markdown-body code {
  padding: .12em .35em;
  border-radius: 6px;
  background: #eee9df;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .9em;
}
.markdown-body pre {
  max-width: 100%;
  margin: 1rem 0;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 12px;
  background: #1f2924;
  color: #f7f5ef;
}
.markdown-body pre code { padding: 0; background: transparent; color: inherit; }
.markdown-body a { color: var(--accent-dark); font-weight: 700; text-decoration-thickness: .08em; text-underline-offset: .16em; }
.markdown-body del { color: var(--muted); }
.markdown-table-wrap { max-width: 100%; margin: 1rem 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.markdown-body table { width: 100%; min-width: 480px; border-collapse: collapse; background: var(--surface); }
.markdown-body th,
.markdown-body td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.markdown-body th { background: var(--surface-2); font-weight: 850; }
.markdown-body tbody tr:last-child td { border-bottom: 0; }
.markdown-body .task-list { padding-left: 0; list-style: none; }
.markdown-body .task-list-item { display: flex; align-items: flex-start; gap: .55rem; }
.markdown-body .task-list-item input { width: 1rem; height: 1rem; margin-top: .35rem; accent-color: var(--accent); }
.markdown-help { display: block; margin-top: .4rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }

/* Smulboek 0.11: Mijn Smulboek, filters, juridische pagina's en mobiele verfijning */
.toast {
  z-index: 2147483647;
  bottom: max(1.2rem, env(safe-area-inset-bottom));
}

.hero > div:first-child { min-width: 0; }
#followCategoryButton { margin-top: .65rem; }

.advanced-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  align-items: end;
  margin: -1rem 0 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 4px 18px rgba(35, 41, 36, .04);
}
.advanced-filters label { display: grid; gap: .35rem; color: var(--muted); font-size: .82rem; font-weight: 750; }
.advanced-filters select {
  min-width: 0;
  width: 100%;
  padding: .68rem .75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--text);
}
.advanced-filters .checkbox-label { display: flex; align-items: center; gap: .55rem; min-height: 42px; color: var(--text); }
.advanced-filters .checkbox-label input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.filter-toggle { white-space: nowrap; }
.filter-count { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; margin-left: .3rem; padding: 0 .35rem; border-radius: 999px; background: var(--accent); color: white; font-size: .72rem; }

.made-badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .5rem;
  border-radius: 999px;
  background: #e7f1e8;
  color: #28613a;
  font-size: .68rem;
  font-weight: 850;
  white-space: nowrap;
}
.card-top { justify-content: flex-start; align-items: center; }
.card-top .favorite-button { margin-left: auto; }

.personal-cooking-panel {
  display: grid;
  gap: .75rem;
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid #cbd9cc;
  border-radius: 16px;
  background: #f2f7f2;
}
.personal-cooking-panel h3,
.personal-cooking-panel p { margin: 0; }
.personal-cooking-panel p { color: var(--muted); font-size: .84rem; }
.personal-cooking-panel textarea {
  width: 100%;
  resize: vertical;
  padding: .75rem .85rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: white;
}
.personal-cooking-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }

.my-smulboek-page,
.legal-page { width: 100%; }
.my-smulboek-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.my-smulboek-hero h1 { margin-bottom: .45rem; }
.my-smulboek-hero p:not(.eyebrow) { margin: 0; color: var(--muted); }
.collection-section {
  margin: 1.2rem 0 2rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 253, 248, .65);
}
.collection-section > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.collection-section h2 { margin: .15rem 0; }
.collection-section header p:not(.eyebrow) { margin: .3rem 0 0; color: var(--muted); }
.collection-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.following-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.following-grid section { padding: 1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.following-card {
  width: 100%;
  display: grid;
  gap: .2rem;
  margin: .45rem 0;
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  text-align: left;
}
.following-card span { color: var(--muted); font-size: .82rem; }

.collection-choice-list { display: grid; gap: .55rem; max-height: 55vh; overflow: auto; }
.collection-choice-list label {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.collection-choice-list input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.collection-choice-list span { display: grid; }
.collection-choice-list small { color: var(--muted); }
.quick-collection-form { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: end; margin-top: 1rem; }
.quick-collection-form label { display: grid; gap: .35rem; font-weight: 750; }
.quick-collection-form input { width: 100%; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px; }

.legal-document {
  width: min(860px, 100%);
  margin: 1rem auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.legal-document.markdown-body h1 { font-size: clamp(2rem, 4vw, 3rem); }
.site-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .8rem 1.25rem;
  padding: 1.4rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: .82rem;
}
.site-footer a { color: var(--accent-dark); font-weight: 700; }

.notification-preferences-grid { display: grid; gap: .45rem; }
.notification-preference-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: .8rem;
  align-items: center;
  padding: .65rem .75rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: white;
}
.notification-preference-row > span { font-weight: 700; }
.notification-preference-row label { display: flex; align-items: center; gap: .35rem; margin: 0; white-space: nowrap; font-size: .82rem; }
.notification-preference-row input { accent-color: var(--accent); }
.account-action-row { display: flex; flex-wrap: wrap; gap: .65rem; }
.legal-consent { align-items: flex-start !important; }
.legal-consent a { color: var(--accent-dark); }
.honeypot-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

@media (max-width: 1050px) {
  .advanced-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-wrap: wrap; }
  .topbar-actions { margin-left: auto; }
}

@media (max-width: 760px) {
  .topbar { min-height: 68px; padding: .55rem .7rem; gap: .45rem; }
  .brand { gap: .5rem; }
  .brand-mark { width: 40px; height: 40px; border-radius: 11px; font-size: 1.35rem; }
  .brand small { display: none; }
  .topbar-actions { gap: .35rem; min-width: 0; }
  .topbar-navigation { order: 2; }
  .topbar-utilities { gap: .3rem; padding-left: .35rem; border-left: 0; }
  .topbar .button, .topbar .icon-button, .topbar .sync-status { min-height: 40px; }
  .topbar .button { padding: .6rem .72rem; }
  .sync-status span:last-child { display: none; }
  .sync-status { min-width: 30px; padding: 0 .35rem; }
  #addButton { font-size: 0; }
  #addButton::after { content: "+"; font-size: 1.15rem; }
  .account-button { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .sidebar { top: 68px; height: calc(100vh - 68px); }
  .content { padding: 1rem .75rem 3rem; }
  .hero { grid-template-columns: 1fr; gap: 1rem; padding: 1rem 0 1.25rem; }
  .filter-row { align-items: stretch; flex-wrap: wrap; }
  .chips { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: thin; }
  .select-wrap { margin-left: auto; }
  .advanced-filters { grid-template-columns: 1fr; margin-top: -.75rem; }
  .card-grid { grid-template-columns: 1fr; }
  .card { min-height: auto; }
  .detail-dialog, .editor-dialog, .auth-dialog, .management-dialog { width: 100vw; max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .detail-dialog article, .editor-dialog form, .account-shell, .management-shell { min-height: 100%; max-height: 100dvh; padding: 1rem; }
  .detail-actions .button { flex: 1 1 auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: auto; }
  .my-smulboek-hero { align-items: stretch; flex-direction: column; padding: 1.1rem; }
  .collection-section > header { flex-direction: column; }
  .following-grid { grid-template-columns: 1fr; }
  .notification-preference-row { grid-template-columns: 1fr 1fr; }
  .notification-preference-row > span { grid-column: 1 / -1; }
  .quick-collection-form { grid-template-columns: 1fr; }
  .site-footer { padding-bottom: calc(1.4rem + env(safe-area-inset-bottom)); }
  .cook-shell { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
}

@media (max-width: 430px) {
  .topbar-navigation .topbar-link { font-size: 0; padding: .55rem .65rem; }
  .topbar-navigation .topbar-link::after { content: "💬"; font-size: 1rem; }
  .brand strong { font-size: .95rem; }
  .notification-preference-row { grid-template-columns: 1fr; }
  .notification-preference-row > span { grid-column: auto; }
  .profile-tabs { overflow-x: auto; }
  .profile-tab { white-space: nowrap; }
}

/* Smulboek 0.11.1: server-side SEO fallback en mobiele herstelronde */
html { overflow-x: hidden; }
body { overflow-x: hidden; }
.open-button,
.forum-topic-title { text-decoration: none; }

.seo-fallback { min-height: 100vh; background: var(--bg); }
html.js-ready .seo-fallback { display: none; }
html:not(.js-ready) body.seo-route > .skip-link,
html:not(.js-ready) body.seo-route > .topbar,
html:not(.js-ready) body.seo-route > .app-shell,
html:not(.js-ready) body.seo-route > .site-footer,
html:not(.js-ready) body.seo-route > dialog,
html:not(.js-ready) body.seo-route > .toast { display: none; }
.seo-page { width: min(980px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.25rem, 4vw, 3rem) 0 4rem; }
.seo-page a { color: var(--accent-dark); }
.seo-page > header,
.seo-recipe-page > article { padding: clamp(1.2rem, 4vw, 2.5rem); border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.seo-brand { display: inline-block; margin-bottom: 1rem; color: var(--green) !important; font-size: 1.15rem; font-weight: 900; text-decoration: none; }
.seo-library-page > header { margin-bottom: 1rem; }
.seo-library-page > header p { color: var(--muted); }
.seo-library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.seo-library-grid section { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.seo-library-grid h2 { margin: 0 0 .65rem; font-size: 1.1rem; }
.seo-library-grid ul { margin: 0; padding-left: 1.2rem; }
.seo-library-grid li { margin: .35rem 0; }
.seo-library-grid small { display: block; color: var(--muted); }
.seo-recipe-page > nav { display: flex; gap: .45rem; margin: 0 0 1rem; color: var(--muted); font-size: .9rem; }
.seo-eyebrow { margin: 0; color: var(--accent-dark); font-size: .8rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.seo-recipe-page h1 { margin: .35rem 0 .5rem; }
.seo-byline { color: var(--muted); }
.seo-summary { font-size: 1.1rem; color: var(--muted); }
.seo-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.5rem; }
.seo-meta span { padding: .4rem .65rem; border-radius: 999px; background: var(--surface-2); font-size: .85rem; }
.seo-ingredients { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .45rem 1rem; padding-left: 1.2rem; }
.seo-steps { list-style: none; padding: 0; counter-reset: none; }
.seo-steps li { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.seo-steps li > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-weight: 850; }
.seo-steps p { margin: .25rem 0 0; }
.seo-tips { margin-top: 1.25rem; padding: 1rem; border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; background: #f7ece5; }
.seo-open-app { margin-top: 1.5rem; font-weight: 800; }

@media (max-width: 760px) {
  .topbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: 44px 44px;
    align-items: center;
    min-height: 108px;
    padding: .5rem .65rem;
    gap: .3rem .55rem;
  }
  .topbar > .mobile-only { grid-column: 1; grid-row: 1; }
  .brand { grid-column: 2; grid-row: 1; min-width: 0; margin: 0; }
  .brand > span:last-child { min-width: 0; }
  .brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    margin: 0;
    justify-content: space-between;
    gap: .35rem;
  }
  .topbar-navigation { flex: 0 0 auto; min-width: 0; }
  .topbar-utilities { flex: 1 1 auto; min-width: 0; justify-content: flex-end; padding-left: .35rem; border-left: 0; }
  .sync-status { display: none; }
  .topbar .button,
  .topbar .icon-button { min-height: 40px; }
  .topbar .button { padding: .55rem .68rem; }
  .account-button { max-width: min(128px, 34vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar { top: 108px; height: calc(100dvh - 108px); }
  .app-shell { min-height: calc(100dvh - 108px); }
  .content { width: 100%; min-width: 0; padding: 1rem .75rem 3rem; }
  .hero h1,
  .forum-hero h1,
  .forum-list-header h1,
  .forum-topic-detail h1 { overflow-wrap: anywhere; }
  .filter-row { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .chips { grid-column: 1 / -1; }
  .select-wrap { max-width: 100%; margin: 0; }
  .select-wrap select { min-width: 0; max-width: 100%; }
  .detail-dialog,
  .editor-dialog,
  .auth-dialog,
  .management-dialog { inset: 0; margin: 0; overflow: hidden; }
  .detail-dialog article,
  .editor-dialog form,
  .account-shell,
  .management-shell { width: 100%; max-width: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .dialog-header { position: sticky; top: -1rem; z-index: 5; padding: .75rem 0; background: var(--surface); }
  .dialog-footer { position: sticky; bottom: -1rem; z-index: 5; padding: .75rem 0 max(.75rem, env(safe-area-inset-bottom)); background: var(--surface); }
  .detail-header,
  .forum-topic-detail-header,
  .forum-post header { min-width: 0; }
  .detail-header { flex-direction: column; }
  .detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-actions .button { width: 100%; min-width: 0; }
  .ingredient-list,
  .seo-ingredients { grid-template-columns: 1fr; }
  .forum-topic-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .forum-topic-actions .button { width: 100%; min-width: 0; }
  .forum-topic-row { align-items: start; }
  .forum-topic-byline { flex-wrap: wrap; }
  .forum-topic-stats { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; min-width: 0; text-align: left; }
  .forum-category-card { grid-template-columns: auto minmax(0,1fr); }
  .forum-category-count { grid-column: 2; min-width: 0; text-align: left; }
  .notification-preference-row label { min-width: 0; }
  .seo-library-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .brand-mark { width: 38px; height: 38px; font-size: 1.2rem; }
  .topbar-navigation .topbar-link { width: 40px; padding-inline: 0; }
  .notification-button { width: 40px; }
  #addButton { width: 40px; padding-inline: 0; }
  .account-button { max-width: 112px; }
  .detail-actions,
  .forum-topic-actions { grid-template-columns: 1fr; }
  .dialog-footer { flex-wrap: wrap; }
  .dialog-footer .spacer { display: none; }
  .dialog-footer .button { flex: 1 1 calc(50% - .4rem); }
  .seo-page { width: min(100% - 1rem, 980px); padding-top: .5rem; }
  .seo-page > header,
  .seo-recipe-page > article { padding: 1rem; border-radius: 16px; }
}
.seo-fallback:empty { display: none; min-height: 0; }
