/* ============================================================
   NIGEL — "The Concierge" design system
   Paper · Ink · Brass.  Cormorant Garamond + Hanken Grotesk.
   Drop-in replacement for the old styles.css — same class names
   and IDs, new visual language. Dark mode via body.dark-mode.
   ============================================================ */

:root {
  /* Type */
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Warm paper (light, default) */
  --paper:        #F2ECE0;
  --paper-2:      #EDE5D6;
  --card:         #FBF8F1;
  --card-2:       #FFFFFF;
  --ink:          #1B1C1A;
  --ink-soft:     #383935;
  --muted:        #6E685C;
  --faint:        #9A9385;
  --line:         #E0D7C5;
  --line-strong:  #D0C5AE;
  --brass:        #A8824B;
  --brass-deep:   #8C6A38;
  --brass-soft:   #E9DCC2;
  --sky:          #38566B;
  --good:         #5A7D5A;
  --warn:         #B2724A;

  --shadow-sm: 0 1px 2px rgba(40,33,20,.06), 0 1px 1px rgba(40,33,20,.04);
  --shadow-md: 0 4px 14px rgba(40,33,20,.08), 0 1px 3px rgba(40,33,20,.05);
  --shadow-lg: 0 18px 50px rgba(35,28,15,.16), 0 4px 14px rgba(35,28,15,.08);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --page-max: 1180px;

  /* Back-compat aliases for older class hooks / inline styles */
  --background-color: var(--paper);
  --text-color: var(--ink);
  --text-color-rgb: 27, 28, 26;
  --text-color-typing: var(--ink);
  --muted-text-color: var(--muted);
  --primary-color: var(--ink);
  --secondary-color: var(--card);
  --accent-color: var(--brass);
  --accent-hover-color: var(--brass-deep);
  --gold-color: var(--brass-soft);
  --border-color: var(--line);
  --background-secondary: var(--card);
  --hover-color: var(--paper-2);
  --input-background-color: var(--card-2);
  --input-border-color: var(--line-strong);
  --input-focus-border-color: var(--brass);
  --scrollbar-track-color: var(--paper-2);
  --scrollbar-thumb-color: var(--line-strong);
  --button-color-text: var(--paper);
  --button-color-border: transparent;
}

body.dark-mode {
  --paper:        #15161A;
  --paper-2:      #101114;
  --card:         #1E2025;
  --card-2:       #25282E;
  --ink:          #ECE6D8;
  --ink-soft:     #D6D0C2;
  --muted:        #9E988A;
  --faint:        #6F6A60;
  --line:         #2C2F36;
  --line-strong:  #3A3E47;
  --brass:        #CBA869;
  --brass-deep:   #A8854B;
  --brass-soft:   #312B1E;
  --sky:          #8FB0C6;
  --good:         #8FB58F;
  --warn:         #D69A72;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 22px 56px rgba(0,0,0,.6), 0 4px 14px rgba(0,0,0,.4);

  --text-color-rgb: 236, 230, 216;
  --button-color-text: #15161A;
}

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

body {
  font-family: var(--sans);
  background-color: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  touch-action: manipulation;
  transition: background-color .5s ease, color .5s ease;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -0.01em; line-height: 1.1; }

