/* Niblio app layout — screens, overlays and app-only pieces built on tokens.css + niblio.css. */

html { -webkit-text-size-adjust: 100%; }
/* Nothing may widen the page sideways on small phones (clip, unlike hidden, keeps sticky bars working). */
html, body { max-width: 100%; overflow-x: clip; }
body { min-height: 100dvh; }
.nb-btn { max-width: 100%; }
.nb-field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.nb-field, .nb-input, .nb-select, .nb-textarea { min-width: 0; }
@media (max-width: 359px) { .nb-field-row { grid-template-columns: minmax(0, 1fr); } }
.nb-btn-block, .nb-join-code .nb-btn, .nb-claim, .nb-actionbar .nb-btn { white-space: normal; text-align: center; height: auto; min-height: var(--control-height); padding-top: 10px; padding-bottom: 10px; line-height: 1.25; }
.nb-btn-sm.nb-btn-block { min-height: var(--control-height-sm); padding-top: 6px; padding-bottom: 6px; }
[hidden] { display: none !important; }
button { font-family: inherit; }
img { max-width: 100%; }
a { color: var(--brand-ink); }

/* ---------- background pattern (every screen) ---------- */
/* The food doodle pattern sits behind everything. Cards and sheets stay solid, so text is never on top of it
   except headings on the page itself. In dark mode it is inverted and screen-blended so it stays dark. */
body { background: var(--surface); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("/assets/food-doodle-pattern.webp") center / cover no-repeat; opacity: .42; }
[data-theme="dark"] body::before { opacity: .3; filter: invert(1) brightness(1.2); mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { opacity: .3; filter: invert(1) brightness(1.2); mix-blend-mode: screen; } }

/* ---------- app column ---------- */
#app { min-height: 100dvh; max-width: var(--content-max); margin: 0 auto; background: transparent; position: relative; display: flex; flex-direction: column; }
@media (min-width: 640px) and (max-width: 1023px) {
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
.nb-screen { flex: 1; display: flex; flex-direction: column; min-height: 100dvh; }
.nb-screen > .nb-screen-body { flex: 1; padding-bottom: var(--space-8); }
.nb-screen-body > section { display: block; }
.nb-appbar-logo-btn { border: 0; background: none; padding: 0; cursor: pointer; display: inline-flex; }
/* The avatar inside the profile button: a flex box so it centers in the 44px circle (an inline span sat on the text baseline). */
/* A photo that fails to load falls back to the theme color (heroes) or a neutral tile (thumbnails). */
.nb-hero.is-photo-missing .nb-hero-shade { display: none; }
.nb-event-thumb-photo.is-photo-missing { background: var(--banner-navy); }
.nb-event-thumb-photo.is-photo-missing::after { display: none; }
[data-me-avatar] { display: flex; align-items: center; justify-content: center; line-height: 0; }

/* ---------- swipe-to-dismiss sheets ---------- */
.nb-sheet-grab { box-sizing: content-box; padding: 10px 48px; margin: -10px auto 2px; background-clip: content-box; cursor: grab; touch-action: none; }
.nb-sheet.is-dragging { transition: none !important; }

/* ---------- loading ---------- */
.nb-loading { flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--space-12); }
.nb-spinner { width: 32px; height: 32px; border-radius: var(--radius-pill); border: 3px solid var(--brand-tint); border-top-color: var(--brand); animation: nb-spin .8s linear infinite; }
@keyframes nb-spin { to { transform: rotate(360deg); } }
.nb-skeleton { background: var(--surface-sunken); border-radius: var(--radius-md); animation: nb-pulse 1.2s ease-in-out infinite; }
@keyframes nb-pulse { 50% { opacity: .55; } }
.nb-btn .nb-spinner { width: 18px; height: 18px; border-width: 2px; border-color: rgba(255,255,255,.35); border-top-color: currentColor; }

/* ---------- home ---------- */
.nb-home-sections { display: flex; flex-direction: column; gap: var(--space-6); }
.nb-past summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font: 600 19px/26px var(--font-display); padding: var(--space-1) 0; }
.nb-past summary::-webkit-details-marker { display: none; }
.nb-past summary .nb-icon { transition: transform .15s; color: var(--ink-muted); }
.nb-past[open] summary .nb-icon { transform: rotate(180deg); }
.nb-past .nb-stack { margin-top: var(--space-3); }
.nb-event-past { opacity: .8; }
.nb-join-code { text-align: center; }
.nb-home-pad { height: 72px; }

