/* ============================================================
   COJAN CATERING SERVICES — Global Stylesheet
   Aesthetic: Fresh, warm Filipino hospitality — deep forest
   green + warm cream + golden amber accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --green-dark:   #7A2E1D;
  --green-mid:    #C1441E;
  --green-light:  #FBE8DE;
  --amber:        #E8A93B;
  --amber-light:  #fef3dc;
  --cream:        #FBF3E7;
  --text-dark:    #2B211D;
  --text-mid:     #4a5568;
  /* Contrast fix: #718096 measured 3.65:1 on --cream and 4.02:1 on white —
     both under the 4.5:1 AA minimum for normal-size text. This shade clears
     4.5:1 on both (4.93:1 / 5.4:1) while staying visually a muted gray. */
  --text-light:   #5f6b7a;
  /* Same AA-safe shade as --text-light, under its "intent" name — Stage 3's
     design-consistency pass replaces the #aaa/#999/#888 strays scattered
     across admin/customer pages with this, not a 4th gray. */
  --text-muted:   var(--text-light);
  --white:        #ffffff;
  --danger:       #c0392b;
  --danger-light: #fdecea;
  /* Same value #e74c3c already used 40+ times (by hand) for required-field
     asterisks everywhere — token-ified as its own name rather than merged
     into --danger, which is a visibly different shade and would be a real,
     if small, color change rather than a pure consolidation. */
  --required:     #e74c3c;

  /* ── STATUS COLOR MAP ──
     One background/text pair per semantic status, shared by order/booking/
     stock badges, alerts, and (for amber) the rider's GPS-accuracy warning
     text. Picking a new status color means touching these lines once,
     instead of hunting every badge/alert/chart that hardcoded the hex.
     admin/analytics.blade.php's JS statusColorMap intentionally mirrors
     the *-text values below (JS can't read CSS custom properties without
     extra plumbing) — keep them in sync if either changes. */
  --status-amber-bg:    #fef3c7;
  --status-amber-text:  #92400e;
  --status-blue-bg:     #dbeafe;
  --status-blue-text:   #1e40af;
  --status-purple-bg:   #ede9fe;
  --status-purple-text: #5b21b6;
  --status-pink-bg:     #fce7f3;
  --status-pink-text:   #9d174d;
  --status-green-bg:    #d1fae5;
  --status-green-text:  #065f46;
  --status-red-bg:      #fee2e2;
  --status-red-text:    #991b1b;

  --shadow-sm:    0 2px 8px rgba(122,46,29,.08);
  --shadow-md:    0 6px 24px rgba(122,46,29,.12);
  --shadow-lg:    0 16px 48px rgba(122,46,29,.16);
  --radius-sm:    6px;
  /* The de facto standard already in use ~30+ times across the app (more
     than --radius-sm or --radius-md individually) — named so going forward
     there's a real token for it instead of everyone retyping "10px". */
  --radius-base:  10px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --transition:   all .22s cubic-bezier(.4,0,.2,1);

  /* ── TYPE SCALE ── */
  --fs-xs:   12px;
  --fs-sm:   14px;
  --fs-base: 16px;
  --fs-md:   18px;
  --fs-lg:   22px;
  --fs-xl:   28px;
  --fs-2xl:  36px;
  --lh-xs:   1.4;
  --lh-sm:   1.45;
  --lh-base: 1.5;
  --lh-md:   1.4;
  --lh-lg:   1.3;
  --lh-xl:   1.25;
  --lh-2xl:  1.2;

  /* ── SPACING SCALE ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
}

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

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

h1,h2,h3,h4,h5 { font-family: 'Playfair Display', serif; line-height: var(--lh-xl); }

/* ── NAVBAR ── */
.cj-nav {
  background: var(--green-dark);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.cj-nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: .01em;
}
.cj-nav-brand span { color: var(--amber); }
.cj-nav-links { display: flex; gap: .5rem; align-items: center; }

/* ── BUTTONS ── */
.btn-cj, .btn-cj-outline, .btn-cj-secondary, .btn-cj-amber, .btn-cj-danger {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.btn-cj {
  background: var(--green-mid);
  color: var(--white);
  border-color: var(--green-mid);
}
.btn-cj:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-cj-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.5);
}
.btn-cj-outline:hover {
  background: rgba(255,255,255,.12);
  border-color: var(--white);
  color: var(--white);
  transform: translateY(-1px);
}
/* Secondary action on a light surface (btn-cj-outline is for dark headers). */
.btn-cj-secondary {
  background: var(--white);
  color: var(--green-dark);
  border-color: var(--green-dark);
}
.btn-cj-secondary:hover {
  background: var(--green-light, #FBE8DE);
  color: var(--green-dark);
}
.btn-cj-amber {
  background: var(--amber);
  color: var(--text-dark);
  border-color: var(--amber);
  font-weight: 600;
}
.btn-cj-amber:hover {
  background: #d4911a;
  border-color: #d4911a;
  color: var(--text-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232,160,32,.35);
}
.btn-cj-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}
.btn-cj-danger:hover {
  background: #a93226;
  border-color: #a93226;
  color: var(--white);
  transform: translateY(-1px);
}
.btn-cj-lg {
  padding: .75rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}
.btn-cj-sm {
  padding: .3rem .75rem;
  font-size: .78rem;
}

/* Repeated "← Back to X" link used at the bottom of most detail pages.
   min-height + inline-flex guarantees a 44px tap target regardless of
   the padding math (8px vertical padding alone falls short of 44px). */
.cj-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--space-4);
  padding: .5rem 1.1rem;
  color: var(--green-dark);
  border: 1.5px solid var(--green-dark);
  border-radius: var(--radius-base);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}
.cj-back-link:hover {
  background: var(--green-light, #FBE8DE);
  color: var(--green-dark);
}

/* ── CARDS ── */
.cj-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(122,46,29,.07);
  transition: var(--transition);
  overflow: hidden;
}
.cj-card:hover { box-shadow: var(--shadow-md); }
.cj-card-header {
  background: var(--green-dark);
  color: var(--white);
  padding: .9rem 1.25rem;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
}
.cj-card-header.amber { background: var(--amber); color: var(--text-dark); }
.cj-card-body { padding: 1.25rem; }