::selection { background: var(--brass); color: var(--paper); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

/* type helpers */
.serif { font-family: var(--serif); }
.ital  { font-style: italic; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 11px;
  font-weight: 700;
  color: var(--brass-deep);
}
body.dark-mode .eyebrow { color: var(--brass); }
.sig { font-family: var(--serif); font-style: italic; color: var(--brass-deep); }
body.dark-mode .sig { color: var(--brass); }

/* paper grain */
.grain::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
body.dark-mode .grain::before { mix-blend-mode: screen; opacity: .25; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.fade-in { animation: fadeIn .5s forwards; }

/* ============================================================
   Buttons — pill, ink primary / brass accent / ghost
   ============================================================ */
.btn-start, .btn-waiter, .btn-waiter-secondary, .btn-waiter-accent, .btn-back {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 13px 26px; border-radius: var(--r-pill);
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease;
}

/* Primary = ink */
.btn-waiter, .btn-start {
  background-color: var(--ink); color: var(--paper); box-shadow: var(--shadow-sm);
}
.btn-waiter:hover, .btn-start:hover {
  transform: translateY(-1px); box-shadow: var(--shadow-md);
  background-color: var(--ink-soft); color: var(--paper);
}
.btn-waiter:active, .btn-start:active { transform: translateY(0) scale(.99); }

/* Accent = brass (use for primary CTAs) */
.btn-waiter-accent {
  background-color: var(--brass); color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brass) 35%, transparent);
}
.btn-waiter-accent:hover { transform: translateY(-1px); background-color: var(--brass-deep); color: #fff; }

/* Secondary / ghost */
.btn-waiter-secondary, .btn-back {
  background-color: transparent; color: var(--ink); border-color: var(--line-strong);
}
.btn-waiter-secondary:hover, .btn-back:hover {
  border-color: var(--ink); background-color: color-mix(in srgb, var(--ink) 4%, transparent);
  transform: translateY(-1px);
}

.btn-start i, .btn-waiter i, .btn-waiter-secondary i, .btn-waiter-accent i, .btn-back i { font-size: 1em; }

.button-container { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }

/* ============================================================
   Layout containers
   ============================================================ */
.container {
  max-width: 820px; margin: 40px auto; padding: 0 24px;
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: center;
}

/* ============================================================
   Landing — sticky nav + editorial hero (v2 "concierge")
   ============================================================ */
/* full-width landing wrapper escapes the narrow .container */
.landing { width: 100%; position: relative; z-index: 1; }

.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--paper) 82%, transparent); border-bottom: 1px solid var(--line); }
.nav .inner { max-width: var(--page-max); margin: 0 auto; padding: 14px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wm { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; background: none; border: none; padding: 0; cursor: pointer; }
.wm span { font-family: var(--serif); font-size: 22px; letter-spacing: -.01em; font-weight: 500; }
.nav-r { display: flex; align-items: center; gap: 14px; }
/* integrate existing app chrome into the sticky nav */
.nav .burger-menu { position: static; background: transparent; border: none; box-shadow: none; padding: 8px; min-width: 40px; min-height: 40px; }
.nav .burger-menu:hover { box-shadow: none; background: var(--paper-2); border-radius: var(--r-sm); }
.nav .theme-toggle { position: static; }
.nav .user-status { position: static; background: transparent; border: none; box-shadow: none; padding: 0; color: var(--muted); font-size: 13px; }
.nav-l { display: flex; align-items: center; gap: 14px; }

.hero { max-width: var(--page-max); margin: 0 auto; padding: clamp(44px,7vw,96px) 26px 60px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(36px,5vw,80px); align-items: center; }
.hero-l .kicker { font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--brass-deep); margin-bottom: 14px; }
body.dark-mode .hero-l .kicker { color: var(--brass); }
.hero-l h1 { font-size: clamp(44px,6.4vw,82px); line-height: .98; letter-spacing: -.025em; margin-bottom: 24px; }
.hero-l p.lead { font-size: clamp(17px,1.5vw,20px); line-height: 1.6; color: var(--muted); max-width: 480px; margin-bottom: 30px; }
.hero-l p.lead b { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.text-link { background: none; border: none; padding: 0 0 2px; font-family: var(--sans); font-size: 15px; color: var(--muted); cursor: pointer; border-bottom: 1px solid var(--line-strong); transition: color .2s, border-color .2s; }
.text-link:hover { color: var(--ink); border-color: var(--ink); }
.hero-l .free-note { margin-top: 26px; font-size: 14.5px; color: var(--faint); font-style: italic; font-family: var(--serif); }

.hero-r { position: relative; }
.hero-r .float-card { transform: rotate(-1.1deg); }
.stamp { position: absolute; right: -16px; bottom: -20px; z-index: 2; width: 82px; height: 82px; border-radius: 999px;
  border: 1.5px solid var(--brass); color: var(--brass-deep); display: grid; place-items: center; background: var(--paper);
  transform: rotate(-11deg); text-align: center; box-shadow: var(--shadow-md); }
body.dark-mode .stamp { color: var(--brass); }
.stamp span { font-family: var(--serif); font-style: italic; font-size: 13.5px; line-height: 1.1; }

/* register — letterhead credentials line */
.register { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper-2); }
.register .inner { max-width: var(--page-max); margin: 0 auto; padding: 15px 26px; display: flex; gap: 10px 26px; flex-wrap: wrap; justify-content: center; align-items: center; }
.register span { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); }
.register .dot { color: var(--brass); letter-spacing: 0; }