/* ---------- event screen ---------- */
.nb-event-top { position: relative; }
.nb-event-top .nb-appbar-overlay { top: 8px; }
.nb-hero { min-height: 240px; }
.nb-hero-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); background: rgba(255,255,255,.18); color: #ffffff; font: 600 12px/1 var(--font-text); margin-bottom: var(--space-2); }
.nb-description { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.nb-description-card { padding: var(--space-4); }
.nb-description-card h3 { margin: 0 0 var(--space-2); font: 600 16px/22px var(--font-display); }
.nb-rsvp-notes { padding: var(--space-3) 0; border-top: 1px solid var(--line); font: 400 14px/20px var(--font-text); color: var(--ink-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.nb-rsvp-notes b { color: var(--ink); font-weight: 600; }
.nb-dish-link { border: 0; background: none; padding: 0; cursor: pointer; }
.nb-rsvp-empty { padding: var(--space-3) 0; border-top: 1px solid var(--line); font: 400 14px/20px var(--font-text); color: var(--ink-muted); }
.nb-list-empty { text-align: center; padding: var(--space-6) var(--space-4); color: var(--ink-muted); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); }
.nb-host-tools { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ---------- preview (not joined) ---------- */
.nb-preview-note { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--brand-tint); color: var(--brand-ink); font: 500 14px/20px var(--font-text); }

/* ---------- sheets ---------- */
.nb-overlay { position: fixed; inset: 0; z-index: var(--z-sheet); display: flex; align-items: flex-end; justify-content: center; background: var(--scrim); opacity: 0; transition: opacity .2s ease; }
.nb-overlay.is-open { opacity: 1; }
.nb-overlay .nb-sheet { max-height: calc(100dvh - 24px); display: flex; flex-direction: column; padding: var(--space-2) 0 0; overflow: hidden; transform: translateY(24px); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.nb-overlay.is-open .nb-sheet { transform: none; }
.nb-sheet-head { padding: 0 var(--space-2) 0 var(--space-4); margin-bottom: var(--space-2); }
.nb-sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: var(--space-2) var(--space-4) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.nb-sheet-foot { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface-raised); }
.nb-sheet-foot .nb-btn-primary, .nb-sheet-foot .nb-btn-danger { flex: 1; }
.nb-sheet-message { margin: 0; color: var(--ink-muted); }
/* Tablets and computers: a centered dialog, rounded on all corners, that fades and scales in. */
@media (min-width: 640px) {
  .nb-overlay { align-items: center; padding: var(--space-8) var(--space-6); }
  .nb-overlay .nb-sheet { border-radius: var(--radius-lg); max-width: 520px; max-height: min(780px, calc(100dvh - 64px)); padding-top: var(--space-4);
    border: 1px solid var(--line); transform: translateY(8px) scale(.97); transition: transform .18s ease-out; }
  .nb-overlay.is-open .nb-sheet { transform: none; }
  .nb-sheet-grab { display: none; }
  .nb-sheet-head { padding: 0 var(--space-3) 0 var(--space-6); }
  .nb-sheet-body { padding: var(--space-2) var(--space-6) var(--space-6); }
  .nb-sheet-foot { padding: var(--space-4) var(--space-6); background: var(--surface); justify-content: flex-end; }
  .nb-sheet-foot .nb-btn-primary, .nb-sheet-foot .nb-btn-danger { flex: 0 0 auto; min-width: 160px; }
  .nb-sheet-foot [data-delete] { margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .nb-overlay, .nb-overlay .nb-sheet { transition: none; }
}

/* ---------- menu (action sheet) ---------- */
.nb-menu { list-style: none; margin: 0; padding: 0; }
.nb-menu button { width: 100%; display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: 500 16px/22px var(--font-text); text-align: left; cursor: pointer; }
.nb-menu button:hover { background: var(--surface-sunken); }
.nb-menu .nb-icon { color: var(--ink-muted); }
.nb-menu .is-danger, .nb-menu .is-danger .nb-icon { color: var(--danger); }
.nb-menu li + li.is-sep { border-top: 1px solid var(--line); margin-top: var(--space-1); padding-top: var(--space-1); }

/* ---------- appearance ---------- */
.nb-appearance button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.nb-signin-appearance { position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 8px; z-index: 2; }

/* ---------- banners (install, update) ---------- */
.nb-banners { max-width: var(--content-max); margin: 0 auto; display: flex; flex-direction: column; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; }
.nb-banners:empty { display: none; }
.nb-banner { display: flex; align-items: center; gap: var(--space-3); padding: 10px 6px 10px 12px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.nb-banner-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; }
.nb-banner-icon-update { display: flex; align-items: center; justify-content: center; background: var(--amber-tint); color: var(--amber-ink); }
.nb-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nb-banner-text b { font: 600 15px/20px var(--font-text); }
.nb-banner-text span { font: 400 13px/18px var(--font-text); color: var(--ink-muted); }
.nb-banner .nb-btn { flex: none; }
.nb-install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nb-install-step { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); font: 400 15px/22px var(--font-text); }
.nb-install-step > span:nth-child(2) { flex: 1; }
.nb-install-num { width: 28px; height: 28px; flex: none; border-radius: var(--radius-pill); background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; font: 600 14px/1 var(--font-text); }
.nb-install-icon { width: 36px; height: 36px; flex: none; border-radius: 8px; background: var(--brand-tint); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; }
.nb-push-ask { width: 64px; height: 64px; margin: 4px auto 0; border-radius: var(--radius-pill); background: var(--amber-tint); color: var(--amber-ink); display: flex; align-items: center; justify-content: center; }
.nb-push-ask .nb-icon { width: 30px; height: 30px; }

/* ---------- toasts ---------- */
.nb-toasts { position: fixed; left: 0; right: 0; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: var(--z-toast); display: flex; flex-direction: column; align-items: center; gap: var(--space-2); pointer-events: none; padding: 0 var(--space-4); }
.nb-toasts .nb-toast { pointer-events: auto; max-width: 520px; animation: nb-toast-in .2s ease; }
body.nb-sheet-open .nb-toasts { top: calc(12px + env(safe-area-inset-top)); bottom: auto; }
.nb-toast-error { background: var(--danger); color: var(--on-danger); }
.nb-toast-error .nb-icon, .nb-toast-error button { color: var(--on-danger); }
@keyframes nb-toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- offline banner ---------- */
.nb-offline { position: sticky; top: 0; z-index: var(--z-toast); display: flex; align-items: center; justify-content: center; gap: var(--space-2); padding: 8px var(--space-4); background: var(--ink); color: var(--surface-raised); font: 600 13px/18px var(--font-text); }

/* ---------- forms ---------- */
.nb-form { display: flex; flex-direction: column; gap: var(--space-4); }
.nb-form-title { margin: 0; font: 600 22px/28px var(--font-display); }
.nb-form-sub { margin: 4px 0 0; color: var(--ink-muted); font: 400 15px/22px var(--font-text); }
.nb-form-section { display: flex; flex-direction: column; gap: var(--space-4); }
.nb-form-section + .nb-form-section { padding-top: var(--space-6); border-top: 1px solid var(--line); }
.nb-form-section-title { margin: 0; font: 600 19px/26px var(--font-display); }
.nb-check { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); cursor: pointer; }
.nb-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.nb-check-text { display: flex; flex-direction: column; }
.nb-check-text b { font: 600 15px/22px var(--font-text); }
.nb-check-text span { font: 400 13px/18px var(--font-text); color: var(--ink-muted); }
.nb-file { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
.nb-file-name { flex: 1; min-width: 0; font: 600 14px/20px var(--font-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-file-drop { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--space-4); border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md); background: transparent; color: var(--brand-ink); font: 600 15px/20px var(--font-text); cursor: pointer; }
.nb-file-drop small { font: 400 13px/18px var(--font-text); color: var(--ink-muted); }
.nb-file-drop.is-over { background: var(--brand-tint); border-color: var(--brand); }
.nb-visually-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nb-photo-preview { position: relative; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-sunken); }
.nb-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nb-photo-preview .nb-icon-btn { position: absolute; top: 8px; right: 8px; background: rgba(20,19,43,.55); color: #ffffff; }
.nb-swatch-photo { width: 100%; }
.nb-hero-mini { min-height: 132px; padding-top: var(--space-6); border-radius: var(--radius-md); }
.nb-hero-mini .nb-hero-title { font-size: 24px; line-height: 30px; }
.nb-form-actions-inline { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ---------- dish editor (RSVP) ---------- */
.nb-dish-editor { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4) var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); background: var(--surface); }
.nb-dish-editor-head { display: flex; align-items: center; justify-content: space-between; }
.nb-dish-editor-head b { font: 600 14px/20px var(--font-text); color: var(--ink-muted); }
.nb-link-btn { border: 0; background: none; padding: 0; color: var(--brand-ink); font: 600 14px/20px var(--font-text); cursor: pointer; align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; }
.nb-recipe-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: 400 15px/24px var(--font-text); }

