/* ============================================================
   WILDJOURNAL DESIGN SYSTEM
   Rugged outdoor adventure platform — built for van life
   Orange + Black, dark/light mode
   Extracted from design-system.html — do not invent new patterns.
   ============================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Brand colours — orange ramp */
  --wj-orange-50:  #FFF3EB;
  --wj-orange-100: #FFE0C7;
  --wj-orange-200: #FFC299;
  --wj-orange-300: #FF9F5C;
  --wj-orange-400: #FF7A1A;  /* primary brand orange */
  --wj-orange-500: #F2620A;
  --wj-orange-600: #D14E00;
  --wj-orange-700: #A33C00;
  --wj-orange-800: #732A00;
  --wj-orange-900: #4A1B00;

  /* Neutral ramp — warm-tinted charcoals, not pure grey */
  --wj-stone-50:  #F7F5F2;
  --wj-stone-100: #ECE8E2;
  --wj-stone-200: #D6D0C7;
  --wj-stone-300: #B0A89C;
  --wj-stone-400: #847C70;
  --wj-stone-500: #5E574D;
  --wj-stone-600: #423D35;
  --wj-stone-700: #2B2723;
  --wj-stone-800: #1C1916;  /* primary dark surface */
  --wj-stone-900: #121009;  /* near-black base */
  --wj-black:     #0A0907;

  /* Functional / signal colours (consistent both modes) */
  --wj-go:      #5BB85B;   /* drone: clear to fly / success */
  --wj-caution: #E8A317;   /* drone: amber / warning */
  --wj-nogo:    #DB4A3D;   /* drone: no-fly / danger */
  --wj-info:    #3D8BD4;   /* water / info */

  /* Type families */
  --wj-font-display: 'Archivo', system-ui, sans-serif;
  --wj-font-body: 'Inter', system-ui, sans-serif;
  --wj-font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Type scale (fluid) */
  --wj-text-xs:   0.75rem;
  --wj-text-sm:   0.875rem;
  --wj-text-base: 1rem;
  --wj-text-lg:   1.125rem;
  --wj-text-xl:   1.375rem;
  --wj-text-2xl:  1.75rem;
  --wj-text-3xl:  2.25rem;
  --wj-text-4xl:  clamp(2.5rem, 5vw, 3.5rem);
  --wj-text-5xl:  clamp(3rem, 8vw, 5.5rem);
  --wj-text-hero: clamp(3.5rem, 11vw, 8rem);

  /* Spacing scale */
  --wj-space-1: 0.25rem;
  --wj-space-2: 0.5rem;
  --wj-space-3: 0.75rem;
  --wj-space-4: 1rem;
  --wj-space-5: 1.5rem;
  --wj-space-6: 2rem;
  --wj-space-7: 3rem;
  --wj-space-8: 4rem;
  --wj-space-9: 6rem;
  --wj-space-10: 8rem;

  /* Radii — chunky, rugged, generous */
  --wj-radius-sm: 8px;
  --wj-radius-md: 14px;
  --wj-radius-lg: 22px;
  --wj-radius-xl: 32px;
  --wj-radius-pill: 999px;

  /* Borders */
  --wj-border-width: 1.5px;

  /* Shadows — soft, used sparingly */
  --wj-shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
  --wj-shadow-md: 0 8px 28px rgba(0,0,0,0.35);
  --wj-shadow-glow: 0 0 0 4px rgba(255,122,26,0.18);

  /* Layout */
  --wj-max-width: 1280px;
  --wj-gutter: clamp(1rem, 4vw, 2.5rem);

  /* Motion */
  --wj-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --wj-dur-fast: 0.15s;
  --wj-dur: 0.28s;
  --wj-dur-slow: 0.5s;
}

/* ---------- SEMANTIC TOKENS: DARK MODE (default) ---------- */
[data-theme="dark"] {
  /* Tells the browser to render native widgets (date/time pickers,
     scrollbars, form control chrome) using the dark palette so the
     calendar/clock icon and popup aren't light-on-light against our
     dark inputs. */
  color-scheme: dark;
  --bg: var(--wj-stone-900);
  --bg-elevated: var(--wj-stone-800);
  --bg-card: var(--wj-stone-800);
  --bg-card-hover: var(--wj-stone-700);
  --bg-inset: var(--wj-black);
  --bg-accent: var(--wj-orange-400);
  --bg-accent-hover: var(--wj-orange-500);

  --text: var(--wj-stone-50);
  --text-muted: var(--wj-stone-300);
  --text-subtle: var(--wj-stone-400);
  --text-on-accent: var(--wj-black);
  --text-accent: var(--wj-orange-400);

  --border: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.20);
  --border-accent: var(--wj-orange-400);

  --hero-overlay: linear-gradient(180deg, rgba(10,9,7,0.2) 0%, rgba(10,9,7,0.75) 100%);
}