/* how I work — order of service */
.work { max-width: 720px; margin: 0 auto; padding: clamp(56px,9vw,104px) 26px clamp(20px,4vw,44px); }
.work h2 { text-align: center; font-size: clamp(30px,4vw,46px); margin-bottom: 8px; }
.work .sub { text-align: center; color: var(--faint); font-family: var(--serif); font-style: italic; font-size: 18px; margin-bottom: 44px; }
.work-item { display: grid; grid-template-columns: 64px 1fr; gap: 22px; align-items: baseline; padding: 26px 0; border-top: 1px solid var(--line); }
.work-item:last-child { border-bottom: 1px solid var(--line); }
.work-item .rn { font-family: var(--serif); font-style: italic; font-size: 40px; color: var(--brass); line-height: 1; }
.work-item h3 { font-size: 25px; margin-bottom: 7px; }
.work-item p { color: var(--muted); font-size: 16.5px; line-height: 1.6; margin: 0; max-width: 52ch; }

/* closing */
.closing { max-width: 720px; margin: 0 auto; padding: clamp(48px,7vw,84px) 26px clamp(60px,9vw,104px); text-align: center; }
.closing .tie { color: var(--brass-deep); margin-bottom: 20px; }
body.dark-mode .closing .tie { color: var(--brass); }
.closing blockquote { font-family: var(--serif); font-size: clamp(24px,3.2vw,34px); line-height: 1.34; letter-spacing: -.01em; margin: 0 0 24px; }
.closing blockquote em { color: var(--brass-deep); }
body.dark-mode .closing blockquote em { color: var(--brass); }
.closing .sig { font-size: 20px; margin-bottom: 30px; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--paper-2); }
.foot .inner { max-width: var(--page-max); margin: 0 auto; padding: 30px 26px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.foot a { color: var(--muted); font-size: 13.5px; text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot .links { display: flex; gap: 22px; flex-wrap: wrap; }

/* legacy front-page fallback (kept harmless) */
.front-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; max-width: var(--page-max); }
.front-page .icon, .front-page .logo { width: 120px; height: auto; object-fit: contain; display: block; margin: 0 auto 10px; }

/* Floating preview card (hero) */
.float-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 22px;
}
.float-card .fc-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.float-card .fc-title { font-family: var(--serif); font-size: 24px; margin-top: 4px; }
.float-card .fc-chip { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.float-card .fc-row { display: flex; gap: 13px; padding: 11px 0; border-top: 1px solid var(--line); }
.float-card .fc-row:first-of-type { border-top: none; }
.float-card .fc-time { font-family: var(--serif); font-size: 15px; color: var(--brass-deep); width: 44px; flex-shrink: 0; }
.float-card .fc-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.float-card .fc-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.float-card .fc-note { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }

/* ============================================================
   Question flow (form.js renders these)
   ============================================================ */
.question { display: none; }
.question.active { display: block; animation: fadeIn .4s both; }
.question-container {
  background-color: var(--card); padding: 38px; border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); border: 1px solid var(--line);
}
.question-container .icon { width: 64px; height: auto; object-fit: contain; margin: 0 auto 20px; display: block; }
.question-content h2 { margin-bottom: 14px; font-weight: 500; color: var(--ink); text-align: center; font-size: clamp(26px,3vw,38px); }
.question-content p { margin-bottom: 28px; color: var(--muted); font-size: 18px; text-align: center; line-height: 1.5; }
.question-content div label { display: block; font-size: 16px; color: var(--ink); margin-bottom: 10px; cursor: pointer; }
.question-content div label input { margin-right: 10px; accent-color: var(--brass); }