/* ---------- profile ---------- */
.nb-profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); }
.nb-avatar-xl { --size: 88px; }
.nb-avatar-edit { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: var(--radius-pill); }
.nb-avatar-edit > span:last-child { position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: var(--radius-pill); background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--surface-raised); }
.nb-profile-name { margin: 0; font: 600 20px/26px var(--font-display); }
.nb-profile-email { margin: 0; color: var(--ink-muted); font: 400 14px/20px var(--font-text); overflow-wrap: anywhere; }
.nb-settings { list-style: none; margin: 0; padding: 0 var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.nb-settings li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.nb-settings li:last-child { border-bottom: 0; }
.nb-settings .nb-info-main { flex: 1; min-width: 0; }
.nb-settings .nb-icon { color: var(--brand); }
.nb-settings button.nb-row-btn { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); border: 0; background: none; color: var(--ink); font: 500 15px/22px var(--font-text); padding: 0; cursor: pointer; text-align: left; }
.nb-settings button.nb-row-btn .nb-icon { color: var(--ink-subtle); }
.nb-about { text-align: center; font: 400 13px/18px var(--font-text); color: var(--ink-muted); margin: 0; }
.nb-policy h3 { margin: var(--space-2) 0 0; font: 600 16px/22px var(--font-display); }
.nb-policy p, .nb-policy li { font: 400 15px/23px var(--font-text); color: var(--ink); }
.nb-policy p { margin: 0; }
.nb-policy ul, .nb-policy ol { margin: 0; padding-left: 20px; }