/* ---------- SEMANTIC TOKENS: LIGHT MODE ---------- */
[data-theme="light"] {
  color-scheme: light;
  --bg: var(--wj-stone-50);
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: var(--wj-stone-100);
  --bg-inset: var(--wj-stone-100);
  --bg-accent: var(--wj-orange-400);
  --bg-accent-hover: var(--wj-orange-500);

  --text: var(--wj-stone-900);
  --text-muted: var(--wj-stone-500);
  --text-subtle: var(--wj-stone-400);
  --text-on-accent: #FFFFFF;
  --text-accent: var(--wj-orange-600);

  --border: rgba(18,16,9,0.12);
  --border-strong: rgba(18,16,9,0.22);
  --border-accent: var(--wj-orange-500);

  --hero-overlay: linear-gradient(180deg, rgba(10,9,7,0.15) 0%, rgba(10,9,7,0.55) 100%);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--wj-font-body);
  font-size: var(--wj-text-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background var(--wj-dur) var(--wj-ease), color var(--wj-dur) var(--wj-ease);
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- TYPOGRAPHY ---------- */
.wj-display {
  font-family: var(--wj-font-display);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
h1, h2, h3, h4 { font-family: var(--wj-font-display); font-weight: 800; line-height: 1.02; letter-spacing: -0.015em; }
.wj-eyebrow {
  font-family: var(--wj-font-display);
  font-size: var(--wj-text-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-accent);
}
.wj-mono { font-family: var(--wj-font-mono); }

/* ---------- RICH TEXT (sanitised user/admin HTML: news, diary) ---------- */
.wj-prose { color: var(--text); line-height: 1.7; }
.wj-prose > * + * { margin-top: var(--wj-space-4); }
.wj-prose h2, .wj-prose h3, .wj-prose h4 {
  margin-top: var(--wj-space-6);
  text-transform: uppercase;
}
.wj-prose h2 { font-size: var(--wj-text-2xl); }
.wj-prose h3 { font-size: var(--wj-text-xl); }
.wj-prose h4 { font-size: var(--wj-text-lg); }
.wj-prose ul, .wj-prose ol { padding-left: var(--wj-space-5); }
.wj-prose ul { list-style: disc; }
.wj-prose ol { list-style: decimal; }
.wj-prose li + li { margin-top: var(--wj-space-2); }
.wj-prose a { color: var(--text-accent); text-decoration: underline; text-underline-offset: 2px; }
.wj-prose strong, .wj-prose b { font-weight: 700; }
.wj-prose blockquote {
  border-left: var(--wj-border-width) solid var(--border-accent);
  padding-left: var(--wj-space-4);
  color: var(--text-subtle);
  font-style: italic;
}
.wj-prose img { border-radius: var(--wj-radius-md); }
.wj-prose figcaption { font-size: var(--wj-text-sm); color: var(--text-subtle); margin-top: var(--wj-space-2); }
.wj-prose pre {
  background: var(--bg-elevated);
  padding: var(--wj-space-4);
  border-radius: var(--wj-radius-md);
  overflow-x: auto;
  font-family: var(--wj-font-mono);
  font-size: var(--wj-text-sm);
}
.wj-prose code { font-family: var(--wj-font-mono); font-size: 0.9em; }
.wj-prose hr { border: none; border-top: var(--wj-border-width) solid var(--border); margin: var(--wj-space-6) 0; }

/* ---------- LAYOUT HELPERS ---------- */
.wj-container { max-width: var(--wj-max-width); margin-inline: auto; padding-inline: var(--wj-gutter); }
.wj-section { padding-block: var(--wj-space-9); }
.wj-section-sm { padding-block: var(--wj-space-7); }

/* ---------- BUTTONS ---------- */
.wj-btn {
  display: inline-flex; align-items: center; gap: var(--wj-space-3);
  padding: var(--wj-space-3) var(--wj-space-5);
  font-family: var(--wj-font-body); font-weight: 700; font-size: var(--wj-text-base);
  border-radius: var(--wj-radius-pill);
  transition: all var(--wj-dur) var(--wj-ease);
  white-space: nowrap;
}
.wj-btn:focus-visible { outline: none; box-shadow: var(--wj-shadow-glow); }
.wj-btn-primary { background: var(--bg-accent); color: var(--text-on-accent); }
.wj-btn-primary:hover { background: var(--bg-accent-hover); transform: translateY(-2px); }
.wj-btn-secondary { background: var(--bg-card); color: var(--text); border: var(--wj-border-width) solid var(--border-strong); }
.wj-btn-secondary:hover { border-color: var(--border-accent); color: var(--text-accent); }
.wj-btn-ghost { color: var(--text); padding-inline: var(--wj-space-3); }
.wj-btn-ghost:hover { color: var(--text-accent); }
.wj-btn-arrow {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: currentColor;
}
.wj-btn-arrow svg { width: 13px; height: 13px; }
.wj-btn-primary .wj-btn-arrow svg, .wj-btn-secondary .wj-btn-arrow svg { stroke: var(--bg-card); }
.wj-btn-primary .wj-btn-arrow { background: var(--text-on-accent); }
.wj-btn-primary .wj-btn-arrow svg { stroke: var(--bg-accent); }
.wj-btn-sm { padding: var(--wj-space-2) var(--wj-space-4); font-size: var(--wj-text-sm); }
.wj-btn-lg { padding: var(--wj-space-4) var(--wj-space-6); font-size: var(--wj-text-lg); }
.wj-btn-block { display: flex; width: 100%; justify-content: center; }

/* ---------- PILLS / TAGS / BADGES ---------- */
.wj-pill {
  display: inline-flex; align-items: center; gap: var(--wj-space-2);
  padding: var(--wj-space-2) var(--wj-space-4);
  border: var(--wj-border-width) solid var(--border-strong);
  border-radius: var(--wj-radius-pill);
  font-size: var(--wj-text-sm); font-weight: 600; color: var(--text);
  background: var(--bg-card);
}
.wj-pill-active { background: var(--bg-accent); color: var(--text-on-accent); border-color: var(--bg-accent); }
.wj-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: var(--wj-radius-pill);
  font-size: var(--wj-text-xs); font-weight: 700;
  font-family: var(--wj-font-display); letter-spacing: 0.06em; text-transform: uppercase;
}
.wj-tag-hike, .wj-imgcard-tag.wj-tag-hike { background: var(--wj-orange-100); color: var(--wj-orange-800); }
.wj-tag-water, .wj-imgcard-tag.wj-tag-water { background: #D5E8F7; color: #0C447C; }
.wj-tag-castle, .wj-imgcard-tag.wj-tag-castle { background: var(--wj-stone-200); color: var(--wj-stone-700); }
.wj-tag-camp, .wj-imgcard-tag.wj-tag-camp { background: #DCEFD0; color: #27500A; }
.wj-tag-sunset, .wj-imgcard-tag.wj-tag-sunset { background: #FFE0C7; color: #A33C00; }
[data-theme="dark"] .wj-tag-hike, [data-theme="dark"] .wj-imgcard-tag.wj-tag-hike { background: var(--wj-orange-900); color: var(--wj-orange-200); }
[data-theme="dark"] .wj-tag-water, [data-theme="dark"] .wj-imgcard-tag.wj-tag-water { background: #0C2E4C; color: #85B7EB; }
[data-theme="dark"] .wj-tag-castle, [data-theme="dark"] .wj-imgcard-tag.wj-tag-castle { background: var(--wj-stone-700); color: var(--wj-stone-200); }
[data-theme="dark"] .wj-tag-camp, [data-theme="dark"] .wj-imgcard-tag.wj-tag-camp { background: #173404; color: #97C459; }
[data-theme="dark"] .wj-tag-sunset, [data-theme="dark"] .wj-imgcard-tag.wj-tag-sunset { background: var(--wj-orange-900); color: var(--wj-orange-200); }

/* ---------- CARDS ---------- */
.wj-card {
  background: var(--bg-card);
  border: var(--wj-border-width) solid var(--border);
  border-radius: var(--wj-radius-lg);
  padding: var(--wj-space-5);
  transition: all var(--wj-dur) var(--wj-ease);
}
.wj-card-interactive { cursor: pointer; }
.wj-card-interactive:hover { border-color: var(--border-accent); transform: translateY(-3px); box-shadow: var(--wj-shadow-md); }
.wj-card-title { font-family: var(--wj-font-display); font-weight: 700; font-size: var(--wj-text-xl); text-transform: uppercase; margin-bottom: var(--wj-space-2); }
.wj-card-text { color: var(--text-muted); font-size: var(--wj-text-sm); }

/* image card (location/zone) */
.wj-imgcard {
  position: relative; border-radius: var(--wj-radius-lg); overflow: hidden;
  aspect-ratio: 4/3; cursor: pointer; display: block;
}
.wj-imgcard img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--wj-dur-slow) var(--wj-ease); }
.wj-imgcard:hover img { transform: scale(1.05); }
.wj-imgcard-overlay { position: absolute; inset: 0; background: var(--hero-overlay); }
.wj-imgcard-tag { position: absolute; top: var(--wj-space-4); left: var(--wj-space-4); background: var(--bg-elevated); color: var(--text); padding: var(--wj-space-2) var(--wj-space-4); border-radius: var(--wj-radius-pill); font-weight: 600; font-size: var(--wj-text-sm); }
.wj-imgcard-tag-right { left: auto; right: var(--wj-space-4); }
.wj-imgcard-info {
  position: absolute; bottom: var(--wj-space-5); left: var(--wj-space-5);
  right: calc(42px + var(--wj-space-5) + var(--wj-space-3));
  color: #fff;
}
.wj-imgcard-title { font-family: var(--wj-font-display); font-weight: 700; font-size: var(--wj-text-lg); text-transform: uppercase; line-height: 1.15; }
.wj-imgcard-meta { font-size: var(--wj-text-xs); font-weight: 500; opacity: 0.85; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }
.wj-imgcard-arrow { position: absolute; bottom: var(--wj-space-5); right: var(--wj-space-5); width: 42px; height: 42px; border-radius: 50%; background: var(--bg-accent); display: grid; place-items: center; }
.wj-imgcard-arrow svg { width: 18px; height: 18px; stroke: var(--text-on-accent); }
.wj-imgcard-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--wj-stone-700), var(--wj-stone-800)); display: grid; place-items: center; }
.wj-imgcard-placeholder svg { width: 56px; height: 56px; color: var(--wj-stone-500); }
.wj-imgcard-placeholder-img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- BENTO GRID (feature showcase) ---------- */
.wj-bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--wj-space-3); }
.wj-bento-item {
  background: var(--bg-card); border: var(--wj-border-width) solid var(--border);
  border-radius: var(--wj-radius-md); padding: var(--wj-space-5);
  transition: all var(--wj-dur) var(--wj-ease); min-height: 150px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.wj-bento-item:hover { border-color: var(--border-accent); background: var(--bg-card-hover); }
.wj-bento-item.span-2 { grid-column: span 2; }
.wj-bento-item.accent { background: var(--bg-accent); color: var(--text-on-accent); border-color: var(--bg-accent); }
.wj-bento-icon { width: 40px; height: 40px; color: var(--text-accent); }
.wj-bento-item.accent .wj-bento-icon { color: var(--text-on-accent); }
.wj-bento-item svg { width: 38px; height: 38px; stroke-width: 1.6; }
.wj-bento-label { font-family: var(--wj-font-display); font-weight: 700; font-size: var(--wj-text-lg); text-transform: uppercase; line-height: 1.05; margin-top: var(--wj-space-4); }
.wj-bento-num { font-family: var(--wj-font-display); font-weight: 900; font-size: var(--wj-text-4xl); line-height: 1; }

/* ---------- DRONE STATUS INDICATORS ---------- */
.wj-status {
  display: inline-flex; align-items: center; gap: var(--wj-space-2);
  padding: var(--wj-space-2) var(--wj-space-4); border-radius: var(--wj-radius-pill);
  font-weight: 700; font-size: var(--wj-text-sm);
}
.wj-status::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.wj-status-go { background: color-mix(in srgb, var(--wj-go) 18%, transparent); color: var(--wj-go); }
.wj-status-caution { background: color-mix(in srgb, var(--wj-caution) 18%, transparent); color: var(--wj-caution); }
.wj-status-nogo { background: color-mix(in srgb, var(--wj-nogo) 18%, transparent); color: var(--wj-nogo); }

/* ---------- FORMS ---------- */
.wj-field { margin-bottom: var(--wj-space-4); }
.wj-label { display: block; font-weight: 600; font-size: var(--wj-text-sm); margin-bottom: var(--wj-space-2); color: var(--text); }
.wj-input, .wj-select, .wj-textarea {
  width: 100%; padding: var(--wj-space-3) var(--wj-space-4);
  font-family: var(--wj-font-body); font-size: var(--wj-text-base); color: var(--text);
  background: var(--bg-inset); border: var(--wj-border-width) solid var(--border);
  border-radius: var(--wj-radius-sm); transition: all var(--wj-dur) var(--wj-ease);
}
.wj-input:focus, .wj-select:focus, .wj-textarea:focus { outline: none; border-color: var(--border-accent); box-shadow: var(--wj-shadow-glow); }
.wj-input::placeholder, .wj-textarea::placeholder { color: var(--text-subtle); }
.wj-textarea { min-height: 110px; resize: vertical; }
.wj-field-error { color: var(--wj-nogo); font-size: var(--wj-text-xs); margin-top: var(--wj-space-2); }
.wj-input-invalid { border-color: var(--wj-nogo); }
.wj-help { color: var(--text-subtle); font-size: var(--wj-text-xs); margin-top: var(--wj-space-2); }

/* range slider */
.wj-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: var(--border-strong); outline: none; }
.wj-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-accent); cursor: pointer; border: 3px solid var(--bg); }
.wj-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-accent); cursor: pointer; border: 3px solid var(--bg); }

