/* Inline <style> blocks from the classic base.html + page templates,
   extracted from a live render — bottom-nav, menu panels, confirm
   modal, lightbox, progress bar, etc. Regenerate from
   https://ripandlist.com/ when the classic templates change. */

.menu-wrap { position: relative; display: inline-block; }
.menu-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 200;
  /* Cap height to viewport so 50+ item lists (e.g. Admin) can scroll. */
  max-height: calc(100vh - 90px); overflow-y: auto; overscroll-behavior: contain;
}
.menu-panel::-webkit-scrollbar { width: 8px; }
.menu-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.menu-panel.open { display: block; }
.menu-panel a {
  display: block; padding: 8px 12px; border-radius: 6px;
  color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.menu-panel a:hover { background: var(--surface-2); color: var(--primary); }
.menu-panel hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-panel .menu-label {
  padding: 6px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim);
}
/* Collapsible groups inside dropdowns. summary takes the visual role of menu-label. */
.menu-panel .menu-group { margin: 2px 0; }
.menu-panel .menu-group > summary {
  list-style: none; cursor: pointer;
  padding: 6px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.menu-panel .menu-group > summary::-webkit-details-marker { display: none; }
.menu-panel .menu-group > summary::after {
  content: "▸"; font-size: 9px; transition: transform .2s ease;
}
.menu-panel .menu-group[open] > summary::after { transform: rotate(90deg); }
.menu-panel .menu-group > summary:hover { background: var(--surface-2); color: var(--text); }
/* Brand "more" expander styled like a sub-link */
.menu-panel .brand-more { margin: 0; }
.menu-panel .brand-more > summary {
  list-style: none; cursor: pointer; padding: 6px 12px 6px 18px;
  color: var(--text-muted); font-size: 13px;
}
.menu-panel .brand-more > summary::-webkit-details-marker { display: none; }
.menu-panel .brand-more > summary:hover { background: var(--surface-2); color: var(--primary); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

.card-tile.kbd-focus,[data-card-tile].kbd-focus{outline:3px solid var(--primary);outline-offset:2px;}

#cookie-banner {
  display: none;
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(0, 0, 0, .55);
  align-items: flex-end; justify-content: center;
  padding: 0;
}
#cookie-banner.open { display: flex; }
#cookie-banner .cookie-card {
  width: 100%; max-width: 480px;
  margin: 0 1em 1em;
  background: var(--surface, #fff);
  color: var(--text, #111);
  border-radius: 14px;
  padding: 1.4em 1.4em calc(1.4em + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,.4);
  display: flex; flex-direction: column; gap: 1em;
}
#cookie-banner button {
  display: block; width: 100%;
  padding: .9em 1.4em; background: #2c6cd1; color: #fff;
  border: none; border-radius: 10px; cursor: pointer;
  font-weight: 700; font-size: 1.05em; min-height: 48px;
}
#cookie-banner button:active { background: #163f80; transform: scale(.98); }
@media (min-width: 720px) {
  #cookie-banner { align-items: center; }
  #cookie-banner .cookie-card { margin: 0 1em; }
}

/* Bottom-nav surfaces the four most-used actions at thumb height on
   phones. Hidden above 720px - desktop has the header nav. The fixed
   position with safe-area inset works on iOS too. */
.bottom-nav { display: none; }
@media (max-width: 720px) {
  .bottom-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    /* Translucent + backdrop blur so the page bleeds through. Light
       and dark each get their own tinted layer so icons stay readable. */
    background: rgba(255, 255, 255, .55);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid rgba(0, 0, 0, .08);
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 8px rgba(0,0,0,.04);
  }
  body.dark .bottom-nav {
    background: rgba(11, 18, 32, .55);
    border-top-color: rgba(255, 255, 255, .08);
  }
  .bottom-nav a {
    flex: 1 1 0; display: flex; flex-direction: column;
    align-items: center; gap: 2px;
    padding: 6px 4px; text-decoration: none;
    color: var(--text-muted, #888); font-size: 11px; font-weight: 600;
    position: relative;
    transition: color .15s ease, transform .12s ease;
  }
  .bottom-nav .bn-ico {
    font-size: 20px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 32px; border-radius: 16px;
    transition: background .18s ease, transform .18s ease;
  }
  .bottom-nav .bn-lbl {
    font-size: 10px; line-height: 1; color: inherit;
    font-weight: 600; letter-spacing: .01em;
  }
  .bottom-nav .bn-badge {
    position: absolute; top: -4px; right: -10px;
    background: #dc2626; color: #fff; font-size: 10px;
    font-weight: 700; padding: 1px 5px; border-radius: 10px;
    line-height: 1.2; min-width: 14px; text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
  }
  /* Push page content above the fixed bottom-nav so footer + last
     content isn't hidden under it on mobile. */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* Tap feedback: short scale-down + soft halo behind the icon. */
  .bottom-nav a:active { transform: scale(.93); }
  .bottom-nav a:active .bn-ico {
    background: rgba(44, 108, 209, .18);
    transform: scale(1.05);
  }
  /* Active page: blue text + capsule behind the icon + small dot
     indicator above the icon so the current tab is unmistakable. */
  .bottom-nav a[aria-current="page"] { color: var(--primary, #2c6cd1); }
  .bottom-nav a[aria-current="page"] .bn-ico {
    background: rgba(44, 108, 209, .14);
    transform: scale(1.08);
  }
  .bottom-nav a[aria-current="page"]::before {
    content: "";
    position: absolute; top: 1px; left: 50%;
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--primary, #2c6cd1);
    transform: translateX(-50%);
    box-shadow: 0 0 6px rgba(44, 108, 209, .55);
  }
  /* Subtle hover lift on desktop where the nav is also visible. */
  @media (hover: hover) {
    .bottom-nav a:hover { color: var(--text); }
    .bottom-nav a:hover .bn-ico { background: rgba(0,0,0,.05); }
  }
  body.dark .bottom-nav a:active .bn-ico,
  body.dark .bottom-nav a[aria-current="page"] .bn-ico {
    background: rgba(120, 165, 255, .18);
  }
  /* Pad page content so the fixed nav doesn't overlap the last items. */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ===== Top progress bar =====
   Pops in when the user clicks any link or submits a form, runs across
   the top of the viewport while the next page loads, then fades out on
   pageshow. Pure CSS animation - no nprogress dep. */
#nav-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--primary, #2c6cd1), #a855f7);
  z-index: 1500; pointer-events: none;
  box-shadow: 0 0 8px rgba(44,108,209,.45);
  transition: width .25s ease-out, opacity .2s ease-out;
  opacity: 0;
}
#nav-progress.active { opacity: 1; }

/* ===== Skeleton card placeholder =====
   Used in card grids while data is loading. Drop <div class="ui-skel-card">
   inside a grid; CSS handles the shimmer. */
.ui-skel-card {
  background: linear-gradient(90deg,
    var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  border-radius: 10px; aspect-ratio: 5/7;
  animation: skel 1.4s linear infinite;
}
.ui-skel-row {
  height: 14px; border-radius: 4px;
  background: linear-gradient(90deg,
    var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skel 1.4s linear infinite;
  margin: 8px 0;
}

/* ===== Reduced-motion respect =====
   Honour the OS / browser preference to disable animations. iOS low-power
   mode and 'reduce motion' accessibility settings both flip this on. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  #nav-progress, .ui-skel-card, .ui-skel-row { display: none !important; }
}

/* ===== Form-submit feedback =====
   Every <form> that isn't [data-no-spinner] gets a disabled+spinner
   treatment on its primary submit button after first submit. Prevents
   accidental double-submits + gives clear 'something is happening'
   acknowledgement. CSS is the spinner; JS in <script> wires it up. */
button[disabled].is-submitting,
.btn.is-submitting,
button.is-submitting {
  position: relative; pointer-events: none; opacity: .85;
}
button.is-submitting::after {
  content: ""; position: absolute; right: 10px; top: 50%;
  width: 14px; height: 14px; margin-top: -7px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
  opacity: .85;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Confirm modal (replaces window.confirm) ===== */
#confirm-modal {
  display: none; position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,.55); align-items: center; justify-content: center;
  padding: 16px;
}
#confirm-modal.open { display: flex; animation: fade-in .15s ease-out; }
#confirm-modal .cm-card {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border, #e5e7eb); border-radius: 12px;
  padding: 1.4em 1.4em 1.1em; width: min(420px, 92vw);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  animation: cm-pop .18s cubic-bezier(.16, 1, .3, 1);
}
#confirm-modal .cm-actions {
  display: flex; gap: .5em; justify-content: flex-end; margin-top: 1em;
}
#confirm-modal .cm-btn {
  padding: .55em 1.1em; border-radius: 6px; border: 1px solid var(--border, #ccc);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  font-weight: 600;
}
#confirm-modal .cm-btn.cm-primary { background: #2c6cd1; color: #fff; border-color: #2c6cd1; }
#confirm-modal .cm-btn.cm-danger  { background: #dc2626; color: #fff; border-color: #dc2626; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cm-pop {
  from { transform: scale(.94) translateY(4px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* ===== Photo lightbox =====
   Click any <img data-zoom> to open it full-screen. Tap outside or press
   ESC to close. Pinch-to-zoom works for free on mobile because the
   image is just a normal <img> inside the overlay. */
#photo-lightbox {
  display: none; position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,.92);
  align-items: center; justify-content: center;
  padding: 20px; cursor: zoom-out;
}
#photo-lightbox.open { display: flex; animation: fade-in .15s ease-out; }
#photo-lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 6px;
  box-shadow: 0 10px 50px rgba(0,0,0,.5);
  animation: lb-pop .2s ease-out;
}
#photo-lightbox .lb-close {
  position: absolute; top: 16px; right: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff; border: 0;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
@keyframes lb-pop {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
[data-zoom] { cursor: zoom-in; }

/* ===== Floating labels =====
   Add class="float-label" to a wrapping <label> with an <input> /
   <textarea> inside to opt-in. The label sits over the input until the
   input is focused or non-empty - then it shrinks + rises. */
label.float-label {
  position: relative; display: block; margin: 1em 0 .8em;
}
label.float-label > input,
label.float-label > textarea,
label.float-label > select {
  width: 100%; box-sizing: border-box;
  padding: 1.15em .75em .5em;
  border: 1px solid var(--border, #ccc); border-radius: 6px;
  background: var(--surface); color: var(--text); font-size: 1em;
}
label.float-label > .fl-lbl {
  position: absolute; left: .8em; top: .9em;
  color: var(--text-muted, #888); font-size: .95em;
  pointer-events: none;
  transition: transform .15s ease, font-size .15s ease, color .15s ease;
  background: transparent;
}
label.float-label > input:focus ~ .fl-lbl,
label.float-label > textarea:focus ~ .fl-lbl,
label.float-label > select:focus ~ .fl-lbl,
label.float-label > input:not(:placeholder-shown) ~ .fl-lbl,
label.float-label > textarea:not(:placeholder-shown) ~ .fl-lbl,
label.float-label > select:not([value=""]) ~ .fl-lbl {
  transform: translateY(-.95em); font-size: .72em;
  color: var(--primary, #2c6cd1); font-weight: 600;
}