/* ---------- guests (host) ---------- */
.nb-guest { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.nb-guest:last-child { border-bottom: 0; }
.nb-guest-main { flex: 1 1 150px; min-width: 0; }
.nb-guest { flex-wrap: wrap; row-gap: var(--space-2); }
.nb-guest-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.nb-guest-actions:empty { display: none; }
.nb-guest-tip { display: flex; gap: var(--space-2); align-items: flex-start; margin: var(--space-3) 0 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--brand-tint); color: var(--brand-ink); font: 400 14px/20px var(--font-text); }
.nb-guest-tip svg { flex: none; margin-top: 2px; }
.nb-guest-name { font: 600 15px/20px var(--font-text); display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.nb-guest-sub { font: 400 13px/18px var(--font-text); color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-tag-success { background: var(--success-tint); color: var(--success); }

/* ---------- export ---------- */
.nb-export { margin: 0; padding: var(--space-3) var(--space-4); max-height: 46dvh; overflow: auto; background: var(--surface-sunken); border-radius: var(--radius-sm); font: 400 13px/20px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }

/* ---------- crop ---------- */
.nb-crop { width: 100%; }
.nb-crop .cr-slider-wrap { margin: var(--space-3) auto 0; }
.nb-crop .cr-viewport { box-shadow: 0 0 2000px 2000px rgba(20,19,43,.5); border-color: #ffffff; }

/* ---------- sign-in additions ---------- */
.nb-signin-card .nb-preview-event { margin-bottom: var(--space-1); }
.nb-signin-hero .nb-signin-logo { width: 220px; }
.nb-forgot { align-self: flex-end; }

/* ---------- page containers (phone first) ---------- */
.nb-page { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-6); }
.nb-event-aside, .nb-event-main { display: flex; flex-direction: column; gap: var(--space-6); }
.nb-home-top { display: flex; flex-direction: column; gap: var(--space-6); }
.nb-home-fab { position: fixed; right: max(16px, calc(50% - var(--content-max) / 2 + 16px)); bottom: calc(16px + env(safe-area-inset-bottom)); }
.nb-form-layout { gap: 20px; }
.nb-form-main { display: flex; flex-direction: column; gap: 20px; }
.nb-desktop-only { display: none !important; }
.nb-signin-card-title { margin: 0 0 var(--space-1); font: 600 22px/28px var(--font-display); }
.nb-signin-points { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); max-width: 440px; }
.nb-signin-points li { display: flex; gap: var(--space-3); align-items: flex-start; font: 400 16px/24px var(--font-text); color: var(--ink-muted); text-align: left; }
.nb-signin-points li b { color: var(--ink); font-weight: 600; }
.nb-signin-points .nb-icon { color: var(--brand); width: 24px; height: 24px; margin-top: 1px; }
.nb-aside-actions { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); }
.nb-aside-actions .nb-actionbar-note { justify-content: center; }
.nb-form-aside-card { display: flex; flex-direction: column; gap: var(--space-3); }