/* toggle */
.wj-switch { position: relative; display: inline-block; width: 48px; height: 28px; }
.wj-switch input { opacity: 0; width: 0; height: 0; }
.wj-switch-track { position: absolute; inset: 0; background: var(--border-strong); border-radius: var(--wj-radius-pill); transition: var(--wj-dur); cursor: pointer; }
.wj-switch-track::before { content: ''; position: absolute; height: 20px; width: 20px; left: 4px; bottom: 4px; background: #fff; border-radius: 50%; transition: var(--wj-dur); }
.wj-switch input:checked + .wj-switch-track { background: var(--bg-accent); }
.wj-switch input:checked + .wj-switch-track::before { transform: translateX(20px); }

/* checkbox (checklist) */
.wj-check { display: flex; align-items: center; gap: var(--wj-space-3); padding: var(--wj-space-3); border-radius: var(--wj-radius-sm); transition: background var(--wj-dur-fast); cursor: pointer; }
.wj-check:hover { background: var(--bg-card-hover); }
.wj-check input { width: 22px; height: 22px; accent-color: var(--wj-orange-400); cursor: pointer; }
.wj-check.checked .wj-check-text { color: var(--text-subtle); text-decoration: line-through; }

/* ---------- TABLES (admin) ---------- */
.wj-table-wrap { border: var(--wj-border-width) solid var(--border); border-radius: var(--wj-radius-md); overflow: hidden; overflow-x: auto; }
.wj-table { width: 100%; border-collapse: collapse; }
.wj-table th { text-align: left; padding: var(--wj-space-3) var(--wj-space-4); font-family: var(--wj-font-display); font-weight: 700; font-size: var(--wj-text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-subtle); background: var(--bg-inset); border-bottom: var(--wj-border-width) solid var(--border); white-space: nowrap; }
.wj-table td { padding: var(--wj-space-3) var(--wj-space-4); border-bottom: var(--wj-border-width) solid var(--border); font-size: var(--wj-text-sm); }
.wj-table tr:last-child td { border-bottom: none; }
.wj-table tbody tr { transition: background var(--wj-dur-fast); }
.wj-table tbody tr:hover { background: var(--bg-card-hover); }
.wj-table-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-accent); color: var(--text-on-accent); display: inline-grid; place-items: center; font-weight: 700; font-size: var(--wj-text-xs); font-family: var(--wj-font-display); }