.input-box { position: relative; margin-bottom: 28px; }
.form-control, .input-box input, .input-box textarea {
  width: 100%; background-color: var(--card-2); border: 1px solid var(--line-strong);
  border-radius: var(--r-pill); padding: 12px 20px; font-size: 16px; box-sizing: border-box;
  color: var(--ink); font-family: var(--sans); transition: border-color .2s, box-shadow .2s;
}
.input-box textarea { border-radius: var(--r-md); }
.form-control:focus, .input-box input:focus, .input-box textarea:focus {
  border-color: var(--brass); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 18%, transparent);
}
.clear-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--faint); }

.traveler-entry { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.budget-input { display: flex; gap: 10px; align-items: center; }
.budget-input input[type="number"] { flex: 1; }
.currency-selector { min-width: 120px; }
.currency-selector select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background-color: var(--card-2); color: var(--ink); cursor: pointer; font-family: var(--sans);
}

/* Range slider */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; margin: 20px 0; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { width: 100%; height: 6px; background: var(--line-strong); border-radius: 5px; }
input[type="range"]::-moz-range-track { width: 100%; height: 6px; background: var(--line-strong); border-radius: 5px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; background: var(--brass); border: 2px solid var(--card-2); border-radius: 50%; cursor: pointer; margin-top: -7px; box-shadow: var(--shadow-sm); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; background: var(--brass); border: 2px solid var(--card-2); border-radius: 50%; cursor: pointer; box-shadow: var(--shadow-sm); }
input[type="range"]:focus { outline: none; }
.range-labels { display: flex; justify-content: space-between; margin-bottom: 10px; }
.range-labels .range-label { font-size: 15px; color: var(--muted); }

/* ============================================================
   Burger menu + slide-out
   ============================================================ */
.burger-menu {
  position: fixed; top: 20px; left: 20px; z-index: 1000; cursor: pointer; padding: 12px;
  min-width: 44px; min-height: 44px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-sm);
  transition: background-color .2s, box-shadow .2s;
}
.burger-menu:hover { box-shadow: var(--shadow-md); }
.burger-menu:active { transform: scale(.95); }
.burger-bar { width: 22px; height: 2.5px; background-color: var(--ink); margin: 3px 0; transition: .4s; border-radius: 2px; }

.menu-items {
  display: none; position: fixed; top: 66px; right: 18px; left: auto; background: var(--card);
  box-shadow: var(--shadow-lg); border-radius: var(--r-md); padding: 16px; min-width: 280px;
  max-height: 80vh; overflow-y: auto; border: 1px solid var(--line); z-index: 1000;
}
.menu-items.show { display: block; animation: slideDown .3s ease-out; }
.menu-items button {
  background: none; border: none; color: var(--ink); padding: 12px 16px; width: 100%;
  text-align: left; cursor: pointer; font-family: var(--sans); font-size: 15px;
  border-radius: var(--r-sm); transition: background-color .2s; min-height: 44px; display: flex; align-items: center;
}
.menu-items button:hover { background-color: var(--paper-2); }
.menu-items .logout { color: var(--warn); }
.menu-section { margin-bottom: 14px; }
.menu-section h4 { margin: 5px 10px; color: var(--brass-deep); font-family: var(--sans); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; }
body.dark-mode .menu-section h4 { color: var(--brass); }
.menu-spacer { height: 1px; background-color: var(--line); margin: 14px 0; }
.menu-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; margin: 8px 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-family: var(--sans);
  font-size: 16px; color: var(--ink); background: var(--card-2);
}
.menu-input:focus { outline: none; border-color: var(--brass); }