/* =========================================================
   Desktop (1024px and up): full-width chrome, centered 1120px content,
   two-column event and form pages, card grid on home, split sign-in.
   ========================================================= */
@media (min-width: 1024px) {
  :root { --desk-max: 1120px; --desk-gutter: max(24px, calc((100% - var(--desk-max)) / 2)); }
  #app { max-width: none; border: 0; }
  .nb-mobile-only { display: none !important; }
  .nb-desktop-only { display: revert !important; }
  .nb-btn.nb-desktop-only, .nb-aside-actions.nb-desktop-only { display: inline-flex !important; }
  .nb-aside-actions.nb-desktop-only { display: flex !important; }
  .nb-signin-points.nb-desktop-only { display: flex !important; }

  /* chrome */
  .nb-appbar { height: 64px; padding: 0 var(--desk-gutter); gap: var(--space-2); }
  .nb-appbar-logo { height: 36px; margin-left: 0; }
  .nb-appbar-title { font-size: 19px; }
  .nb-appbar-overlay { padding: 0 var(--desk-gutter); }
  .nb-page { padding: var(--space-8) var(--desk-gutter) var(--space-12); }
  .nb-toasts { bottom: 24px; }
  .nb-banners { max-width: var(--desk-max); padding: 12px 24px; }
  .nb-banner { max-width: 720px; margin: 0 auto; width: 100%; }

  /* home */
  .nb-home-top { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-6); }
  .nb-home-top .nb-greeting { font-size: 32px; line-height: 38px; }
  .nb-home-top .nb-you { max-width: 520px; }
  .nb-home .nb-stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--space-4); }
  .nb-home .nb-event { padding: var(--space-4); grid-template-columns: 72px 1fr; }
  .nb-home .nb-event-thumb { width: 72px; height: 72px; }
  .nb-home .nb-empty { max-width: 560px; margin: var(--space-8) auto 0; }
  .nb-home .nb-join-code, .nb-home .nb-home-pad { display: none; }
  .nb-past summary { max-width: 260px; }

  /* event + preview: hero spans the width, content in two columns */
  .nb-hero { min-height: 300px; padding: 96px var(--desk-gutter) var(--space-8); }
  .nb-hero-title { font-size: 44px; line-height: 50px; max-width: 760px; }
  .nb-hero-mini { min-height: 150px; padding: var(--space-6) var(--space-4) var(--space-4); }
  .nb-hero-mini .nb-hero-title { font-size: 24px; line-height: 30px; }
  .nb-event-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-8); align-items: start; }
  .nb-event-main { grid-column: 1; grid-row: 1; }
  .nb-event-aside { grid-column: 2; grid-row: 1; position: sticky; top: var(--space-6); gap: var(--space-4); }
  .nb-event-aside .nb-section-title { font-size: 17px; }
  .nb-event-main .nb-stack { gap: var(--space-3); } /* one full-width column, like on phones */

  /* create / edit */
  .nb-form-layout { display: grid; grid-template-columns: minmax(0, 680px) 360px; justify-content: center; gap: var(--space-8); align-items: start; }
  .nb-form-aside { position: sticky; top: calc(64px + var(--space-6)); }
  .nb-form-main .nb-form-section + .nb-form-section { padding-top: var(--space-8); }
  .nb-form-main .nb-stepper-row { padding: 12px 0; }
  .nb-form-main .nb-themes, .nb-form-main .nb-swatch-photo { max-width: 520px; }
  .nb-form-main .nb-photo-preview { max-width: 520px; }

  /* sign-in: brand on the left, card on the right */
  .nb-signin { display: grid; grid-template-columns: minmax(0, 1fr) 440px; align-items: center; gap: var(--space-12); padding: var(--space-12) var(--desk-gutter); min-height: 100dvh; }
  .nb-signin-hero { padding: 0; align-items: flex-start; text-align: left; justify-content: center; }
  .nb-signin-hero .nb-signin-logo { width: 300px; }
  .nb-signin-hero p { font-size: 30px; line-height: 38px; max-width: 460px; margin-top: var(--space-6); text-wrap: balance; }
  .nb-signin-card { border-radius: var(--radius-lg); padding: var(--space-8); border: 1px solid var(--line); }

  /* sheets as dialogs; wide ones for tables and text */
  .nb-overlay .nb-sheet { max-width: 560px; }
  .nb-overlay .nb-sheet.nb-sheet-wide { max-width: 760px; }
  .nb-export { max-height: 56dvh; }
}