/* status dot for admin */
.wj-dot { display: inline-flex; align-items: center; gap: 6px; font-size: var(--wj-text-xs); font-weight: 600; }
.wj-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.wj-dot-active::before { background: var(--wj-go); }
.wj-dot-pending::before { background: var(--wj-caution); }
.wj-dot-suspended::before { background: var(--wj-caution); }
.wj-dot-banned::before { background: var(--wj-nogo); }

/* icon button (admin actions) */
.wj-iconbtn { width: 34px; height: 34px; border-radius: var(--wj-radius-sm); border: var(--wj-border-width) solid var(--border); display: inline-grid; place-items: center; color: var(--text-muted); transition: all var(--wj-dur-fast); background: transparent; }
.wj-iconbtn:hover { border-color: var(--border-accent); color: var(--text-accent); }
.wj-iconbtn svg { width: 16px; height: 16px; }
.wj-iconbtn-danger:hover { border-color: var(--wj-nogo); color: var(--wj-nogo); }

/* ---------- ADMIN SHELL ---------- */
.wj-admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.wj-admin-side { background: var(--bg-inset); padding: var(--wj-space-5); border-right: var(--wj-border-width) solid var(--border); }
.wj-admin-side-logo { font-family: var(--wj-font-display); font-weight: 900; font-size: var(--wj-text-lg); text-transform: uppercase; margin-bottom: var(--wj-space-6); }
.wj-admin-side-logo span { color: var(--text-accent); }
.wj-admin-navitem { display: flex; align-items: center; gap: var(--wj-space-3); padding: var(--wj-space-3); border-radius: var(--wj-radius-sm); color: var(--text-muted); font-weight: 600; font-size: var(--wj-text-sm); margin-bottom: 4px; transition: all var(--wj-dur-fast); cursor: pointer; }
.wj-admin-navitem:hover { background: var(--bg-card-hover); color: var(--text); }
.wj-admin-navitem.active { background: var(--bg-accent); color: var(--text-on-accent); }
.wj-admin-navitem svg { width: 18px; height: 18px; }
.wj-admin-main { padding: var(--wj-space-6); background: var(--bg); overflow: auto; }
.wj-admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--wj-space-5); gap: var(--wj-space-4); flex-wrap: wrap; }
.wj-admin-head h3 { font-size: var(--wj-text-2xl); text-transform: uppercase; }