.auth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.auth-btn.google { background: var(--card-2); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.auth-btn.google:hover { background: var(--paper-2); }
.google-icon { width: 18px; height: 18px; background-image: url('https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg'); background-size: contain; background-repeat: no-repeat; background-position: center; flex: 0 0 18px; }

.itinerary-item { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color .2s; min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
.itinerary-item:hover { background-color: var(--paper-2); }
.itinerary-title { font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.itinerary-date { font-size: .85em; color: var(--faint); }
#itinerary-list { max-height: 300px; overflow-y: auto; border-radius: var(--r-sm); background: var(--paper-2); }
.loading-indicator { padding: 15px; text-align: center; color: var(--muted); font-style: italic; }
.no-itineraries, .error { padding: 14px; text-align: center; color: var(--muted); font-size: 14px; }

/* Credit display */
.credit-display { padding: 12px; background: var(--paper-2); border-radius: var(--r-sm); margin: 5px 0; border: 1px solid var(--line); }
.credit-item { display: flex; justify-content: space-between; align-items: center; margin: 4px 0; font-size: 14px; }
.credit-amount { font-weight: 700; color: var(--brass-deep); }
body.dark-mode .credit-amount { color: var(--brass); }
.free-credit { color: var(--good); font-weight: 600; }
.low-credit { color: var(--warn); font-weight: 600; }
.credit-refresh { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 4px; margin-left: 5px; }
.credit-refresh:hover { background: var(--paper-2); }

/* User status badge (logged-in email) */
.user-status {
  position: fixed; top: 18px; left: 72px; z-index: 1000; color: var(--muted);
  font-family: var(--sans); font-size: .85rem;
}
.user-status:empty { background: transparent !important; border: none !important; padding: 0 !important; box-shadow: none !important; }

/* ============================================================
   Theme toggle
   ============================================================ */
.theme-toggle { position: fixed; top: 20px; right: 20px; display: flex; align-items: center; gap: 10px; z-index: 1000; }
.switch { position: relative; display: inline-block; width: 58px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--line-strong); border-radius: 999px; transition: .4s; border: 1px solid var(--line); }
.slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 4px; bottom: 3px; background-color: var(--card-2); border-radius: 50%; transition: .4s; box-shadow: var(--shadow-sm); }
input:checked + .slider { background-color: var(--brass); }
input:checked + .slider:before { transform: translateX(27px); }
.slider.round { border-radius: 999px; }
#theme-label { color: var(--muted); font-size: 14px; font-family: var(--sans); }

/* ============================================================
   Security modal
   ============================================================ */
.security-modal { display: none; position: fixed; z-index: 2000; inset: 0; width: 100%; height: 100%; background-color: rgba(20,16,8,.45); backdrop-filter: blur(6px); }
.security-modal-content {
  background-color: var(--card); margin: 9% auto; padding: 32px; border-radius: var(--r-lg);
  width: 90%; max-width: 420px; text-align: center; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.security-modal h3 { color: var(--ink); margin-bottom: 14px; font-family: var(--serif); font-size: 26px; }
.security-modal p { color: var(--muted); margin-bottom: 18px; line-height: 1.5; }
.security-modal .auth-section { margin: 20px 0; }
.security-modal .menu-input { width: 100%; box-sizing: border-box; }
.security-modal button {
  background: var(--ink); color: var(--paper); border: none; padding: 13px 16px; width: 100%;
  text-align: center; cursor: pointer; font-family: var(--sans); font-size: 15px; font-weight: 600;
  border-radius: var(--r-pill); transition: background-color .2s, transform .12s; margin: 6px 0; min-height: 46px;
  display: flex; align-items: center; justify-content: center;
}
.security-modal button:hover { background: var(--ink-soft); transform: translateY(-1px); }
.security-modal .auth-btn.google { background: var(--card-2); color: var(--ink); border: 1px solid var(--line-strong); }
.security-modal .auth-btn.google:hover { background: var(--paper-2); }
.close-modal { color: var(--faint); float: right; font-size: 26px; font-weight: 400; cursor: pointer; line-height: 1; margin-top: -12px; margin-right: -8px; }
.close-modal:hover { color: var(--ink); }
.credit-info-preview { background: var(--paper-2); border-radius: var(--r-md); padding: 16px; margin: 16px 0; border: 1px solid var(--line); text-align: left; }
.credit-info-preview h4 { margin: 0 0 10px; color: var(--ink); font-size: 16px; font-family: var(--serif); }
.credit-info-preview p { margin: 5px 0; font-size: 14px; color: var(--muted); }

/* ============================================================
   Loading page
   ============================================================ */
.loading-container { max-width: 760px; margin: 40px auto; padding: 28px; text-align: center; background-color: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-md); border: 1px solid var(--line); }
.loading-container h1 { color: var(--ink); margin-bottom: 26px; font-family: var(--serif); font-size: clamp(30px,4vw,46px); animation: pulse 2s infinite; }
.loading-container p { color: var(--muted); font-size: 18px; line-height: 1.6; margin-bottom: 14px; font-family: var(--sans); }

/* ============================================================
   Itinerary text box (legacy plain-text view)
   ============================================================ */
.itinerary-box { background-color: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-md); border: 1px solid var(--line); padding: 2rem; margin: 2rem auto; max-width: 800px; width: 90%; }
.itinerary-text { font-family: var(--serif); font-size: 1.25rem; line-height: 1.8; white-space: pre-wrap; word-wrap: break-word; color: var(--ink); margin: 0; }
.title { text-align: center; color: var(--ink); margin: 2rem 0; font-size: clamp(34px,5vw,3rem); font-weight: 500; font-family: var(--serif); }
.content { padding: 1rem; min-height: calc(100vh - 60px); position: relative; z-index: 1; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .hero-r .float-card { transform: rotate(.5deg); }
  .foot .inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 768px) {
  .menu-items { top: 60px; right: 12px; left: 12px; min-width: auto; width: calc(100vw - 24px); }
  .theme-toggle { top: 14px; right: 14px; }
  .nav .inner { padding: 13px 16px; }
  .hero { padding: 34px 22px 48px; }
  .nav .user-status { display: none; }
}
@media (max-width: 576px) {
  .container { margin: 20px auto; padding: 0 16px; }
  .question-container { padding: 26px 20px; }
  .traveler-entry, .button-container { flex-direction: column; align-items: stretch; }
  .button-container .btn-start, .button-container .btn-waiter, .button-container .btn-waiter-secondary, .button-container .btn-waiter-accent { width: 100%; }
  .form-control, .input-box input, .input-box textarea { font-size: 16px; min-height: 46px; }
  .btn-start, .btn-waiter, .btn-waiter-secondary, .btn-waiter-accent { min-height: 46px; }
  .register .inner { gap: 8px 18px; }
  .work-item { grid-template-columns: 42px 1fr; gap: 14px; }
  .work-item .rn { font-size: 30px; }
}