/* ── STAT CARDS ── */
.stat-card {
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem;
  color: var(--white);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -20px; bottom: -20px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card h5 { font-family: 'DM Sans', sans-serif; font-size: .82rem; font-weight: 500; margin-bottom: .4rem; text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-num { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 700; line-height: 1; }
.stat-blue  { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
/* Contrast fix: the h5 label is small text (needs 4.5:1), and the previous
   lighter gradient stops (#16a34a / #d97706 / #0891b2) plus the label's old
   opacity:.85 fell as low as ~2.7:1 against white. Darkened stops restore
   5:1+ at both ends. Also reused directly (not duplicated) by the rider
   dashboard's own stat cards — see delivery/dashboard.blade.php. */
.stat-green { background: linear-gradient(135deg, #15803d, #14532d); }
.stat-amber { background: linear-gradient(135deg, #b45309, #92400e); color: var(--white); }
.stat-teal  { background: linear-gradient(135deg, #0e7490, #164e63); }

/* ── TABLES ── */
.cj-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cj-table thead tr { background: var(--green-dark); color: var(--white); }
.cj-table thead th { padding: .75rem 1rem; text-align: left; font-weight: 500; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; }
.cj-table tbody tr { border-bottom: 1px solid rgba(122,46,29,.07); transition: var(--transition); }
.cj-table tbody tr:hover { background: var(--green-light); }
.cj-table tbody td { padding: .75rem 1rem; vertical-align: middle; }
.cj-table tfoot td { padding: .5rem 1rem; vertical-align: middle; }

/* ── BADGES ── */
.badge-cj {
  display: inline-block;
  padding: .25rem .65rem;
  border-radius: 100px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .03em;
}
.badge-pending  { background: var(--status-amber-bg); color: var(--status-amber-text); }
.badge-confirmed{ background: var(--status-blue-bg); color: var(--status-blue-text); }
.badge-preparing{ background: var(--status-purple-bg); color: var(--status-purple-text); }
.badge-delivery { background: var(--status-pink-bg); color: var(--status-pink-text); }
.badge-delivered{ background: var(--status-green-bg); color: var(--status-green-text); }
.badge-cancelled{ background: var(--status-red-bg); color: var(--status-red-text); }
.badge-unpaid   { background: var(--status-amber-bg); color: var(--status-amber-text); }
.badge-paid     { background: var(--status-green-bg); color: var(--status-green-text); }
.badge-admin    { background: #1a5c38; color: var(--white); }
.badge-customer { background: var(--status-green-bg); color: var(--status-green-text); }
.badge-delivery-role { background: var(--status-amber-bg); color: var(--status-amber-text); }
.badge-instock  { background: var(--status-green-bg); color: var(--status-green-text); }
.badge-lowstock { background: var(--status-red-bg); color: var(--status-red-text); }
/* Type tag, not a status color — distinguishes a booking from a regular
   order at a glance in mixed lists (e.g. the dashboard's Recent Orders),
   deliberately outside the pending/confirmed/etc. status color language.
   (Reuses the purple pair's values via the shared token purely to avoid a
   second hardcoded copy of the same hex — still its own class.) */
.badge-booking-type { background: var(--status-purple-bg); color: var(--status-purple-text); }

/* Activity log category badges — a distinct 4-color language (blue/
   terracotta/amber/teal) from the order-status badges above, so a glance at
   the log never gets confused with a glance at an order list. */
.badge-activity-auth   { background: var(--status-blue-bg); color: var(--status-blue-text); }
.badge-activity-orders { background: var(--green-light); color: var(--green-dark); }
.badge-activity-admin  { background: var(--amber-light); color: var(--status-amber-text); }
.badge-activity-stock  { background: #ccfbf1; color: #0f766e; }

/* Dashboard "Recent Activity" widget rows */
.cj-recent-activity-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid rgba(122,46,29,.07);
  flex-wrap: wrap;
}
.cj-recent-activity-row:last-child { border-bottom: none; }
.cj-recent-activity-desc { flex: 1; min-width: 180px; font-size: .88rem; }
.cj-recent-activity-time { font-size: .76rem; color: var(--text-light); white-space: nowrap; }
@media (max-width: 480px) {
  .cj-recent-activity-row { padding: .65rem 1rem; }
}

/* ── ALERTS ── */
.alert-cj { padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; display: flex; align-items: center; gap: .6rem; }
.alert-success { background: var(--status-green-bg); color: var(--status-green-text); border-left: 4px solid #10b981; }
.alert-danger   { background: var(--status-red-bg); color: var(--status-red-text); border-left: 4px solid #ef4444; }
.alert-warning  { background: var(--status-amber-bg); color: var(--status-amber-text); border-left: 4px solid #f59e0b; }
.alert-info     { background: var(--status-blue-bg); color: var(--status-blue-text); border-left: 4px solid #3b82f6; }

/* ── FORMS ── */
.cj-label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--text-mid); margin-bottom: .35rem; }
.cj-input, .cj-select, .cj-textarea {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid #c9bcae;
  border-radius: var(--radius-base);
  font-family: 'DM Sans', sans-serif;
  /* 16px everywhere, not just the old mobile-only override below — prevents
     iOS Safari's zoom-on-focus and reads as a single consistent input size
     across breakpoints instead of visibly resizing at the 768px line. */
  font-size: var(--fs-base);
  color: var(--text-dark);
  background: #FFFAF3;
  transition: var(--transition);
  outline: none;
  min-height: 44px;
}
.cj-input:focus, .cj-select:focus, .cj-textarea:focus {
  border-color: var(--green-mid);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(193,68,30,.2);
}
.cj-textarea { resize: vertical; min-height: 90px; }

/* ── AUTH PAGES (login, register, forgot/reset/confirm password, verify email) ──
   layouts/guest.blade.php. Desktop: food photo (left, pinned) + form card.
   Phone (≤768px): a short photo banner on top, then the card, one column. */
.cj-auth-body { margin: 0; font-family: 'DM Sans', sans-serif; color: var(--text-dark); background: var(--cream); -webkit-font-smoothing: antialiased; }
.cj-auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* Photo: Chicken Inasal (public/images/auth-food*.jpg — a committed copy, not
   the uploads Volume). The overlay is darkest at the bottom where the text
   sits; worst case (white rice under it) is still ≥ 7:1 for white text. */
/* The photo fills the whole column however long the form is; only the text
   inside sticks to the screen while a long form (register) scrolls. */
.cj-auth-hero {
  position: relative; color: #fff;
  background:
    linear-gradient(180deg, rgba(122,46,29,.35) 0%, rgba(122,46,29,.62) 38%, rgba(88,30,17,.9) 72%, rgba(70,24,14,.95) 100%),
    url('/images/auth-food.jpg') center / cover no-repeat;
  background-color: var(--green-dark);
}
.cj-auth-hero-inner {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: 2rem clamp(2rem, 4vw, 3.5rem) clamp(2.5rem, 5vh, 3.5rem);
}
.cj-auth-back {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 44px; padding: 0 1.1rem;
  background: rgba(255,255,255,.94); color: var(--green-dark);
  border-radius: 100px; font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.cj-auth-back:hover { background: #fff; color: var(--green-mid); transform: translateY(-1px); }
.cj-auth-back:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.cj-auth-hero-copy { max-width: 470px; }
.cj-auth-hero-title {
  font-family: 'Playfair Display', serif; font-size: clamp(2rem, 3.2vw, 2.9rem);
  line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .75rem; color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.25); text-wrap: balance;
}
.cj-auth-hero-title em { color: var(--amber); font-style: normal; }
.cj-auth-hero-text { font-size: var(--fs-base); line-height: 1.55; color: rgba(255,255,255,.92); margin: 0 0 1.5rem; }
.cj-auth-highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.cj-auth-highlights li { display: flex; align-items: center; gap: .75rem; font-size: var(--fs-base); font-weight: 500; color: #fff; }
.cj-auth-highlights span {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--amber); color: var(--text-dark); font-size: 1rem;
}

.cj-auth-main { display: flex; align-items: center; justify-content: center; padding: 3rem 2rem; }
.cj-auth-card {
  width: 100%; max-width: 440px; background: #fff;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 2rem 2.25rem 1.75rem;
}
.cj-auth-logo { display: block; width: 88px; margin: 0 auto .75rem; border-radius: 50%; }
.cj-auth-logo img { display: block; width: 88px; height: 88px; object-fit: contain; }
.cj-auth-logo:focus-visible { outline: 3px solid var(--green-mid); outline-offset: 3px; }
.cj-auth-title { font-family: 'Playfair Display', serif; font-size: var(--fs-xl); line-height: 1.2; color: var(--text-dark); text-align: center; margin: 0 0 .4rem; }
.cj-auth-subtitle { font-size: var(--fs-sm); line-height: 1.5; color: var(--text-light); text-align: center; margin: 0 0 1.5rem; }

/* Fields */
.cj-auth-field { margin-bottom: 1rem; }
.cj-input-icon { position: relative; }
.cj-input-icon > i { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: 1.05rem; pointer-events: none; }
.cj-input-icon .cj-input { min-height: 48px; padding-left: 2.75rem; }
.cj-input-icon.has-toggle .cj-input { padding-right: 3.25rem; }
.cj-input.is-invalid { border-color: var(--danger); background: #fff; }
.cj-input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(192,57,43,.18); }
.cj-pw-toggle {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--text-mid); border-radius: var(--radius-sm);
  font-size: 1.15rem; cursor: pointer;
}
.cj-pw-toggle:hover { color: var(--green-dark); }
.cj-pw-toggle:focus-visible { outline: 3px solid rgba(193,68,30,.45); outline-offset: -3px; }

.cj-auth-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 .75rem; margin: -.25rem 0 1rem; }
.cj-auth-row .cj-check { color: var(--text-mid); }

.cj-auth-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px;
  color: var(--green-dark); font-size: var(--fs-sm); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; transition: var(--transition);
}
.cj-auth-link:hover { color: var(--green-mid); }
.cj-auth-link:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(193,68,30,.25); border-radius: 2px; }
.cj-auth-link-btn { background: none; border: 0; padding: 0 .25rem; cursor: pointer; font-family: inherit; }

/* Submit: turmeric with dark text (#2B211D on #E8A93B ≈ 7.6:1) */
.cj-auth-submit {
  width: 100%; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  background: var(--amber); color: var(--text-dark); border: 0; border-radius: var(--radius-base);
  font-family: 'DM Sans', sans-serif; font-size: var(--fs-base); font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px rgba(232,169,59,.35); transition: var(--transition);
}
.cj-auth-submit:hover:not(:disabled) { background: #dd9c2c; transform: translateY(-1px); }
.cj-auth-submit:focus-visible { outline: 3px solid var(--green-mid); outline-offset: 2px; }
.cj-auth-submit:disabled { cursor: wait; opacity: .85; box-shadow: none; }
.cj-spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(43,33,29,.25); border-top-color: var(--text-dark);
  animation: cjSpin .7s linear infinite;
}
.cj-auth-submit[aria-busy="true"] .cj-spinner { display: inline-block; }
@keyframes cjSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cj-spinner { animation-duration: 2s; } }

.cj-auth-alt { text-align: center; margin: 1rem 0 0; font-size: var(--fs-sm); color: var(--text-mid); }

/* Errors (--danger tokens, ≈ 4.8:1) and success notes, above the fields */
.cj-auth-alert, .cj-auth-notice {
  display: flex; align-items: flex-start; gap: .65rem;
  border-radius: var(--radius-base); padding: .8rem 1rem; margin-bottom: 1.1rem;
  font-size: var(--fs-sm); line-height: 1.45;
}
.cj-auth-alert { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(192,57,43,.25); border-left: 4px solid var(--danger); }
.cj-auth-notice { background: var(--status-green-bg); color: var(--status-green-text); border-left: 4px solid #10b981; }
.cj-auth-alert > i, .cj-auth-notice > i { font-size: 1.1rem; line-height: 1.3; }
.cj-auth-alert strong { display: block; margin-bottom: .1rem; }
.cj-auth-alert p, .cj-auth-notice p { margin: 0; }
.cj-auth-alert ul { margin: .15rem 0 0; padding-left: 1.1rem; }

.cj-auth-verify-icon { width: 64px; height: 64px; margin: 0 auto .75rem; border-radius: 50%; background: var(--amber-light); color: var(--green-dark); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.cj-auth-hint { text-align: center; font-size: var(--fs-sm); color: var(--text-light); margin: 0 0 1.1rem; }

/* Phone: banner + one column, 16px gutters */
@media (max-width: 768px) {
  .cj-auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .cj-auth-hero-inner { position: static; height: auto; min-height: 168px; gap: 1rem; padding: calc(12px + env(safe-area-inset-top)) 16px 44px; }
  .cj-auth-hero {
    background:
      linear-gradient(180deg, rgba(122,46,29,.45) 0%, rgba(88,30,17,.86) 70%, rgba(70,24,14,.94) 100%),
      url('/images/auth-food-sm.jpg') center 35% / cover no-repeat;
  }
  .cj-auth-hero-title { font-size: 1.5rem; margin: 0; }
  .cj-auth-hero-text, .cj-auth-highlights { display: none; }
  .cj-auth-main { align-items: flex-start; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); margin-top: -28px; position: relative; }
  .cj-auth-card { max-width: 520px; margin: 0 auto; padding: 1.5rem 1.25rem 1.25rem; border-radius: var(--radius-md); }
  .cj-auth-logo, .cj-auth-logo img { width: 72px; height: 72px; }
  .cj-auth-title { font-size: 1.6rem; }
  .cj-auth-subtitle { margin-bottom: 1.25rem; }
}

/* ── MENU ITEM CARDS ── */
.menu-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(122,46,29,.07);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.menu-card-img {
  height: 180px;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: .85rem;
  position: relative;
  overflow: hidden;
}
.menu-card-img img { width: 100%; height: 100%; object-fit: cover; }
.menu-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.menu-card-name { font-family: 'Playfair Display', serif; font-size: 1rem; margin-bottom: .25rem; }
.menu-card-desc { font-size: .82rem; color: var(--text-light); flex: 1; margin-bottom: .75rem; }
.menu-card-price {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  background: var(--amber-light);
  border: 1px solid rgba(232,169,59,.4);
  padding: .3rem .7rem;
  border-radius: 100px;
  margin-bottom: .75rem;
}
.menu-card-btn {
  width: 100%;
  padding: .55rem;
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: .88rem;
  cursor: pointer;
  transition: var(--transition);
}
.menu-card-btn:hover { background: var(--green-mid); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.menu-card-btn:disabled {
  background: #ccc;
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── CATEGORY PILLS ── */
.cat-pill {
  display: inline-block;
  padding: .4rem 1rem;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: 1.5px solid rgba(122,46,29,.2);
  color: var(--green-dark);
  background: var(--white);
}
/* Hover is a subtle preview, distinct from the active state — previously
   hover and active shared one rule, so a hovered inactive pill looked
   identical to the actually-selected one. */
.cat-pill:hover {
  background: var(--amber-light);
  border-color: var(--amber);
  color: var(--green-dark);
  transform: translateY(-1px);
}
.cat-pill.active {
  background: var(--amber);
  color: var(--text-dark);
  border-color: var(--amber);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.cat-pill.active:hover {
  background: #d4911a;
  border-color: #d4911a;
  transform: translateY(-1px);
}

/* ── PAGE WRAPPER ── */
.cj-page { padding: 2rem 1.5rem; max-width: 1280px; margin: 0 auto; }
.cj-page-title { font-size: 1.6rem; margin-bottom: .25rem; }
.cj-page-sub { color: var(--text-light); font-size: .9rem; margin-bottom: 1.5rem; }

/* ── MODAL ── */
.modal-content { border-radius: var(--radius-md) !important; border: none !important; overflow: hidden; }
.modal-header { background: var(--green-dark) !important; color: var(--white) !important; }
.modal-title { font-family: 'Playfair Display', serif !important; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: rgba(122,46,29,.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-mid); }

/* ── TOASTS ── */
.cj-toast {
  background: var(--white);
  color: var(--text-dark);
  border-left: 4px solid var(--green-mid);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: .85rem 1.1rem;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 260px;
  max-width: 340px;
  transform: translateX(-120%);
  opacity: 0;
}
.cj-toast-error { border-left-color: var(--danger); }
.cj-toast-show { transform: translateX(0); opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .cj-toast { transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s ease; }
}

/* ── BREADCRUMBS ── */
.cj-breadcrumb { font-size: .82rem; color: var(--text-light); }
.cj-breadcrumb-link { color: var(--green-dark); text-decoration: none; }
.cj-breadcrumb-link:hover { text-decoration: underline; }
.cj-breadcrumb-sep { margin: 0 .4rem; color: var(--text-light); }
.cj-breadcrumb-current { color: var(--text-mid); font-weight: 500; }

/* ── ORDER STATUS TIMELINE ── */
.cj-timeline { display: flex; align-items: flex-start; justify-content: space-between; margin-top: .5rem; }
.track-step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.track-circle {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; margin-bottom: .5rem; z-index: 1;
}
.track-circle.done { background: var(--green-dark); color: #fff; }
.track-circle.current { background: var(--green-mid); color: #fff; }
.track-circle.pending { background: #f0f0f0; color: var(--text-muted); border: 2px solid #ddd; }
.track-label { font-size: var(--fs-xs); text-align: center; color: var(--text-light); max-width: 60px; }
.track-label.done { color: var(--green-dark); font-weight: 600; }
.track-line { flex-grow: 1; height: 3px; background: #ddd; margin-top: -1.75rem; position: relative; top: 20px; z-index: 0; }
.track-line.done { background: var(--green-dark); }
@media (prefers-reduced-motion: no-preference) {
  .track-circle.current { animation: trackPulse 2s ease-in-out infinite; }
}
@keyframes trackPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(193,68,30,.45); }
  50%      { box-shadow: 0 0 0 10px rgba(193,68,30,0); }
}
/* Phones: five steps don't fit side by side at a readable size, so the
   timeline runs top to bottom — circle, then label, joined by short lines. */
@media (max-width: 480px) {
  .cj-timeline { flex-direction: column; align-items: stretch; }
  .track-step { flex-direction: row; gap: var(--space-3); flex: none; }
  .track-circle { width: 32px; height: 32px; font-size: .75rem; margin-bottom: 0; }
  .track-label { font-size: var(--fs-sm); text-align: left; max-width: none; }
  .track-line { flex: none; width: 3px; height: 14px; margin: 2px 0 2px 14.5px; top: 0; }
}

/* ── FOOTER ── */
.cj-footer { background: var(--green-dark); color: rgba(255,255,255,.85); padding: 3rem 1.5rem 1.5rem; margin-top: 3rem; }
.cj-footer-grid {
  max-width: 1280px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,.15);
}
.cj-footer h6 { font-family: 'Playfair Display', serif; color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.cj-footer p, .cj-footer li { font-size: .85rem; color: rgba(255,255,255,.75); line-height: 1.8; }
.cj-footer a { color: rgba(255,255,255,.75); text-decoration: none; transition: var(--transition); }
.cj-footer a:hover { color: var(--amber); }
.cj-footer ul { list-style: none; }
.cj-footer-social { display: flex; gap: .75rem; margin-top: 1rem; }
.cj-footer-social a {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.cj-footer-social a:hover { background: var(--amber); color: var(--text-dark); }
.cj-footer-bottom { text-align: center; padding-top: 1.5rem; font-size: .8rem; color: rgba(255,255,255,.6); }

/* ── CHAT WIDGET ── */
/* Radius aligned to --radius-lg — the previous 16px was a bespoke value that
   didn't match any design-system token (6/12/20). */
.cj-chat-panel { border-radius: var(--radius-lg); }
.cj-chat-messages { background: var(--cream); }
.cj-chat-bubble-mine, .cj-chat-bubble-theirs {
  max-width: 75%;
  padding: 9px 13px;
  font-size: .87rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.cj-chat-bubble-mine {
  border-radius: 16px 16px 4px 16px;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: var(--white);
}
.cj-chat-bubble-theirs {
  border-radius: 16px 16px 16px 4px;
  background: var(--white);
  color: var(--text-dark);
}
/* Tighter gap when this bubble follows another one from the same sender —
   groups a burst of consecutive messages instead of spacing every message
   identically regardless of who sent it. */
.cj-chat-row-grouped { margin-top: -6px; }
.cj-chat-timestamp { font-size: .7rem; opacity: .65; margin-top: 3px; text-align: right; }
/* "Sent" / "Seen" status line under the sender's own last message in a
   thread — shared by the customer widget and the admin inbox. */
.cj-chat-status { font-size: .7rem; opacity: .65; margin-top: 2px; text-align: right; display: flex; align-items: center; gap: 3px; justify-content: flex-end; }

/* ── SKELETON LOADING ── */
.cj-skeleton {
  background: linear-gradient(90deg, #e8e3dd 25%, #f2efe9 50%, #e8e3dd 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: no-preference) {
  .cj-skeleton { animation: cjSkeletonShimmer 1.4s ease-in-out infinite; }
}
@keyframes cjSkeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── QUANTITY STEPPER ── */
.cj-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #c9bcae;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
}
.cj-stepper-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--cream);
  color: var(--green-dark);
  font-size: 1rem;
  font-weight: 700; 
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cj-stepper-btn:hover:not(:disabled) { background: var(--green-light); }
.cj-stepper-btn:disabled { color: var(--text-muted); cursor: not-allowed; }
@media (prefers-reduced-motion: no-preference) {
  .cj-stepper-btn:active:not(:disabled) { transform: scale(.9); }
}
.cj-stepper-value {
  min-width: 36px;
  text-align: center;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-dark);
  user-select: none;
}
.cj-stepper-sm .cj-stepper-btn { width: 26px; height: 26px; font-size: .85rem; }
.cj-stepper-sm .cj-stepper-value { min-width: 26px; font-size: .82rem; }

/* Typed quantity (components/qty-stepper): the middle of the stepper is a small
   numeric input so a customer can enter 12 without tapping + eleven times. */
[x-cloak] { display: none !important; }
.cj-qty { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 100%; }
.cj-stepper-input {
  width: 40px;
  height: 26px;
  border: none;
  border-left: 1px solid #e3d8cb;
  border-right: 1px solid #e3d8cb;
  padding: 0 2px;
  text-align: center;
  font-family: inherit;
  font-weight: 600;
  font-size: .85rem;
  color: var(--text-dark);
  background: var(--white);
  -moz-appearance: textfield;
  appearance: textfield;
}
.cj-stepper-input:focus { outline: 2px solid var(--green-dark); outline-offset: -2px; }
.cj-stepper-input:disabled { color: var(--text-muted); background: var(--white); }
.cj-qty-msg { font-size: var(--fs-xs); color: var(--required); line-height: 1.3; }
.menu-card-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.menu-card-actions .menu-card-btn { flex: 1 1 7rem; min-height: 28px; }

/* ── UTILITY ── */
.text-green { color: var(--green-dark) !important; }
.text-amber { color: var(--amber) !important; }
.bg-green-light { background: var(--green-light); }
.divider { border: none; border-top: 1px solid rgba(122,46,29,.1); margin: 1rem 0; }
.gap-2 { gap: .5rem; }
.fw-serif { font-family: 'Playfair Display', serif; }

/* ── MOBILE: TAP TARGETS & TYPOGRAPHY ──
   Scoped to the mobile breakpoint only — desktop keeps its existing, denser
   sizing. 44px matches the WCAG/Apple/Material baseline for a comfortable
   one-handed thumb target; 16px on inputs is specifically what stops iOS
   Safari auto-zooming the page on focus (anything under 16px triggers it). */
@media (max-width: 768px) {
  .btn-cj, .btn-cj-outline, .btn-cj-secondary, .btn-cj-amber, .btn-cj-danger {
    min-height: 44px;
    padding-top: .6rem;
    padding-bottom: .6rem;
  }
  .btn-cj-sm {
    min-height: 44px;
    padding-top: .55rem;
    padding-bottom: .55rem;
  }
  .cj-stepper-btn {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }
  .cj-stepper-value { min-width: 40px; }
  /* The compact stepper variant (menu/package cards) still grows to 44px on
     mobile — "sm" only means "visually lighter," not "sub-minimum tap
     target." Desktop keeps the smaller 26px version via the unscoped rule
     above this media query. */
  .cj-stepper-sm .cj-stepper-btn { width: 44px; height: 44px; font-size: 1.1rem; }
  .cj-stepper-sm .cj-stepper-value { min-width: 36px; font-size: .9rem; }
  /* 16px stops iOS zooming on focus; 44px tall like the buttons beside it. */
  .cj-stepper-input { width: 48px; height: 44px; font-size: 16px; }
  .menu-card-actions .menu-card-btn { min-height: 44px; }
}

/* ── MOBILE: SAFE-AREA-AWARE STICKY ACTION BAR ──
   For a page's one primary action (place order, confirm Avail booking,
   update delivery status) — pins it above the thumb without requiring a
   scroll to the bottom of a long page, and never sits under the iOS home
   bar / Android gesture strip. Usage: wrap the action button(s) in
   <div class="cj-sticky-actions">...</div> — it's a no-op above 768px
   (renders inline, in normal document flow) so desktop is unaffected. */
.cj-sticky-actions {
  display: contents;
}
@media (max-width: 768px) {
  .cj-sticky-actions {
    display: flex;
    gap: .6rem;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--white);
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
    margin: 1rem -1rem -1rem;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  }
  .cj-sticky-actions > * {
    flex: 1;
  }
}

/* ── MOBILE: 16px INPUT FIX FOR INLINE-STYLED FIELDS ──
   A handful of fields (checkout delivery details, GCash reference, feedback
   comment) set font-size directly via an inline style attribute rather than
   the .cj-input/.cj-textarea classes, so they weren't covered by the earlier
   class-based mobile font-size bump. An inline style always beats an
   external rule regardless of specificity unless that rule carries
   !important (same reason the chat-bubble fix above needed it), so this
   needs !important to actually win here. */
@media (max-width: 768px) {
  .cj-mobile-field {
    font-size: 16px !important;
  }
}

/* ── MOBILE: TOAST VS. CHAT BUBBLE OVERLAP FIX ──
   The chat bubble repositions to bottom:20/right:20 (~60px tall) at this
   same 768px breakpoint, and the toast container sits at the same bottom
   corner — confirmed via real getBoundingClientRect() that the two overlap
   at 360px (toast y:714-764 vs bubble y:701-761). Raise the toast above the
   bubble's footprint on every width where the bubble repositions, not just
   the narrowest phones. */
@media (max-width: 768px) {
  #cj-toast-container {
    bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  }
}

/* ── MOBILE: TOAST WIDTH OVERFLOW FIX ──
   .cj-toast's max-width (340px) plus the toast container's inline
   left:24px offset overflows viewports narrower than ~364px (e.g. a 360px
   or 320px phone). Pin the container to both edges and let the toast fill
   the available width instead of assuming a fixed min/max-width. */
@media (max-width: 480px) {
  #cj-toast-container {
    left: 12px !important;
    right: 12px !important;
  }
  .cj-toast {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
  }
}

/* ── BOOKING RULES (admin) ──
   Pill tabs for the Limits / Blocked Dates sections, a label-left /
   input-right row that stacks on phones, and a stacked blocked-date list
   (not a table, so nothing needs to scroll sideways at 360px). */
.cj-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.cj-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1.1rem;
  border-radius: 100px;
  border: 1.5px solid rgba(122,46,29,.2);
  background: var(--white);
  color: var(--green-dark);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}
.cj-tab:hover { background: var(--amber-light); border-color: var(--amber); color: var(--green-dark); }
.cj-tab.active { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }
.cj-tab:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; }

.cj-rule-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid rgba(122,46,29,.08);
}
.cj-rule-row:last-of-type { border-bottom: none; }
.cj-rule-text { flex: 1 1 auto; min-width: 0; }
.cj-rule-help { font-size: var(--fs-xs); color: var(--text-light); margin: 0; }
.cj-rule-input { flex: 0 0 140px; }

.cj-blocked-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(122,46,29,.08);
}
.cj-blocked-item:last-child { border-bottom: none; }
.cj-blocked-date {
  flex: 0 0 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: var(--radius-sm);
  background: var(--green-light);
  color: var(--green-dark);
  padding: .3rem 0;
  line-height: 1.1;
}
.cj-blocked-month { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; }
.cj-blocked-day { font-size: var(--fs-lg); font-weight: 700; }
.cj-blocked-info { flex: 1 1 auto; min-width: 0; }

@media (max-width: 768px) {
  .cj-tab { min-height: 44px; }
  .cj-rule-row { flex-direction: column; gap: var(--space-2); }
  .cj-rule-input { flex-basis: auto; width: 100%; }
}
@media (max-width: 420px) {
  .cj-blocked-item { flex-wrap: wrap; }
  .cj-blocked-item form { flex: 1 1 100%; }
  .cj-blocked-item form .btn-cj { width: 100%; }
}

/* ── EVENT DATE CALENDAR (customer Avail modal) ──
   Theme for the flatpickr calendar: unavailable (full / blocked) days are
   struck through and greyed so they read as "can't pick" even without
   colour, and the calendar stretches to the modal width on phones. */
.cj-event-calendar .flatpickr-calendar.inline {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  box-shadow: none;
  border: 1.5px solid rgba(122,46,29,.15);
  border-radius: var(--radius-base);
}
.cj-event-calendar .flatpickr-days,
.cj-event-calendar .dayContainer { width: 100%; min-width: 0; max-width: none; }
.cj-event-calendar .flatpickr-day { max-width: none; height: 44px; line-height: 44px; }
/* 44px tap targets for the month arrows too (flatpickr's default is ~34px). */
.cj-event-calendar .flatpickr-months { align-items: center; }
.cj-event-calendar .flatpickr-months .flatpickr-prev-month,
.cj-event-calendar .flatpickr-months .flatpickr-next-month {
  width: 44px;
  height: 44px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cj-event-calendar .flatpickr-months .flatpickr-month { height: 44px; }
.cj-event-calendar .flatpickr-current-month { padding-top: 10px; }
.cj-event-calendar .flatpickr-day.selected,
.cj-event-calendar .flatpickr-day.selected:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: var(--white);
}
.cj-event-calendar .flatpickr-day.today { border-color: var(--amber); }
.cj-event-calendar .flatpickr-day.flatpickr-disabled.cj-day-full,
.cj-event-calendar .flatpickr-day.flatpickr-disabled.cj-day-blocked {
  background: repeating-linear-gradient(135deg, #f1f1f1, #f1f1f1 4px, #e6e6e6 4px, #e6e6e6 8px);
  color: #9a9a9a;
  text-decoration: line-through;
}
.cj-event-calendar .flatpickr-day.flatpickr-disabled.cj-day-blocked { color: var(--danger); opacity: .55; }
.cj-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-size: var(--fs-xs);
  color: var(--text-light);
  margin-top: var(--space-2);
}
.cj-calendar-legend span::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: .35rem;
  vertical-align: -1px;
}
.cj-legend-full::before { background: repeating-linear-gradient(135deg, #f1f1f1, #f1f1f1 3px, #ddd 3px, #ddd 6px); border: 1px solid #ccc; }
.cj-legend-blocked::before { background: #fde2e2; border: 1px solid var(--danger); }
.cj-legend-selected::before { background: var(--green-dark); }
.cj-unavailable-list {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
  font-size: var(--fs-xs);
  color: var(--text-mid);
}
.cj-unavailable-list li { padding: 2px 0; }

/* ── ACCOUNT RESTRICTED NOTICE (blocked customers) ── */
.cj-restricted-notice { align-items: flex-start; }
.cj-restricted-notice > i { margin-top: 3px; }
.cj-restricted-notice p { font-size: var(--fs-sm); }

/* ── ADMIN FLAGS & BLOCKED CUSTOMERS ── */
.badge-flag    { background: var(--status-red-text); color: var(--white); } /* darker than "Cancelled" so the two read apart */
.badge-blocked { background: var(--status-red-bg); color: var(--status-red-text); }

/* Stacked table (≤640px): each row becomes a labelled card, so wide admin
   tables (users) fit a phone without sideways scrolling. Add
   class="cj-table cj-table-stack" and data-label="…" on each <td>. */
@media (max-width: 640px) {
  .cj-table-stack thead { display: none; }
  .cj-table-stack, .cj-table-stack tbody, .cj-table-stack tr, .cj-table-stack td { display: block; width: 100%; }
  .cj-table-stack tbody tr { padding: var(--space-3) var(--space-4); border-bottom: 1px solid rgba(122,46,29,.12); }
  .cj-table-stack tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-1) 0;
    text-align: right;
    overflow-wrap: anywhere;
  }
  .cj-table-stack tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-light);
    text-align: left;
  }
  .cj-table-stack tbody td[data-label=""]::before { content: none; }
  .cj-table-stack tbody td.cj-td-actions { justify-content: flex-start; flex-wrap: wrap; padding-top: var(--space-2); }
  .cj-table-stack tbody tr:hover { background: transparent; }
  /* The card's heading cell (item name, order number): no label, left-aligned. */
  .cj-table-stack tbody td.cj-td-title { justify-content: flex-start; text-align: left; font-size: var(--fs-base); padding-bottom: var(--space-2); }
  .cj-table-stack tbody td.cj-td-title::before { content: none; }
  /* Totals rows: "Subtotal ........ ₱300.00" */
  .cj-table-stack tfoot { display: block; width: 100%; }
  .cj-table-stack tfoot tr { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); }
  .cj-table-stack tfoot td { display: block; width: auto; padding: 0; text-align: left !important; }
  .cj-table-stack tfoot td:empty { display: none; }
}
/* Small image beside a stacked card's title — phones only, desktop tables unchanged. */
.cj-td-thumb { display: none; }
@media (max-width: 640px) {
  .cj-td-thumb {
    display: block; flex: 0 0 auto; width: 48px; height: 48px; border-radius: var(--radius-sm);
    object-fit: cover; background: var(--cream); margin-right: var(--space-3);
  }
}
.cj-flag-option {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .7rem .8rem;
  border: 1.5px solid rgba(122,46,29,.18);
  border-radius: var(--radius-base);
  cursor: pointer;
  font-size: var(--fs-sm);
  min-height: 44px;
}
.cj-flag-option:has(input:checked) { border-color: var(--status-red-text); background: var(--status-red-bg); }
.cj-flag-option input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; accent-color: var(--status-red-text); }
.cj-flag-option small { color: var(--text-light); }
.cj-blocked-note { width: 100%; color: var(--status-red-text); margin-bottom: .35rem; overflow-wrap: anywhere; }

/* ── CATERING DOWNPAYMENT ── */
.badge-payment { background: var(--status-amber-bg); color: var(--status-amber-text); border: 1px dashed var(--status-amber-text); }
.badge-review  { background: var(--status-blue-bg); color: var(--status-blue-text); }
.cj-dp { margin: 0; font-size: var(--fs-sm); }
.cj-dp-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  padding: .55rem 0;
  border-bottom: 1px solid rgba(122,46,29,.08);
}
.cj-dp-row:last-child { border-bottom: none; }
.cj-dp dt { font-weight: 500; margin: 0; min-width: 0; }
.cj-dp dd { margin: 0; font-weight: 600; white-space: nowrap; }
.cj-dp-now { background: var(--amber-light); margin: 0 calc(-1 * var(--space-3)); padding: .65rem var(--space-3); border-radius: var(--radius-sm); border-bottom: none; }
.cj-dp-now dd { color: var(--green-dark); font-size: var(--fs-md); }
.cj-dp-via { font-weight: 400; color: var(--text-light); }
.cj-dp-deadline, .cj-dp-sub { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--status-amber-text); margin-top: 2px; }
.cj-dp-sub { font-weight: 400; color: var(--text-light); }
.cj-dp-now .badge-cj { margin-left: .25rem; }
.cj-dp-steps { margin: var(--space-4) 0 var(--space-2); padding-left: 1.25rem; font-size: var(--fs-sm); color: var(--text-mid); }
.cj-dp-steps li { margin-bottom: .3rem; }
.cj-dp-note { font-size: var(--fs-xs); color: var(--text-light); margin-bottom: var(--space-4); }
.cj-pay-qr { display: inline-block; max-width: 200px; width: 100%; padding: 10px; background: var(--white); border-radius: var(--radius-base); box-shadow: var(--shadow-sm); }
.cj-pay-qr svg { width: 100%; height: auto; display: block; }
.cj-upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-height: 110px;
  padding: var(--space-4);
  border: 2px dashed rgba(122,46,29,.3);
  border-radius: var(--radius-base);
  background: var(--cream, #FBF3E7);
  color: var(--green-dark);
  text-align: center;
  cursor: pointer;
  font-size: var(--fs-sm);
  transition: var(--transition);
}
.cj-upload-drop:hover { border-color: var(--green-dark); background: var(--amber-light); }
.cj-upload-drop .bi { font-size: 1.6rem; }
.cj-upload-drop small { color: var(--text-light); }
.cj-upload-drop:has(+ input:focus-visible) { outline: 2px solid var(--green-dark); outline-offset: 2px; }
.cj-receipt-preview { margin-top: var(--space-3); text-align: center; }
.cj-receipt-preview img { max-width: 100%; max-height: 260px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.cj-field-error { color: var(--danger); font-size: var(--fs-xs); display: block; margin-top: .3rem; }
.cj-admin-receipt { display: flex; gap: var(--space-3); align-items: flex-start; }
.cj-admin-receipt-thumb { flex: 0 0 96px; }
.cj-admin-receipt-thumb img { width: 96px; height: 128px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid rgba(122,46,29,.15); background: #f6f6f6; }

/* ── DELIVERY PIN MAP (menu checkout) ── */
.cj-pin-help { font-size: var(--fs-xs); color: var(--text-light); margin: 0 0 .5rem; }
.cj-pin-map {
  height: 260px;
  border-radius: var(--radius-base);
  border: 1.5px solid rgba(122,46,29,.2);
  z-index: 0; /* keep Leaflet's panes under the sticky nav and modals */
}
.cj-pin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-top: .6rem; }
.cj-pin-status { font-size: var(--fs-xs); color: var(--text-light); }
.cj-pin-status.set { color: var(--status-green-text); font-weight: 600; }
.cj-pin-save { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; font-size: var(--fs-sm); cursor: pointer; min-height: 44px; }
.cj-pin-save input { width: 20px; height: 20px; accent-color: var(--green-dark); }
/* Teardrop pin in the Cojan terracotta; faded until the customer places it. */
.cj-pin-icon span {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  background: #C1441E;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  transform: rotate(-45deg);
  margin: 0 auto;
}
.cj-pin-icon span::after {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #fff;
}
.cj-pin-icon.cj-pin-unset span { opacity: .55; background: #9a9a9a; }
@media (max-width: 768px) {
  .cj-pin-map { height: 240px; }
  .cj-pin-actions .btn-cj { width: 100%; justify-content: center; }
}

/* ── TEMPORARY: admin dashboard PHP version check (Oct 2026 security release) ── */
.cj-php-version { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--fs-xs); padding: .3rem .7rem; border-radius: var(--radius-sm); margin: -.75rem 0 1rem; }
.cj-php-version.ok  { background: var(--status-green-bg); color: var(--status-green-text); }
.cj-php-version.bad { background: var(--status-red-bg); color: var(--status-red-text); font-weight: 700; }

/* ── RIDER NAVIGATION (menu-order deliveries) ──
   Phone-first: the map takes most of the first screen and Navigate is a
   full-width 56px button reachable with a thumb. */
.cj-rider-nav { overflow: hidden; }
.cj-rider-map { height: 380px; z-index: 0; }
.cj-route-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; margin-bottom: var(--space-3); }
.cj-route-figure { font-size: var(--fs-md); color: var(--green-dark); }
.cj-route-figure .bi { color: var(--text-light); margin-right: .15rem; }
.cj-route-note { flex: 1 1 100%; font-size: var(--fs-xs); color: var(--text-light); }
.cj-route-note.warn { color: var(--status-amber-text); font-weight: 600; }
.cj-navigate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  min-height: 56px;
  padding: .6rem 1rem;
  border-radius: var(--radius-base);
  background: #C1441E;
  color: #fff !important;
  font-size: var(--fs-md);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.cj-navigate-btn small { font-weight: 400; font-size: var(--fs-xs); opacity: .85; }
.cj-navigate-btn:hover, .cj-navigate-btn:focus-visible { background: #a83a19; }
.cj-navigate-btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.cj-nav-secondary { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.cj-nav-alt {
  flex: 1 1 0;
  justify-content: center;
  min-height: 48px;
  background: transparent !important;
  color: var(--green-dark) !important;
  border-color: var(--green-dark) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cj-nav-call { color: var(--status-green-text) !important; border-color: var(--status-green-text) !important; }
.cj-nav-dest { margin-top: var(--space-3); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.cj-nav-approx { color: var(--status-amber-text); background: var(--status-amber-bg); border-radius: var(--radius-sm); padding: .5rem .65rem; font-size: var(--fs-xs); }
/* The rider: a blue dot with a white ring. */
.cj-rider-dot span { display: block; width: 22px; height: 22px; border-radius: 50%; background: #2563eb; border: 4px solid #fff; box-shadow: 0 0 0 2px rgba(37,99,235,.35), 0 2px 6px rgba(0,0,0,.3); }
@media (max-width: 768px) {
  /* ~46% of the screen: map + distance/ETA + Navigate all fit above the fold on a 360–390px phone. */
  .cj-rider-map { height: 46vh; height: 46dvh; min-height: 260px; }
  .cj-rider-nav .cj-card-body { padding: var(--space-3); }
}
.cj-admin-pin-map { height: 200px; border-radius: var(--radius-base); border: 1px solid rgba(122,46,29,.15); z-index: 0; }

/* ── RIDER LIVE SHARING (Stage C) ── */
.cj-share-status { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-bottom: var(--space-3); }
.cj-share-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .7rem; border-radius: 100px;
  font-size: var(--fs-xs); font-weight: 700;
  background: var(--status-blue-bg); color: var(--status-blue-text);
}
.cj-share-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cj-share-pill.on   { background: var(--status-green-bg); color: var(--status-green-text); }
.cj-share-pill.on::before { animation: cjLivePulse 1.6s ease-in-out infinite; }
.cj-share-pill.warn { background: var(--status-amber-bg); color: var(--status-amber-text); }
.cj-share-pill.off  { background: var(--status-red-bg); color: var(--status-red-text); }
.cj-share-meta { font-size: var(--fs-xs); color: var(--text-light); }
.cj-share-help {
  font-size: var(--fs-xs); line-height: 1.55;
  background: var(--status-amber-bg); color: var(--status-amber-text);
  border-radius: var(--radius-sm); padding: .55rem .7rem; margin-bottom: var(--space-3);
  overflow-wrap: anywhere;
}
@keyframes cjLivePulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .cj-share-pill.on::before { animation: none; } }

/* Rider marker: blue dot, plus a direction arrow once a heading is known. */
.cj-rider-marker { position: relative; }
.cj-rider-dot2 {
  position: absolute; left: 7px; top: 7px; width: 22px; height: 22px; border-radius: 50%;
  background: #2563eb; border: 4px solid #fff;
  box-shadow: 0 0 0 2px rgba(37,99,235,.35), 0 2px 6px rgba(0,0,0,.3);
}
.cj-rider-arrow {
  position: absolute; inset: 0; display: none;
  transform-origin: 50% 50%; transition: transform .6s ease;
}
.cj-rider-arrow::before {
  content: ''; position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 13px solid #2563eb;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35));
}
.cj-rider-marker.has-heading .cj-rider-arrow { display: block; }
@media (prefers-reduced-motion: reduce) { .cj-rider-arrow { transition: none; } }

/* ── CUSTOMER TRACKING (menu orders, Stage D) ── */
.cj-progress { list-style: none; display: flex; justify-content: space-between; gap: .25rem; padding: 0; margin: var(--space-2) 0 var(--space-4); position: relative; }
.cj-pstep { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; min-width: 0; }
/* connector from the previous step */
.cj-pstep + .cj-pstep::before {
  content: ''; position: absolute; top: 20px; right: 50%; width: 100%; height: 4px;
  background: #e8ddd3; border-radius: 2px; z-index: 0;
}
.cj-pstep.done + .cj-pstep::before { background: #C1441E; }
.cj-pstep-dot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--white); border: 3px solid #e8ddd3; color: var(--text-muted);
  font-size: 1.1rem;
}
.cj-pstep.done .cj-pstep-dot { background: #C1441E; border-color: #C1441E; color: #fff; }
.cj-pstep.now .cj-pstep-dot { background: #E8A93B; border-color: #E8A93B; color: #2B211D; box-shadow: 0 0 0 6px rgba(232,169,59,.25); }
.cj-pstep-label { margin-top: .4rem; font-size: var(--fs-xs); line-height: 1.25; color: var(--text-light); overflow-wrap: anywhere; }
.cj-pstep.done .cj-pstep-label { color: var(--green-dark); font-weight: 600; }
.cj-pstep.now .cj-pstep-label { color: #2B211D; font-weight: 700; }
.cj-progress-waiting {
  display: flex; align-items: center; gap: .55rem;
  background: var(--amber-light); color: var(--status-amber-text);
  border-radius: var(--radius-sm); padding: .6rem .8rem; margin-bottom: var(--space-3);
  font-size: var(--fs-sm); font-weight: 600;
}
.cj-progress-waiting-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: #E8A93B; animation: cjLivePulse 1.6s ease-in-out infinite; }
.cj-final { display: flex; align-items: flex-start; gap: .7rem; border-radius: var(--radius-base); padding: .8rem 1rem; font-size: var(--fs-sm); }
.cj-final > i { font-size: 1.4rem; line-height: 1; }
.cj-final strong { display: block; }
.cj-final-delivered { background: var(--status-green-bg); color: var(--status-green-text); }
.cj-final-cancelled { background: var(--status-red-bg); color: var(--status-red-text); }
.cj-track-map { height: 380px; border-radius: var(--radius-base); border: 1px solid rgba(122,46,29,.15); z-index: 0; }
.cj-track-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; margin-top: var(--space-3); }
.cj-track-updated { font-size: var(--fs-xs); color: var(--text-light); }
.cj-track-updated.stale { color: var(--status-amber-text); font-weight: 700; }
.cj-track-stale {
  display: flex; align-items: flex-start; gap: .5rem; margin-top: var(--space-2);
  background: var(--status-amber-bg); color: var(--status-amber-text);
  border-left: 4px solid #E8A93B; border-radius: var(--radius-sm); padding: .55rem .75rem; font-size: var(--fs-xs);
}
.cj-track-note { font-size: var(--fs-xs); color: var(--text-light); margin: var(--space-2) 0 0; }
@media (max-width: 768px) {
  .cj-track-map { height: 44vh; height: 44dvh; min-height: 240px; }
  .cj-pstep-dot { width: 38px; height: 38px; font-size: 1rem; }
  .cj-pstep + .cj-pstep::before { top: 18px; }
}
@media (prefers-reduced-motion: reduce) { .cj-progress-waiting-dot { animation: none; } }

/* ── MOBILE PASS: customer + rider screens ──
   Tap targets of at least 44px and readable (≥12px) text on phones. Where a
   bigger hit area would shift the layout (breadcrumbs), padding is cancelled
   by an equal negative margin, so the text stays where it was. */
.cj-nav-brand { display: inline-block; line-height: 44px; }
.cj-remove-link { color: var(--danger); font-size: .85rem; text-decoration: none; }
.cj-remove-link:hover { text-decoration: underline; }
.cj-clear-cart {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--danger); border: 1.5px solid var(--danger); border-radius: var(--radius-base);
  padding: 8px 18px; text-decoration: none; font-size: var(--fs-sm);
}
@media (max-width: 768px) {
  .cj-breadcrumb { font-size: var(--fs-sm); }
  .cj-breadcrumb-link { display: inline-block; padding: 14px 6px; margin: -14px -6px; }
  .cj-remove-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .5rem; margin-left: -.5rem; font-size: var(--fs-sm); }
  .cj-clear-cart { min-height: 44px; }
  .cj-footer ul { padding-left: 0; margin-bottom: 0; }
  .cj-footer li a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .cj-footer-social a { width: 44px; height: 44px; }
  /* Shared modal close (×): Bootstrap's is ~24px. */
  .modal-header .btn-close {
    width: 44px; height: 44px; padding: 0; box-sizing: border-box;
    margin: -.5rem -.5rem -.5rem auto; background-size: 14px;
  }
}
@media (max-width: 640px) {
  .cj-table-stack .cj-td-actions .btn-cj { flex: 1 1 auto; justify-content: center; }
}
/* Order QR (a fixed 300×300 SVG): shrinks to fit narrow phones. */
.cj-order-qr { display: inline-block; max-width: 100%; box-sizing: border-box; padding: 16px; background: #fff; border-radius: var(--radius-md); box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.cj-qr-caption { color: var(--text-light); font-size: var(--fs-sm); margin: var(--space-3) 0 0; }
.cj-qr-waiting { display: flex; align-items: center; gap: .7rem; background: var(--amber-light); color: var(--status-amber-text); border-radius: var(--radius-base); padding: .8rem 1rem; font-size: var(--fs-sm); }
.cj-qr-waiting > i { font-size: 1.6rem; line-height: 1; }
.cj-scan-hint { font-size: var(--fs-sm); color: var(--text-light); margin: var(--space-2) 0 0; }

/* ── QR HAND-OFF (rider scans the customer's order QR) ── */
.cj-qr-verified { display: inline-flex; align-items: flex-start; gap: .45rem; color: var(--status-green-text); font-weight: 600; font-size: var(--fs-sm); margin: 0 0 var(--space-3); }
.cj-qr-verified > i { font-size: 1.1rem; line-height: 1.2; }
.cj-qr-verified-meta { display: block; font-weight: 400; color: var(--text-light); font-size: var(--fs-xs); }
.cj-qr-unverified { display: inline-flex; align-items: center; gap: .45rem; color: var(--status-amber-text); background: var(--status-amber-bg); border-radius: var(--radius-sm); padding: .35rem .65rem; font-size: var(--fs-sm); font-weight: 600; }
.cj-qr-banner { margin-bottom: var(--space-3); }
.cj-qr-scan-box { margin-bottom: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid rgba(122,46,29,.12); }
.cj-qr-scan-btn { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.cj-qr-scan-hint { font-size: var(--fs-sm); color: var(--text-light); margin: var(--space-2) 0; }
.cj-qr-viewfinder { position: relative; background: #000; border-radius: var(--radius-base); overflow: hidden; aspect-ratio: 1 / 1; max-height: 60vh; max-height: 60dvh; margin: 0 auto; }
.cj-qr-viewfinder video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cj-qr-frame { position: absolute; inset: 15%; border: 3px solid rgba(255,255,255,.9); border-radius: var(--radius-md); box-shadow: 0 0 0 9999px rgba(0,0,0,.35); pointer-events: none; }
.cj-qr-scan-status { margin: var(--space-3) 0 0; font-size: var(--fs-sm); text-align: center; }
.cj-qr-scan-status.error { color: var(--status-red-text); font-weight: 600; }
/* The customer's phone number on the rider's nav card: a full 44px tap target. */
.cj-tel-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .35rem; margin: -12px -.35rem; }
.cj-order-qr svg { display: block; max-width: 100%; height: auto; }

/* ── RATINGS ── */
.cj-card-header-note { font-family: 'DM Sans', sans-serif; font-size: var(--fs-sm); font-weight: 400; opacity: .8; }
.cj-check { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-size: var(--fs-sm); cursor: pointer; }
.cj-check input { width: 18px; height: 18px; accent-color: var(--green-dark); }

/* Star picker (components/star-input) */
.cj-stars { border: 0; padding: 0; margin: 0 0 var(--space-4); min-width: 0; }
/* Floated so the legend sits inside the fieldset (also inside the shortcut's tinted box). */
.cj-stars-legend { float: left; width: 100%; font-size: var(--fs-base); font-weight: 600; color: var(--text-dark); margin-bottom: var(--space-1); padding: 0; }
.cj-stars-req { color: var(--required); margin-left: 2px; }
.cj-stars-hint, .cj-stars-row { clear: both; }
.cj-stars-hint { font-size: var(--fs-sm); color: var(--text-light); margin: 0 0 var(--space-1); }
.cj-stars-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.cj-stars-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.cj-star {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; font-size: 2rem; line-height: 1;
  color: #d9cdbf; cursor: pointer; border-radius: var(--radius-sm);
  transition: color .12s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.cj-star.on { color: var(--amber); }
.cj-stars-input:focus-visible + .cj-star { outline: 2px solid var(--green-dark); outline-offset: 1px; }
@media (prefers-reduced-motion: no-preference) {
  .cj-star:active { transform: scale(.88); }
}
.cj-stars-word { margin-left: var(--space-2); font-size: var(--fs-sm); color: var(--text-mid); min-width: 5.5em; }
.cj-stars-shortcut { background: var(--cream); border-radius: var(--radius-base); padding: var(--space-3); }

/* Rating form */
.cj-rate-form .cj-sticky-actions .cj-back-link { margin-top: 0; }
.cj-rate-item { padding: var(--space-3) 0; border-top: 1px solid rgba(122,46,29,.1); }
.cj-rate-item .cj-stars { margin-bottom: var(--space-2); }
.cj-rate-item-comment { width: 100%; }
.cj-rate-count { display: block; text-align: right; color: var(--text-light); font-size: var(--fs-xs); margin-top: 2px; }
.cj-rate-photo-img { display: block; max-width: 220px; width: 100%; height: auto; border-radius: var(--radius-base); box-shadow: var(--shadow-sm); margin-bottom: var(--space-2); }
.cj-rate-photo-btn { min-height: 44px; }
.cj-rate-photo-msg { display: block; color: var(--required); margin-top: var(--space-1); }
@media (max-width: 768px) {
  .cj-rate-item-comment { font-size: 16px; min-height: 44px; } /* no iOS zoom */
}

/* Reminder banner + rating summary */
.cj-rate-banner { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.cj-rate-banner > span { flex: 1 1 14rem; }
.cj-rate-banner-close { margin-left: auto; min-width: 44px; min-height: 44px; border: 0; background: none; font-size: 1.4rem; line-height: 1; color: inherit; cursor: pointer; }
.cj-stars-static { color: var(--amber); letter-spacing: 1px; white-space: nowrap; }
.cj-stars-static .off { color: #d9cdbf; }
.cj-rating-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-1) 0; flex-wrap: wrap; }
.cj-rating-row > span:first-child { color: var(--text-mid); }
.cj-rating-reply { background: var(--cream); border-left: 3px solid var(--amber); border-radius: var(--radius-sm); padding: var(--space-3); margin-top: var(--space-3); }

/* Rating badge on menu/package cards: "★ 4.6 (23)" */
.cj-rating-badge { display: inline-flex; align-items: center; gap: .25rem; font-size: var(--fs-sm); color: var(--text-mid); white-space: nowrap; }
.cj-rating-badge-star { color: var(--amber); font-size: 1.05em; }
.cj-rating-badge strong { color: var(--text-dark); }
.cj-rating-badge-none { color: var(--text-light); font-style: italic; }
.menu-card-link { color: inherit; text-decoration: none; display: inline-block; }
.menu-card-link:hover { color: var(--green-dark); text-decoration: underline; }
a.menu-card-img { text-decoration: none; }
.cj-pkg-rating { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; margin-bottom: .5rem; }
.cj-pkg-reviews-link { font-size: var(--fs-sm); font-weight: 600; color: var(--green-dark); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.cj-pkg-reviews-link:hover { text-decoration: underline; }

/* Menu item / package page */
.cj-item-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); overflow: hidden; }
.cj-item-hero-img { background: var(--green-light); min-height: 260px; display: flex; align-items: center; justify-content: center; color: var(--text-light); }
.cj-item-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cj-item-hero-body { padding: var(--space-5); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.cj-item-category { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--green-dark); }
.cj-item-rating-link { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.cj-item-desc { color: var(--text-mid); margin: 0; }
.cj-item-hero-body .menu-card-actions { width: 100%; max-width: 420px; }
.cj-item-closed { font-size: var(--fs-sm); color: var(--text-light); margin: 0; }
.cj-item-included { width: 100%; }
.cj-item-included-title { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--green-dark); margin-bottom: .35rem; }
.cj-chip { background: var(--green-light); color: var(--green-dark); font-size: var(--fs-xs); padding: .25rem .6rem; border-radius: 100px; }
.cj-chip-muted { background: var(--cream); color: var(--text-mid); border: 1px solid rgba(122,46,29,.12); }
.cj-item-cta { min-width: 200px; justify-content: center; }
@media (max-width: 768px) {
  .cj-item-hero { grid-template-columns: 1fr; }
  .cj-item-hero-img { min-height: 200px; max-height: 260px; }
  .cj-item-hero-body { padding: var(--space-4); }
  .cj-item-cta { width: 100%; }
}

/* Ratings & reviews section */
.cj-reviews-empty { text-align: center; padding: var(--space-4) 0; color: var(--text-mid); }
.cj-reviews-empty-stars { font-size: 1.6rem; color: #d9cdbf; letter-spacing: 2px; margin-bottom: var(--space-2); }
.cj-reviews-summary { display: flex; gap: var(--space-5); align-items: center; flex-wrap: wrap; padding-bottom: var(--space-4); border-bottom: 1px solid rgba(122,46,29,.1); }
.cj-reviews-score { text-align: center; min-width: 7rem; }
.cj-reviews-avg { font-family: 'Playfair Display', serif; font-size: 2.6rem; line-height: 1; color: var(--text-dark); }
.cj-reviews-count { font-size: var(--fs-sm); color: var(--text-light); margin-top: 2px; }
.cj-reviews-bars { list-style: none; padding: 0; margin: 0; flex: 1 1 14rem; display: grid; gap: 4px; }
.cj-reviews-bars li { display: grid; grid-template-columns: 2.6rem 1fr 2rem; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); }
.cj-reviews-bar-label { color: var(--text-mid); white-space: nowrap; }
.cj-reviews-bar { height: 8px; background: #efe6da; border-radius: 100px; overflow: hidden; }
.cj-reviews-bar > span { display: block; height: 100%; background: var(--amber); border-radius: 100px; }
.cj-reviews-bar-count { color: var(--text-light); text-align: right; }
.cj-review { padding: var(--space-4) 0; border-bottom: 1px solid rgba(122,46,29,.08); }
.cj-review:last-of-type { border-bottom: 0; }
.cj-review-head { display: flex; align-items: center; gap: var(--space-2) var(--space-3); flex-wrap: wrap; }
.cj-review-date { font-size: var(--fs-xs); color: var(--text-light); margin-left: auto; }
.cj-review-text { margin: var(--space-2) 0 0; }
.cj-review-order { margin: var(--space-2) 0 0; font-size: var(--fs-sm); color: var(--text-mid); }
.cj-review-order span { font-weight: 600; }
.cj-review-photo-link { display: inline-block; margin-top: var(--space-2); }
.cj-review-photo { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-base); }
.cj-reviews-pager { display: flex; align-items: center; justify-content: center; gap: var(--space-3); flex-wrap: wrap; padding-top: var(--space-3); font-size: var(--fs-sm); color: var(--text-light); }
@media (max-width: 768px) {
  /* Card names are links to the item/package page: a 44px tap area without
     changing the card's layout (padding cancelled by negative margin). */
  .menu-card-link { display: block; padding: 10px 0; margin: -10px 0; }
  .cat-pill { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ── ADMIN RATINGS ── */
.stat-low { background: linear-gradient(135deg, #b91c1c, #7f1d1d); color: var(--white); }
a.stat-card:hover { color: var(--white); }
.cj-avg-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-1); color: var(--text-dark); text-decoration: none; border-bottom: 1px solid rgba(122,46,29,.07); }
.cj-avg-row:hover { background: var(--green-light); }
.cj-avg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cj-avg-more summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--green-dark); }
.cj-avg-note, .cj-results-count { font-size: var(--fs-sm); color: var(--text-light); margin: calc(-1 * var(--space-3)) 0 var(--space-4); }
.cj-results-count { margin: 0 0 var(--space-3); }
.cj-admin-rating { border-left: 4px solid transparent; }
.cj-admin-rating.is-low { border-left-color: var(--danger, #b91c1c); background: #fff7f5; }
.cj-admin-rating.is-hidden { opacity: .92; }
.cj-admin-rating-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2) var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.cj-admin-rating-order { color: var(--green-dark); font-weight: 600; }
.cj-admin-rating-meta { font-size: var(--fs-xs); color: var(--text-light); }
.cj-admin-rating-badges { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.cj-admin-rating-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--space-1) var(--space-5); }
.cj-score { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-sm); color: var(--text-mid); white-space: nowrap; }
.cj-score.is-low { color: var(--status-red-text); font-weight: 700; }
.cj-admin-item-comment { margin: 0 0 var(--space-2); font-size: var(--fs-sm); color: var(--text-mid); }
.cj-admin-rating-comment { margin: var(--space-3) 0 0; }
.cj-admin-rating-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); align-items: flex-start; }
.cj-admin-action { flex: 1 1 100%; }
.cj-admin-action:not([open]) { flex: 0 0 auto; }
.cj-admin-action summary { list-style: none; }
.cj-admin-action summary::-webkit-details-marker { display: none; }
.cj-admin-action-form { margin-top: var(--space-2); max-width: 640px; }

/* Dashboard: low ratings widget */
.cj-low-ratings.has-low { border: 1.5px solid #fca5a5; }
.cj-low-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid rgba(122,46,29,.07); color: var(--text-dark); text-decoration: none; min-height: 44px; }
.cj-low-row:last-child { border-bottom: 0; }
.cj-low-row:hover { background: #fff7f5; }
.cj-low-score { flex: 0 0 auto; min-width: 2.75rem; text-align: center; font-weight: 700; color: var(--status-red-text); background: var(--status-red-bg); border-radius: 100px; padding: .2rem .5rem; font-size: var(--fs-sm); }
.cj-low-text { flex: 1 1 auto; min-width: 0; font-size: var(--fs-sm); }
.cj-low-comment { display: block; color: var(--text-mid); overflow-wrap: anywhere; }
.cj-low-time { flex: 0 0 auto; font-size: var(--fs-xs); color: var(--text-light); }
@media (max-width: 480px) {
  /* Score + text stay side by side; the time drops under the text. */
  .cj-low-row { flex-wrap: wrap; align-items: flex-start; }
  .cj-low-text { flex: 1 1 0; }
  .cj-low-time { flex-basis: 100%; padding-left: calc(2.75rem + var(--space-3)); }
}
@media (max-width: 768px) {
  /* 44px tap area on the order link without moving the text. */
  .cj-admin-rating-order { display: inline-block; padding: 12px 4px; margin: -12px -4px; }
}