/* stat cards */
.wj-stat { background: var(--bg-card); border: var(--wj-border-width) solid var(--border); border-radius: var(--wj-radius-md); padding: var(--wj-space-4); }
.wj-stat-label { font-size: var(--wj-text-xs); color: var(--text-subtle); font-family: var(--wj-font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.wj-stat-value { font-family: var(--wj-font-display); font-weight: 900; font-size: var(--wj-text-3xl); line-height: 1.1; margin-top: 4px; }
.wj-stat-delta { font-size: var(--wj-text-xs); font-weight: 600; margin-top: 4px; color: var(--text-subtle); }
.wj-stat-delta.up { color: var(--wj-go); }

/* responsive (from design system) */
@media (max-width: 860px) {
  .wj-bento { grid-template-columns: repeat(2, 1fr); }
  .wj-bento-item.span-2 { grid-column: span 2; }
  .wj-admin { grid-template-columns: 1fr; }
  .wj-admin-side { display: none; }
  .wj-admin-side.open { display: block; position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 80; }
}
@media (max-width: 560px) {
  .wj-bento { grid-template-columns: 1fr; }
  .wj-bento-item.span-2 { grid-column: span 1; }
}

/* ─────────────────────────────────────────────────────────────
   Trips & diary (M3)
   ───────────────────────────────────────────────────────────── */

/* Trip cards */
.wj-trip-card {
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--wj-radius-lg); overflow: hidden;
  text-decoration: none; color: inherit;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.wj-trip-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--wj-shadow-md); }