/* ============================================================
   Off-canvas sidebar + delete modal (itinerary / dashboard)
   ============================================================ */
.sidebar-overlay { display: none; position: fixed; inset: 0; width: 100%; height: 100%; background: rgba(20,16,8,.45); z-index: 9999; opacity: 0; transition: opacity .3s ease; }
.sidebar-overlay.active { display: block; opacity: 1; }
.sidebar {
  position: fixed; top: 0; left: -100%; width: 85%; max-width: 320px; height: 100%;
  background: var(--card); border-right: 1px solid var(--line); z-index: 10000; overflow-y: auto;
  transition: left .3s ease; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
.sidebar.active { left: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 10; }
.sidebar-header h2 { margin: 0; font-size: 1.4rem; font-family: var(--serif); font-weight: 500; color: var(--ink); }
.sidebar-close { background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); transition: background .2s ease, color .2s ease; }
.sidebar-close:hover { background: var(--paper-2); color: var(--ink); }
.sidebar-content { padding: 20px; }
.sidebar-loading { text-align: center; padding: 40px 20px; color: var(--muted); }
.sidebar-loading i { font-size: 2rem; margin-bottom: 10px; color: var(--brass); }
.sidebar-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.sidebar-empty i { font-size: 3rem; margin-bottom: 15px; color: var(--brass); opacity: .5; }
.sidebar-empty .btn-create { display: inline-block; padding: 12px 24px; background: var(--brass); color: #fff; text-decoration: none; border-radius: var(--r-pill); font-size: .95rem; transition: background .2s ease; }
.sidebar-empty .btn-create:hover { background: var(--brass-deep); }

.sidebar .itinerary-list { list-style: none; padding: 0; margin: 0; }
.sidebar .itinerary-item { margin-bottom: 12px; border-radius: var(--r-md); overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); transition: transform .2s ease, box-shadow .2s ease; display: block; }
.sidebar .itinerary-item:hover { box-shadow: var(--shadow-sm); }
.sidebar .itinerary-item.current { border-color: var(--brass); background: var(--brass); }
.sidebar .itinerary-item.current .itinerary-title { color: #fff; }
.sidebar .itinerary-item.current .itinerary-meta { color: rgba(255,255,255,.85); }
.sidebar .itinerary-link { display: block; padding: 16px; color: inherit; text-decoration: none; min-height: 64px; }
.sidebar .itinerary-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.sidebar .itinerary-title { flex: 1; font-size: 1rem; font-weight: 600; color: var(--ink); margin: 0; line-height: 1.4; word-break: break-word; }
.sidebar .itinerary-title-input { flex: 1; font-size: 1rem; font-weight: 600; padding: 8px; border: 2px solid var(--brass); border-radius: var(--r-sm); background: var(--card-2); color: var(--ink); font-family: inherit; width: 100%; }
.sidebar .itinerary-title-input:focus { outline: none; border-color: var(--brass-deep); }
.sidebar .itinerary-actions { display: flex; gap: 4px; flex-shrink: 0; }
.sidebar .itinerary-btn { background: none; border: none; color: var(--muted); font-size: 1rem; cursor: pointer; padding: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); transition: all .2s ease; }
.sidebar .itinerary-btn:hover { background: var(--paper-2); color: var(--ink); }
.sidebar .itinerary-btn.btn-edit:hover { color: var(--brass); }
.sidebar .itinerary-btn.btn-delete:hover { color: var(--warn); }
.sidebar .itinerary-btn.btn-save { color: var(--good); }
.sidebar .itinerary-btn.btn-cancel { color: var(--muted); }
.sidebar .itinerary-meta { font-size: .85rem; color: var(--muted); margin: 0; }
.sidebar .itinerary-destination { font-weight: 500; }
.sidebar .itinerary-date { opacity: .85; }

