  :root {
    --gold: #C9A84C;
    --gold-light: #E8D5A3;
    --black: #1A1409;
    --cream: #F5F0E8;
    --card: #FFFEF9;
    --border: #E2D9C5;
    --text: #1A1409;
    --muted: #6B7280;
    --ale: #8B4513;
    --red: #9B2335;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    background: var(--cream);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
  }

  /* ── GATE ── */
  #gate {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    background: var(--black);
    background-image:
      radial-gradient(ellipse at 20% 50%, rgba(201,168,76,0.12) 0%, transparent 60%),
      radial-gradient(ellipse at 80% 20%, rgba(139,69,19,0.15) 0%, transparent 50%);
  }
  .gate-logo { display: inline-flex; gap: 8px; margin-bottom: 1.5rem; }
  .gate-logo span {
    display: inline-block;
    background: var(--gold);
    color: var(--black);
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    width: 3.5rem;
    height: 3.5rem;
    line-height: 3.5rem;
    text-align: center;
  }
  .gate-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
    color: #F5F0E8;
  }
  .gate-sub {
    font-size: 0.85rem;
    color: var(--gold-light);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
  }
  .gate-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2rem;
    max-width: 340px;
    width: 100%;
    text-align: left;
  }
  .gate-box label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
  }
  .gate-box input, .gate-box select {
    width: 100%;
    background: var(--cream);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.7rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    border-radius: 3px;
  }
  .gate-box input:focus, .gate-box select:focus { border-color: var(--gold); }
  .gate-box select option { background: var(--card); }
  .gate-error { color: var(--red); font-size: 0.85rem; margin-top: 0.5rem; display: none; }
  .btn-gold {
    width: 100%;
    background: var(--gold);
    color: var(--black);
    border: none;
    border-radius: 3px;
    padding: 0.85rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
  }
  .btn-gold:hover { background: var(--gold-light); }

  /* ── HEADER ── */
  .site-header {
    text-align: center;
    padding: 1.5rem 1rem 1rem;
    border-bottom: 1px solid var(--border);
    position: relative;
  }
  .site-logo { display: inline-flex; gap: 6px; margin-bottom: 0.4rem; }
  .site-logo span {
    display: inline-block;
    background: var(--gold);
    color: var(--black);
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    width: 2.2rem;
    height: 2.2rem;
    line-height: 2.2rem;
    text-align: center;
    border-radius: 2px;
  }
  .site-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.1rem;
  }
  .site-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
  }
  .header-user {
    margin-top: 0.5rem;
    text-align: center;
    line-height: 1.4;
  }
  .header-user span {
    display: inline;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--muted);
  }
  .header-user button {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0;
    margin-left: 0.75rem;
    font-family: 'DM Sans', sans-serif;
  }
  .header-user button:hover { color: var(--gold); }

  /* ── NAV ── */
  .nav-links {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .nav-links a {
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    padding: 0.75rem 1.2rem;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.2s;
  }
  .nav-links a:hover { color: var(--text); }
  .nav-links a.active { color: var(--gold); border-bottom-color: var(--gold); }

  /* ── VIEWS ── */
  .view { display: none; }
  .view.active { display: block; }

  .main-wrap { max-width: 700px; margin: 0 auto; padding: 1.5rem 1rem; }

  .section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 0.25rem;
  }
  .section-sub {
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    font-style: italic;
  }
  .loading-msg { color: var(--muted); font-style: italic; font-size: 0.95rem; padding: 2rem 0; text-align: center; }

  /* ── AGENDA ── */
  .day-header {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--ale);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
    margin: 1.5rem 0 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
  }
  .day-header:first-child { margin-top: 0; }
  .day-header .day-chevron { transition: transform 0.2s; font-size: 0.7rem; }
  .day-header.collapsed .day-chevron { transform: rotate(-90deg); }
  .day-items { }
  .day-items.collapsed { display: none; }
  .card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 1.2rem 1.5rem;
    margin-bottom: 0.75rem;
  }
  .agenda-time {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    color: var(--text);
    background: rgba(26,20,9,0.06);
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    margin-bottom: 0.4rem;
  }
  .agenda-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
  }
  .agenda-desc {
    font-size: 0.9rem;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 0.6rem;
  }

  /* ── COMMENTS ── */
  .comments-toggle {
    background: none;
    border: none;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
  }
  .comments-toggle:hover { color: var(--gold); }
  .comments-list { display: none; margin-top: 0.75rem; }
  .comments-list.open { display: block; }
  .comment-item {
    padding: 0.5rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
  }
  .comment-author {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--gold);
    margin-bottom: 0.1rem;
  }
  .comment-input-row { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
  .comment-input-row input {
    flex: 1;
    background: var(--cream);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    outline: none;
    border-radius: 3px;
  }
  .comment-input-row input:focus { border-color: var(--gold); }

  /* ── CHAT ── */
  .chat-feed {
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }
  .chat-message { display: flex; flex-direction: column; max-width: 75%; }
  .chat-message.mine { align-self: flex-end; align-items: flex-end; }
  .chat-message.theirs { align-self: flex-start; align-items: flex-start; }
  .chat-bubble {
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
  }
  .chat-message.mine .chat-bubble { background: var(--gold); color: var(--black); }
  .chat-message.theirs .chat-bubble { background: var(--card); border: 1px solid var(--border); color: var(--text); }
  .chat-author {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--gold);
    margin-bottom: 0.2rem;
  }
  .chat-message.mine .chat-author { text-align: right; color: var(--muted); }
  .chat-meta { font-size: 0.65rem; color: var(--muted); margin-top: 0.2rem; }
  .chat-input-row { display: flex; gap: 0.5rem; }
  .chat-input-row input {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.7rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    outline: none;
  }
  .chat-input-row input:focus { border-color: var(--gold); }

  /* ── IDEAS ── */
  .idea-input-row { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
  .idea-input-row input {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.7rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    outline: none;
  }
  .idea-input-row input:focus { border-color: var(--gold); }
  .idea-item {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 1rem 1.2rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  .idea-text { font-size: 1rem; margin-bottom: 0.2rem; }
  .idea-author { font-size: 0.75rem; color: var(--muted); font-style: italic; }
  .vote-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .vote-btn:hover { border-color: var(--gold); color: var(--gold); }

  /* ── PHOTOS ── */
  .photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
  .photo-item { cursor: pointer; }
  .photo-item img,
  .photo-item video {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
  }
  .photo-item img:hover,
  .photo-item .video-thumb:hover { border-color: var(--gold); }
  /* Video thumbnail wrapper — shows play icon overlay */
  .video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
    background: var(--black);
  }
  .video-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    aspect-ratio: unset;
    pointer-events: none;
  }
  .video-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    transition: background 0.2s;
  }
  .video-thumb:hover .video-play-icon { background: rgba(0,0,0,0.55); }
  .video-play-icon::after {
    content: '▶';
    color: white;
    font-size: 2rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  }
  .media-badge {
    display: inline-block;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--gold);
    color: var(--black);
    padding: 0.1rem 0.35rem;
    border-radius: 2px;
    margin-right: 0.25rem;
    font-weight: 500;
    vertical-align: middle;
  }
  .photo-caption { font-size: 0.75rem; color: var(--muted); padding: 0.1rem 0; font-style: italic; }
  .photo-uploader {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--gold);
    padding-top: 0.3rem;
  }
  .photo-day {
    font-size: 0.68rem;
    color: var(--muted);
    letter-spacing: 0.05em;
  }
  .upload-label {
    display: inline-block;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.7rem 1.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
  }
  .upload-label:hover { border-color: var(--gold); color: var(--gold); }

  /* ── ADMIN ── */
  .admin-section {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .admin-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
  }
  .admin-field { margin-bottom: 0.8rem; }
  .admin-field label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.3rem;
  }
  .admin-field input, .admin-field select, .admin-field textarea {
    width: 100%;
    background: var(--cream);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 0.8rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    outline: none;
    border-radius: 3px;
  }
  .admin-field input:focus, .admin-field select:focus, .admin-field textarea:focus { border-color: var(--gold); }
  .admin-field select option { background: var(--card); }
  .admin-field textarea { resize: vertical; min-height: 60px; }

  /* ── BUTTONS ── */
  .btn-sm {
    padding: 0.45rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .btn-sm:hover { opacity: 0.8; }
  .btn-save { background: var(--gold); color: var(--black); }
  .btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.45rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
  }
  .btn-outline:hover { border-color: var(--gold); color: var(--gold); }

  /* ── MAP ── */
  #leaflet-map {
    width: 100%;
    height: 420px;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 1rem;
  }
  .map-location-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--ale);
    text-decoration: none;
    font-weight: 500;
    margin-top: 0.4rem;
  }
  .map-location-link:hover { color: var(--gold); }
  .directions-btn {
    display: inline-block;
    margin: 0.5rem 0 0.75rem;
    padding: 0.45rem 1rem;
    background: var(--ale);
    color: #fff;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
  }
  .directions-btn:hover { background: var(--gold); color: var(--black); }

  /* ── LIGHTBOX ── */
  #lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }
  #lightbox.open { display: flex; }
  #lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
  }
  #lightbox-video {
    max-width: 90vw;
    max-height: 85vh;
    outline: none;
    display: none;
  }
  #lightbox-close {
    position: absolute;
    top: 1rem; right: 1.5rem;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    z-index: 10000;
  }
  #lightbox-caption {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    margin-top: 0.75rem;
    font-style: italic;
    letter-spacing: 0.05em;
  }

  /* ── TOAST ── */
  #toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gold);
    color: var(--black);
    padding: 0.7rem 1.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    transition: transform 0.3s ease;
    z-index: 999;
  }
  #toast.show { transform: translateX(-50%) translateY(0); }

  /* ── COUNTDOWN ── */
  #weekend-strip {
    text-align: center;
    padding: 0.5rem 1rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
  }
  #weekend-strip.live {
    background: rgba(201,168,76,0.08);
    color: var(--gold);
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.75rem;
  }
  #weekend-strip.over { color: var(--muted); font-family: 'DM Sans', sans-serif; font-style: italic; }
  .countdown-time { color: var(--ale); font-weight: 500; }

  @media (max-width: 500px) {
    .nav-links a { padding: 0.65rem 0.8rem; font-size: 0.78rem; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .chat-message { max-width: 88%; }
  }

  .u-hidden { display: none !important; }
  .gate-note { color: var(--ale); font-size: 0.9rem; margin-top: 0.75rem; line-height: 1.4; }
  .trip-switch { margin: 0.55rem auto 0; max-width: 280px; }
  .trip-switch select {
    width: 100%;
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.35rem 0.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
  }
  .year-label {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--ale);
    margin: 1.25rem 0 0.4rem;
  }
  .pinned { border-color: var(--gold); }
  .banner {
    background: rgba(201,168,76,0.15);
    border: 1px solid var(--border);
    padding: 0.7rem 0.9rem;
    font-size: 0.88rem;
    margin-bottom: 1rem;
  }
  .admin-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
  }
  .row-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
  .row-actions input, .row-actions select {
    width: auto;
    background: var(--cream);
    border: 1px solid var(--border);
    padding: 0.35rem 0.5rem;
    font-family: inherit;
    font-size: 0.85rem;
  }
  .check-line { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.8rem; font-size: 0.9rem; }
  .check-line input { width: auto; margin: 0; }
  .loc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-top: 1px solid var(--border);
  }
  .pin { background: transparent; border: none; }
  .pin span {
    display: block; width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid #1A1409; box-shadow: 0 1px 3px rgba(0,0,0,.35);
  }
  .chat-message.bot .chat-bubble { border-color: var(--gold); }
  .photo-missing {
    display: flex; align-items: center; justify-content: center; text-align: center;
    aspect-ratio: 1; background: var(--card); border: 1px solid var(--border);
    color: var(--muted); font-size: 0.75rem; padding: 0.4rem;
  }