.wj-trip-card-cover { position: relative; aspect-ratio: 16 / 9; background: var(--bg-inset); }
.wj-trip-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wj-trip-card-cover .wj-imgcard-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-subtle); }
.wj-trip-card-body { padding: var(--wj-space-4); }

.wj-trip-status {
  display: inline-block; padding: 2px 10px; border-radius: var(--wj-radius-pill);
  font-size: var(--wj-text-xs); font-weight: 600; text-transform: capitalize;
  position: absolute; top: var(--wj-space-3); left: var(--wj-space-3);
  background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border);
}
.wj-trip-status-active { background: var(--wj-go); color: #fff; border-color: transparent; }
.wj-trip-status-completed { background: var(--bg-accent); color: var(--text-on-accent); border-color: transparent; }
.wj-trip-shared {
  position: absolute; top: var(--wj-space-3); right: var(--wj-space-3);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--wj-radius-pill);
  font-size: var(--wj-text-xs); background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border);
}

/* Maps */
.wj-trip-map, .wj-trip-edit-map {
  height: 360px; border-radius: var(--wj-radius-lg);
  border: 1px solid var(--border); overflow: hidden; background: var(--bg-inset);
}
.wj-trip-edit-map { height: 420px; }

/* Route planner toolbar + drawing tools */
.wj-route-toolbar { display: flex; align-items: center; gap: var(--wj-space-2); flex-wrap: wrap; }
.wj-route-mode-group {
  display: inline-flex; border: 1px solid var(--border); border-radius: var(--wj-radius-pill); overflow: hidden;
}
.wj-route-mode-btn {
  padding: 6px 14px; font-size: var(--wj-text-sm); border: 0; background: var(--bg-inset);
  color: var(--text-muted); cursor: pointer; font: inherit; line-height: 1.2;
}
.wj-route-mode-btn + .wj-route-mode-btn { border-left: 1px solid var(--border); }
.wj-route-mode-btn.is-active { background: var(--bg-accent); color: var(--text-on-accent); }

.wj-trip-edit-map-wrap { position: relative; margin-top: var(--wj-space-3); }
.wj-trip-edit-map-wrap .wj-trip-edit-map.is-drawing { cursor: crosshair; }

.wj-route-stats-card {
  position: absolute; bottom: var(--wj-space-3); left: var(--wj-space-3); z-index: 500;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--wj-radius-md);
  box-shadow: var(--wj-shadow-md); padding: var(--wj-space-3); max-width: 240px;
}
.wj-route-stats-row { display: flex; gap: var(--wj-space-4); }
.wj-route-stat { display: flex; flex-direction: column; }
.wj-route-stat strong { font-size: var(--wj-text-lg); font-family: var(--wj-font-mono); }
.wj-route-stat span { font-size: var(--wj-text-xs); color: var(--text-subtle); text-transform: uppercase; letter-spacing: .04em; }
.wj-route-stats-card .wj-help { margin: var(--wj-space-2) 0 0; font-size: var(--wj-text-xs); }

.wj-route-elevation-card {
  position: absolute; bottom: var(--wj-space-3); right: var(--wj-space-3); z-index: 500;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--wj-radius-md);
  box-shadow: var(--wj-shadow-md); padding: var(--wj-space-3); width: 280px; max-width: 45%;
}
.wj-route-elevation-card svg { width: 100%; height: 70px; display: block; }