.hamburger-menu { display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--ink); font-size: 1.4rem; cursor: pointer; padding: 8px; width: 44px; height: 44px; border-radius: var(--r-sm); transition: background .2s ease; }
.hamburger-menu:hover { background: var(--paper-2); }

/* delete / generic centered modal */
.modal { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay { position: absolute; inset: 0; width: 100%; height: 100%; background: rgba(20,16,8,.55); animation: fadeIn .2s ease; }
.modal-dialog { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); max-width: 400px; width: 100%; box-shadow: var(--shadow-lg); animation: scaleIn .3s ease; z-index: 1; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; font-size: 1.4rem; font-family: var(--serif); font-weight: 500; color: var(--ink); }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); transition: all .2s ease; }
.modal-close:hover { background: var(--paper-2); color: var(--ink); }
.modal-body { padding: 24px 20px; text-align: center; }
.warning-icon { font-size: 3rem; color: var(--warn); margin-bottom: 16px; }
.modal-message { font-size: 1rem; color: var(--ink); margin: 0 0 12px; line-height: 1.5; }
.modal-warning { font-size: .9rem; color: var(--muted); margin: 0; }
.modal-footer { display: flex; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line); }
.btn-cancel, .btn-delete { flex: 1; padding: 12px 20px; border: none; border-radius: var(--r-pill); font-size: 1rem; font-weight: 600; cursor: pointer; transition: all .2s ease; min-height: 46px; font-family: var(--sans); }
.btn-cancel { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-cancel:hover { background: var(--paper-2); }
.btn-delete { background: var(--warn); color: #fff; }
.btn-delete:hover { background: color-mix(in srgb, var(--warn) 80%, #000); }

@keyframes scaleIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
body.sidebar-open, body.modal-open { overflow: hidden; }
@media (min-width: 768px) { .sidebar { width: 320px; } .sidebar-overlay { background: rgba(20,16,8,.3); } }