/* Guided tour invite card (dashboard). The tour itself lives on tour.html. */
.nb-screen-body > .nb-tour-invite, .nb-tour-invite { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon title" "text text" "actions actions";
  column-gap: 12px; align-items: center; padding: 16px 48px 16px 16px; border-radius: var(--radius-lg); background: var(--brand-tint); color: var(--brand-ink);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent); }
.nb-tour-invite h2 { grid-area: title; margin: 0; font: 600 16px/22px var(--font-display); color: var(--brand-ink); }
.nb-tour-invite p { grid-area: text; margin: 8px 0 0; font: 400 14px/20px var(--font-text); color: var(--brand-ink); opacity: .85; }
.nb-tour-invite-icon { grid-area: icon; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: var(--on-brand); }
.nb-tour-invite-x { position: absolute; top: 6px; right: 6px; color: var(--brand-ink); }
.nb-tour-invite-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; }


/* ---------- scrollbars ----------
   Slim, rounded, theme-colored scrollbars everywhere, with no arrow buttons.
   Chromium and Safari use the ::-webkit-scrollbar styles (they allow insets, so bars stay clear of rounded
   sheet corners); Firefox uses the standard properties. */
:root { color-scheme: light dark; --scroll-thumb: color-mix(in srgb, var(--ink) 24%, transparent); --scroll-thumb-hover: color-mix(in srgb, var(--ink) 40%, transparent); }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }
/* Keep the bar inside a sheet's rounded corners */
.nb-sheet-body::-webkit-scrollbar-track { margin: 4px 0 18px; }
.nb-export::-webkit-scrollbar-track { margin: 6px 0; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
}
.nb-chips::-webkit-scrollbar { display: none; }

/* Password field with a show/hide eye */
.nb-password { position: relative; display: block; }
.nb-password .nb-input { width: 100%; padding-right: 48px; }
.nb-password-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-muted); cursor: pointer; }
.nb-password-toggle:hover { color: var(--ink); background: var(--surface-sunken); }
.nb-password-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.nb-password .nb-input::-ms-reveal { display: none; }
/* Co-host crown: outlined to offer, filled amber when the guest is a co-host */
.nb-cohost-btn { color: var(--ink-muted); }
.nb-cohost-btn:hover { color: var(--brand); }
.nb-cohost-btn[aria-pressed="true"] { color: var(--amber-ink, #9a6200); }
.nb-cohost-btn[aria-pressed="true"] svg { fill: var(--amber); stroke: var(--amber-ink, #9a6200); }
.nb-guest-tip svg { display: inline; vertical-align: -2px; }