@media (max-width: 640px) {
  .wj-route-stats-card, .wj-route-elevation-card { position: static; max-width: none; width: auto; margin-top: var(--wj-space-3); }
}

.wj-route-wp {
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  border: 2px solid var(--bg-accent); box-shadow: 0 1px 4px rgba(0,0,0,0.4); cursor: grab;
}
.wj-route-wp-start { background: var(--wj-go); border-color: var(--wj-go); }
.wj-route-wp-end { background: var(--wj-nogo); border-color: var(--wj-nogo); }

/* Day-by-day timeline */
.wj-day-timeline { display: flex; flex-direction: column; gap: var(--wj-space-4); }
.wj-day {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--wj-radius-lg); padding: var(--wj-space-4) var(--wj-space-5);
}
.wj-day-head { display: flex; align-items: baseline; gap: var(--wj-space-3); margin-bottom: var(--wj-space-2); }
.wj-day-head h3 { margin: 0; font-size: var(--wj-text-lg); text-transform: uppercase; }
.wj-day-loc {
  display: block; padding: var(--wj-space-3) 0; border-top: 1px solid var(--border);
}
.wj-day-loc-main { display: flex; align-items: center; gap: var(--wj-space-2); flex-wrap: wrap; }
.wj-day-loc-time { color: var(--text-accent); font-weight: 600; }
.wj-day-loc-name { font-weight: 600; color: var(--text); text-decoration: none; }
.wj-day-loc-name:hover { text-decoration: underline; }
.wj-day-loc-meta { display: flex; gap: var(--wj-space-3); flex-wrap: wrap; margin-top: var(--wj-space-1); color: var(--text-subtle); font-size: var(--wj-text-sm); }
.wj-day-loc-note { color: var(--text-muted); }
.wj-day-journal { display: flex; gap: var(--wj-space-2); flex-wrap: wrap; margin-top: var(--wj-space-3); }
.wj-journal-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--wj-radius-pill);
  background: var(--bg-inset); border: 1px solid var(--border);
  color: var(--text-muted); text-decoration: none; font-size: var(--wj-text-sm);
}
.wj-journal-chip:hover { border-color: var(--border-strong); color: var(--text); }

/* Editor: day / location inline forms */
.wj-day-edit-form {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--wj-space-3);
  align-items: end; margin-bottom: var(--wj-space-3);
}
.wj-tl-edit-fields {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: var(--wj-space-2);
  align-items: end; margin-top: var(--wj-space-2);
}
.wj-trip-cover-preview {
  width: 96px; height: 64px; border-radius: var(--wj-radius-md);
  background: var(--bg-inset); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--text-subtle);
}
.wj-trip-cover-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Routes list */
.wj-route-list { display: flex; flex-direction: column; gap: var(--wj-space-2); }
.wj-route-list:empty { display: none; }
.wj-day-routes { margin-top: var(--wj-space-3); }
.wj-route-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--wj-space-3);
  padding: var(--wj-space-3) var(--wj-space-4); background: var(--bg-inset);
  border: 1px solid var(--border); border-radius: var(--wj-radius-md);
}
.wj-route-stats { display: inline-flex; align-items: center; gap: var(--wj-space-2); color: var(--text-subtle); font-size: var(--wj-text-sm); }
.wj-pill-sm { font-size: var(--wj-text-xs); padding: 1px 8px; text-transform: capitalize; }

/* Share */
.wj-share-banner {
  display: flex; align-items: center; gap: var(--wj-space-2);
  padding: var(--wj-space-3) var(--wj-space-4); border-radius: var(--wj-radius-md);
  background: var(--bg-inset); border: 1px solid var(--border); color: var(--text-muted);
  font-size: var(--wj-text-sm);
}
.wj-share-link { display: flex; gap: var(--wj-space-2); align-items: center; flex-wrap: wrap; }
.wj-share-link .wj-input { flex: 1 1 280px; }

/* Pickers (search results lists) */
.wj-picker-results {
  display: flex; flex-direction: column; gap: 2px; margin-top: var(--wj-space-2);
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: var(--wj-radius-md);
  padding: var(--wj-space-2); max-height: 260px; overflow-y: auto;
}
.wj-picker-item {
  display: block; width: 100%; text-align: left; padding: var(--wj-space-2) var(--wj-space-3);
  background: transparent; border: 0; border-radius: var(--wj-radius-sm); color: var(--text);
  cursor: pointer; font: inherit;
}
.wj-picker-item:hover:not([aria-disabled]) { background: var(--bg-card-hover); }
.wj-picker-item[disabled], .wj-picker-item[aria-disabled] { color: var(--text-subtle); cursor: default; }

/* Modal */
.wj-modal {
  position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); padding: var(--wj-space-4);
}
.wj-modal[hidden] { display: none; }
.wj-modal-panel {
  width: 100%; max-width: 420px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--wj-radius-lg);
  box-shadow: var(--wj-shadow-md); padding: var(--wj-space-5);
}
.wj-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--wj-space-3); }
.wj-modal-head h3 { margin: 0; font-size: var(--wj-text-lg); }
.wj-modal-panel-lg { max-width: 900px; }
.wj-detail-big-map { height: min(70vh, 600px); border-radius: var(--wj-radius-md); overflow: hidden; }

/* Diary */
.wj-diary-card-thumb { aspect-ratio: 16 / 9; border-radius: var(--wj-radius-md); overflow: hidden; margin-bottom: var(--wj-space-3); background: var(--bg-inset); }
.wj-diary-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wj-diary-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--wj-space-3); }
.wj-diary-gallery figure { margin: 0; position: relative; border-radius: var(--wj-radius-md); overflow: hidden; background: var(--bg-inset); border: 1px solid var(--border); }
.wj-diary-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 4 / 3; }
.wj-diary-gallery figcaption { padding: var(--wj-space-2); font-size: var(--wj-text-xs); color: var(--text-subtle); }
.wj-diary-gallery .photo-remove { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.5); color: #fff; }
.wj-journal-entry { padding: var(--wj-space-4) 0; border-top: 1px solid var(--border); }
.wj-journal-entry h4 { margin: 0 0 var(--wj-space-1); font-size: var(--wj-text-lg); }

/* Itinerary (M4 stop planner) */
.wj-itin-list { display: flex; flex-direction: column; }
.wj-itin-stop {
  display: flex; gap: var(--wj-space-3); align-items: flex-start;
  padding: var(--wj-space-3) 0; border-top: 1px solid var(--border);
}
.wj-itin-stop-edit { cursor: grab; }
.wj-itin-stop-edit.dragging { opacity: 0.4; }
.wj-itin-stop-body { flex: 1; min-width: 0; }
.wj-itin-stop-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--wj-radius-md);
  background: var(--bg-inset); color: var(--text-muted); border: 1px solid var(--border);
}
.wj-itin-stop-icon-departure { color: #847C70; }
.wj-itin-stop-icon-fuel { color: #C2410C; }
.wj-itin-stop-icon-campsite { color: #27500A; }
.wj-itin-stop-icon-hike { color: var(--wj-orange-800); }
.wj-itin-stop-icon-toilet { color: #0C447C; }
.wj-itin-stop-icon-beach { color: #0C447C; }
.wj-itin-stop-icon-sunset { color: #A33C00; }
.wj-itin-stop-icon-cafe_pub { color: #6B4226; }
[data-theme="dark"] .wj-itin-stop-icon-hike { color: var(--wj-orange-200); }
[data-theme="dark"] .wj-itin-stop-icon-campsite { color: #97C459; }
[data-theme="dark"] .wj-itin-stop-icon-toilet,
[data-theme="dark"] .wj-itin-stop-icon-beach { color: #85B7EB; }
[data-theme="dark"] .wj-itin-stop-icon-sunset { color: var(--wj-orange-200); }
.wj-itin-stop-actions { margin-left: auto; display: inline-flex; gap: var(--wj-space-1); }
.wj-itin-leg {
  display: flex; align-items: center; gap: var(--wj-space-2); margin-left: 44px;
  padding: var(--wj-space-1) 0; color: var(--text-subtle); font-size: var(--wj-text-xs);
}
.wj-drag-handle { flex: none; color: var(--text-subtle); cursor: grab; align-self: center; }

/* Quill — match the dark-first design tokens */
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--border); }
.ql-toolbar.ql-snow { border-top-left-radius: var(--wj-radius-md); border-top-right-radius: var(--wj-radius-md); background: var(--bg-inset); }
.ql-container.ql-snow { border-bottom-left-radius: var(--wj-radius-md); border-bottom-right-radius: var(--wj-radius-md); background: var(--bg-card); color: var(--text); font-family: inherit; }
.ql-editor { min-height: 220px; font-size: var(--wj-text-base); }
.ql-editor.ql-blank::before { color: var(--text-subtle); font-style: normal; }
.ql-snow .ql-stroke { stroke: var(--text-muted); }
.ql-snow .ql-fill { fill: var(--text-muted); }
.ql-snow .ql-picker { color: var(--text-muted); }
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow .ql-toolbar button:hover .ql-stroke { stroke: var(--text-accent); }
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--text-accent); }

@media (max-width: 560px) {
  .wj-day-edit-form, .wj-tl-edit-fields { grid-template-columns: 1fr; }
}
