/* =========================================================================
   TricomHub Low-Fi Wireframe Design System
   Session 17 — Phase A. Greyscale only. No Acacia & Stone palette.
   Authored 2026-04-20. Hi-fi uses Instrument Serif/Inter; low-fi uses system-ui.
   ========================================================================= */

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; margin: 0; }

/* ---- Tokens: light mode (default) ------------------------------------- */
:root {
  /* Greyscale palette */
  --wf-bg:          #FFFFFF;
  --wf-surface:     #FAFAFA;
  --wf-surface-2:   #F3F4F6;
  --wf-line:        #E5E7EB;
  --wf-fill:        #D1D5DB;
  --wf-fill-strong: #9CA3AF;
  --wf-text-faint:  #9CA3AF;
  --wf-text-muted:  #6B7280;
  --wf-text:        #1F2937;
  --wf-text-strong: #111827;
  --wf-ink:         #111827;

  /* Semantic (low-fi only uses for state indicators; not decorative) */
  --wf-ok:          #059669;
  --wf-warn:        #B45309;
  --wf-err:         #B91C1C;

  /* Spacing scale */
  --wf-s-1: 4px;
  --wf-s-2: 8px;
  --wf-s-3: 12px;
  --wf-s-4: 16px;
  --wf-s-5: 24px;
  --wf-s-6: 32px;
  --wf-s-7: 48px;
  --wf-s-8: 64px;

  /* Type (single font: system-ui) */
  --wf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  --wf-fs-h1: 24px;
  --wf-lh-h1: 28px;
  --wf-fs-body: 14px;
  --wf-lh-body: 20px;
  --wf-fs-small: 12px;
  --wf-lh-small: 16px;

  /* Radii */
  --wf-r-sm: 4px;
  --wf-r-md: 8px;
  --wf-r-lg: 12px;
  --wf-r-pill: 999px;

  /* Elevation */
  --wf-shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --wf-shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --wf-shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
}

/* ---- Tokens: dark mode ------------------------------------------------- */
[data-mode="dark"] {
  --wf-bg:          #111827;
  --wf-surface:     #1F2937;
  --wf-surface-2:   #273242;
  --wf-line:        rgba(255,255,255,0.08);
  --wf-fill:        #4B5563;
  --wf-fill-strong: #6B7280;
  --wf-text-faint:  #6B7280;
  --wf-text-muted:  #9CA3AF;
  --wf-text:        #E5E7EB;
  --wf-text-strong: #FAFAFA;
  --wf-ink:         #FAFAFA;

  --wf-shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --wf-shadow-md: 0 2px 8px rgba(0,0,0,0.35);
  --wf-shadow-lg: 0 12px 32px rgba(0,0,0,0.45);
}

/* ---- Base -------------------------------------------------------------- */
html { font-family: var(--wf-font); font-size: var(--wf-fs-body); line-height: var(--wf-lh-body); }
body {
  background: var(--wf-bg);
  color: var(--wf-text);
  font-family: var(--wf-font);
  font-size: var(--wf-fs-body);
  line-height: var(--wf-lh-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, .wf-h1 { font-size: var(--wf-fs-h1); line-height: var(--wf-lh-h1); font-weight: 600; margin: 0; color: var(--wf-text-strong); }
h2, .wf-h2 { font-size: 18px; line-height: 24px; font-weight: 600; margin: 0; color: var(--wf-text-strong); }
h3, .wf-h3 { font-size: 15px; line-height: 20px; font-weight: 600; margin: 0; color: var(--wf-text-strong); }
p, .wf-p { margin: 0; }
small, .wf-small { font-size: var(--wf-fs-small); line-height: var(--wf-lh-small); color: var(--wf-text-muted); }
.wf-muted { color: var(--wf-text-muted); }
.wf-faint { color: var(--wf-text-faint); }

/* ---- Layout primitives ------------------------------------------------- */
.wf-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--wf-bg); }
.wf-container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--wf-s-4); }
.wf-main { flex: 1; padding: var(--wf-s-5) 0; }
.wf-section { padding: var(--wf-s-6) 0; }
.wf-divider { height: 1px; background: var(--wf-line); border: 0; margin: var(--wf-s-5) 0; }

.wf-stack { display: flex; flex-direction: column; gap: var(--wf-s-3); }
.wf-stack--lg { gap: var(--wf-s-5); }
.wf-stack--sm { gap: var(--wf-s-2); }
.wf-row { display: flex; flex-direction: row; align-items: center; gap: var(--wf-s-3); }
.wf-row--between { justify-content: space-between; }
.wf-row--end { justify-content: flex-end; }
.wf-row--wrap { flex-wrap: wrap; }
.wf-grow { flex: 1; }

.wf-grid {
  display: grid;
  gap: var(--wf-s-4);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.wf-grid--2 { grid-template-columns: repeat(2, 1fr); }
.wf-grid--3 { grid-template-columns: repeat(3, 1fr); }
.wf-grid--4 { grid-template-columns: repeat(4, 1fr); }
.wf-grid--magazine { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--wf-s-5); }
.wf-grid--compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--wf-s-3); }

@media (max-width: 900px) {
  .wf-grid--2, .wf-grid--3, .wf-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .wf-grid, .wf-grid--2, .wf-grid--3, .wf-grid--4, .wf-grid--magazine, .wf-grid--compact { grid-template-columns: 1fr; }
}

/* ---- Placeholders (the mountain-in-frame is the hero icon) ------------- */
.wf-placeholder-img {
  background: var(--wf-fill);
  border: 1px solid var(--wf-line);
  border-radius: var(--wf-r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wf-fill-strong);
  min-height: 120px;
  position: relative;
  overflow: hidden;
}
.wf-placeholder-img::before {
  content: "";
  display: block;
  width: 40%;
  height: 40%;
  max-width: 80px;
  max-height: 80px;
  background: var(--wf-fill-strong);
  -webkit-mask: url("../assets/icons/placeholder.svg") center / contain no-repeat;
  mask: url("../assets/icons/placeholder.svg") center / contain no-repeat;
  opacity: 0.65;
}
.wf-placeholder-img--16-9 { aspect-ratio: 16/9; }
.wf-placeholder-img--4-3 { aspect-ratio: 4/3; }
.wf-placeholder-img--square { aspect-ratio: 1/1; }
.wf-placeholder-img--hero { aspect-ratio: 21/9; min-height: 240px; }

/* Inline placeholder "lines" for copy */
.wf-line-ph { display: block; height: 10px; background: var(--wf-fill); border-radius: var(--wf-r-sm); margin-bottom: var(--wf-s-2); }
.wf-line-ph--strong { background: var(--wf-fill-strong); height: 12px; }
.wf-line-ph--w-50 { width: 50%; }
.wf-line-ph--w-70 { width: 70%; }
.wf-line-ph--w-80 { width: 80%; }
.wf-line-ph--w-100 { width: 100%; }

/* ---- Buttons ----------------------------------------------------------- */
.wf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--wf-s-2);
  min-height: 36px;
  padding: 0 var(--wf-s-4);
  border-radius: var(--wf-r-md);
  border: 1px solid var(--wf-line);
  background: var(--wf-surface);
  color: var(--wf-text);
  font-size: var(--wf-fs-body);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.wf-btn:hover { background: var(--wf-surface-2); }
.wf-btn--primary { background: var(--wf-text-strong); color: var(--wf-bg); border-color: var(--wf-text-strong); }
.wf-btn--primary:hover { background: var(--wf-ink); }
.wf-btn--ghost { background: transparent; border-color: transparent; }
.wf-btn--ghost:hover { background: var(--wf-surface-2); }
.wf-btn--danger { background: transparent; border-color: var(--wf-err); color: var(--wf-err); }
.wf-btn--icon { min-width: 36px; padding: 0; }
.wf-btn--lg { min-height: 48px; padding: 0 var(--wf-s-5); font-size: 15px; }
.wf-btn--sm { min-height: 28px; padding: 0 var(--wf-s-3); font-size: var(--wf-fs-small); }
.wf-btn--block { width: 100%; }
.wf-btn[disabled], .wf-btn--disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Inputs ------------------------------------------------------------ */
.wf-input, .wf-select, .wf-textarea {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: var(--wf-s-2) var(--wf-s-3);
  background: var(--wf-bg);
  color: var(--wf-text);
  border: 1px solid var(--wf-line);
  border-radius: var(--wf-r-md);
  font-size: var(--wf-fs-body);
  line-height: var(--wf-lh-body);
}
.wf-textarea { min-height: 96px; resize: vertical; }
.wf-input:focus, .wf-select:focus, .wf-textarea:focus { outline: 2px solid var(--wf-fill-strong); outline-offset: 1px; }

/* Range input — force greyscale across browsers (default accent leaks purple on Windows) */
input[type="range"], .wf-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; background: var(--wf-line); border-radius: var(--wf-r-pill);
  accent-color: var(--wf-text-strong); cursor: pointer; outline: none;
}
input[type="range"]::-webkit-slider-thumb, .wf-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--wf-text-strong); border: 2px solid var(--wf-bg); cursor: pointer;
}
input[type="range"]::-moz-range-thumb, .wf-range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--wf-bg);
  background: var(--wf-text-strong); cursor: pointer;
}
input[type="range"]::-moz-range-track, .wf-range::-moz-range-track {
  height: 4px; background: var(--wf-line); border-radius: var(--wf-r-pill);
}

/* Checkbox + radio — force greyscale accent (default also leaks) */
input[type="checkbox"], input[type="radio"] { accent-color: var(--wf-text-strong); }
.wf-label { display: block; font-size: var(--wf-fs-small); color: var(--wf-text-muted); margin-bottom: var(--wf-s-1); }
.wf-field { display: flex; flex-direction: column; gap: var(--wf-s-1); margin-bottom: var(--wf-s-3); }
.wf-field-hint { font-size: var(--wf-fs-small); color: var(--wf-text-faint); }
.wf-field-err { font-size: var(--wf-fs-small); color: var(--wf-err); }

.wf-check, .wf-radio {
  display: inline-flex; align-items: center; gap: var(--wf-s-2); cursor: pointer; font-size: var(--wf-fs-body);
}
.wf-check-box, .wf-radio-box {
  display: inline-block; width: 16px; height: 16px; border: 1px solid var(--wf-fill-strong); background: var(--wf-bg); border-radius: var(--wf-r-sm); flex-shrink: 0;
}
.wf-radio-box { border-radius: 50%; }
.wf-check--on .wf-check-box { background: var(--wf-text-strong); border-color: var(--wf-text-strong); }
.wf-radio--on .wf-radio-box { background: var(--wf-text-strong); border-color: var(--wf-text-strong); box-shadow: inset 0 0 0 3px var(--wf-bg); }

.wf-otp-row { display: flex; gap: var(--wf-s-2); }
.wf-otp-cell {
  width: 44px; height: 52px; border: 1px solid var(--wf-line); border-radius: var(--wf-r-md);
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--wf-text-strong); background: var(--wf-surface);
}

.wf-switch {
  width: 36px; height: 20px; background: var(--wf-fill); border-radius: var(--wf-r-pill); position: relative;
}
.wf-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--wf-bg); border-radius: 50%;
}
.wf-switch--on { background: var(--wf-text-strong); }
.wf-switch--on::after { left: 18px; }

/* ---- Cards ------------------------------------------------------------- */
.wf-card {
  background: var(--wf-surface);
  border: 1px solid var(--wf-line);
  border-radius: var(--wf-r-lg);
  padding: var(--wf-s-4);
  display: flex;
  flex-direction: column;
  gap: var(--wf-s-3);
}
.wf-card--flat { background: transparent; border-color: var(--wf-line); }
.wf-card--hoverable { cursor: pointer; transition: transform 0.1s ease, box-shadow 0.1s ease; }
.wf-card--hoverable:hover { box-shadow: var(--wf-shadow-md); transform: translateY(-2px); }
.wf-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--wf-s-3); }
.wf-card-title { font-size: 15px; font-weight: 600; color: var(--wf-text-strong); margin: 0; }
.wf-card-meta { font-size: var(--wf-fs-small); color: var(--wf-text-muted); }
.wf-card-body { display: flex; flex-direction: column; gap: var(--wf-s-2); }
.wf-card-footer { display: flex; justify-content: space-between; align-items: center; gap: var(--wf-s-3); padding-top: var(--wf-s-3); border-top: 1px solid var(--wf-line); }

/* ---- Nav --------------------------------------------------------------- */
.wf-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: var(--wf-s-4);
  padding: var(--wf-s-3) var(--wf-s-4);
  background: var(--wf-bg);
  border-bottom: 1px solid var(--wf-line);
  min-height: 56px;
}
.wf-nav-brand { display: inline-flex; align-items: center; gap: var(--wf-s-2); font-weight: 600; color: var(--wf-text-strong); }
.wf-nav-brand-mark { width: 24px; height: 24px; background: var(--wf-text-strong); border-radius: var(--wf-r-sm); }
.wf-nav-links { display: flex; gap: var(--wf-s-4); margin-left: var(--wf-s-4); }
.wf-nav-link { color: var(--wf-text-muted); font-size: var(--wf-fs-body); }
.wf-nav-link--active { color: var(--wf-text-strong); font-weight: 500; }
.wf-nav-actions { margin-left: auto; display: flex; align-items: center; gap: var(--wf-s-2); }
.wf-hamburger { display: none; }

@media (max-width: 768px) {
  .wf-nav-links { display: none; }
  .wf-hamburger { display: inline-flex; }
}

/* ---- Sidebar ----------------------------------------------------------- */
.wf-shell { display: flex; min-height: 100vh; }
.wf-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--wf-surface);
  border-right: 1px solid var(--wf-line);
  padding: var(--wf-s-4);
  display: flex;
  flex-direction: column;
  gap: var(--wf-s-3);
}
.wf-sidebar-brand { display: inline-flex; align-items: center; gap: var(--wf-s-2); font-weight: 600; color: var(--wf-text-strong); margin-bottom: var(--wf-s-4); }
.wf-sidebar-section { font-size: var(--wf-fs-small); color: var(--wf-text-faint); text-transform: uppercase; letter-spacing: 0.03em; padding: var(--wf-s-2) var(--wf-s-3); margin-top: var(--wf-s-3); }
.wf-sidebar-link {
  display: flex; align-items: center; gap: var(--wf-s-3);
  padding: var(--wf-s-2) var(--wf-s-3); border-radius: var(--wf-r-md);
  color: var(--wf-text-muted); font-size: var(--wf-fs-body);
}
.wf-sidebar-link:hover { background: var(--wf-surface-2); color: var(--wf-text-strong); }
.wf-sidebar-link--active { background: var(--wf-surface-2); color: var(--wf-text-strong); font-weight: 500; }
.wf-sidebar-icon { width: 16px; height: 16px; background: var(--wf-fill-strong); border-radius: var(--wf-r-sm); flex-shrink: 0; }
.wf-shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

@media (max-width: 900px) {
  .wf-sidebar { display: none; }
}

/* ---- Bottom nav (mobile-native variants can force this everywhere) ----- */
.wf-bottom-nav {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around; align-items: center;
  background: var(--wf-bg);
  border-top: 1px solid var(--wf-line);
  padding: var(--wf-s-2) 0;
  min-height: 56px;
}
.wf-bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--wf-text-muted); font-size: 10px; flex: 1;
}
.wf-bottom-nav-item--active { color: var(--wf-text-strong); }
.wf-bottom-nav-icon { width: 22px; height: 22px; background: var(--wf-fill-strong); border-radius: var(--wf-r-sm); }

/* ---- Badges, chips ----------------------------------------------------- */
.wf-badge {
  display: inline-flex; align-items: center; gap: var(--wf-s-1);
  padding: 2px var(--wf-s-2); min-height: 20px;
  background: var(--wf-surface-2); color: var(--wf-text); border-radius: var(--wf-r-pill);
  font-size: var(--wf-fs-small); font-weight: 500;
}
.wf-badge--outline { background: transparent; border: 1px solid var(--wf-line); }
.wf-badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--wf-fill-strong); }
.wf-badge--ok { color: var(--wf-ok); }
.wf-badge--ok.wf-badge--dot::before { background: var(--wf-ok); }
.wf-badge--warn { color: var(--wf-warn); }
.wf-badge--warn.wf-badge--dot::before { background: var(--wf-warn); }
.wf-badge--err { color: var(--wf-err); }
.wf-badge--err.wf-badge--dot::before { background: var(--wf-err); }

.wf-chip {
  display: inline-flex; align-items: center; gap: var(--wf-s-1);
  padding: var(--wf-s-1) var(--wf-s-3); border-radius: var(--wf-r-pill);
  border: 1px solid var(--wf-line); background: var(--wf-surface); color: var(--wf-text-muted);
  font-size: var(--wf-fs-small);
}
.wf-chip--active { background: var(--wf-text-strong); color: var(--wf-bg); border-color: var(--wf-text-strong); }

/* ---- Avatar ------------------------------------------------------------ */
.wf-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--wf-fill); color: var(--wf-text-strong);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--wf-fs-small); font-weight: 500; flex-shrink: 0;
}
.wf-avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.wf-avatar--lg { width: 48px; height: 48px; font-size: var(--wf-fs-body); }
.wf-avatar--xl { width: 80px; height: 80px; font-size: 20px; }

/* ---- Table ------------------------------------------------------------- */
.wf-table { width: 100%; border-collapse: collapse; background: var(--wf-bg); }
.wf-table th, .wf-table td {
  text-align: left; padding: var(--wf-s-3) var(--wf-s-4);
  border-bottom: 1px solid var(--wf-line); font-size: var(--wf-fs-body);
}
.wf-table th { color: var(--wf-text-muted); font-weight: 500; font-size: var(--wf-fs-small); text-transform: uppercase; letter-spacing: 0.02em; }
.wf-table tr:hover td { background: var(--wf-surface); }
.wf-table--dense th, .wf-table--dense td { padding: var(--wf-s-2) var(--wf-s-3); }
.wf-table-wrap { border: 1px solid var(--wf-line); border-radius: var(--wf-r-lg); overflow: hidden; }

/* ---- Tabs -------------------------------------------------------------- */
.wf-tabs { display: flex; gap: var(--wf-s-4); border-bottom: 1px solid var(--wf-line); }
.wf-tab { padding: var(--wf-s-3) 0; color: var(--wf-text-muted); border-bottom: 2px solid transparent; cursor: pointer; font-size: var(--wf-fs-body); }
.wf-tab--active { color: var(--wf-text-strong); border-bottom-color: var(--wf-text-strong); font-weight: 500; }
.wf-tabs--pill { border-bottom: 0; gap: var(--wf-s-2); }
.wf-tabs--pill .wf-tab { padding: var(--wf-s-2) var(--wf-s-3); border: 1px solid var(--wf-line); border-radius: var(--wf-r-pill); }
.wf-tabs--pill .wf-tab--active { background: var(--wf-text-strong); color: var(--wf-bg); border-color: var(--wf-text-strong); }

/* ---- Search / filters -------------------------------------------------- */
.wf-search {
  display: flex; align-items: center; gap: var(--wf-s-2);
  width: 100%; padding: var(--wf-s-2) var(--wf-s-3);
  background: var(--wf-surface); border: 1px solid var(--wf-line); border-radius: var(--wf-r-pill);
  color: var(--wf-text-muted);
}
.wf-search--hero {
  padding: var(--wf-s-3) var(--wf-s-4); font-size: 15px; border-radius: var(--wf-r-lg); background: var(--wf-bg);
  box-shadow: var(--wf-shadow-md);
}
.wf-search-box { flex: 1; background: transparent; border: 0; outline: none; color: var(--wf-text); font-size: inherit; }

/* ---- Modal / overlay --------------------------------------------------- */
.wf-modal-backdrop {
  position: fixed; inset: 0; background: rgba(17,24,39,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 20;
  padding: var(--wf-s-4);
}
.wf-modal {
  width: 100%; max-width: 480px;
  background: var(--wf-bg); border: 1px solid var(--wf-line); border-radius: var(--wf-r-lg);
  padding: var(--wf-s-5); display: flex; flex-direction: column; gap: var(--wf-s-4);
  box-shadow: var(--wf-shadow-lg);
}
.wf-modal--sm { max-width: 360px; }
.wf-modal--md { max-width: 560px; }
.wf-modal--lg { max-width: 720px; }
.wf-modal--full { max-width: 100%; height: 100%; border-radius: 0; border: 0; }
.wf-modal-title { font-size: 18px; font-weight: 600; color: var(--wf-text-strong); margin: 0; }
.wf-modal-actions { display: flex; justify-content: flex-end; gap: var(--wf-s-2); }

/* ---- Toast ------------------------------------------------------------- */
.wf-toast {
  display: flex; align-items: flex-start; gap: var(--wf-s-3);
  padding: var(--wf-s-3) var(--wf-s-4);
  background: var(--wf-bg); border: 1px solid var(--wf-line); border-radius: var(--wf-r-lg);
  box-shadow: var(--wf-shadow-md); max-width: 360px;
}
.wf-toast-icon { width: 20px; height: 20px; background: var(--wf-fill-strong); border-radius: 50%; flex-shrink: 0; }
.wf-toast--ok .wf-toast-icon { background: var(--wf-ok); }
.wf-toast--warn .wf-toast-icon { background: var(--wf-warn); }
.wf-toast--err .wf-toast-icon { background: var(--wf-err); }
.wf-toast-body { flex: 1; }
.wf-toast-title { font-weight: 600; color: var(--wf-text-strong); font-size: var(--wf-fs-body); }
.wf-toast-msg { font-size: var(--wf-fs-small); color: var(--wf-text-muted); }

/* ---- Progress, step indicators ---------------------------------------- */
.wf-progress { height: 4px; background: var(--wf-surface-2); border-radius: var(--wf-r-pill); overflow: hidden; }
.wf-progress-bar { height: 100%; background: var(--wf-text-strong); }

.wf-stepper { display: flex; align-items: center; gap: var(--wf-s-2); }
.wf-step { display: inline-flex; align-items: center; gap: var(--wf-s-2); color: var(--wf-text-muted); font-size: var(--wf-fs-small); }
.wf-step-n {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--wf-surface-2); color: var(--wf-text-muted);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 500;
}
.wf-step--done .wf-step-n, .wf-step--active .wf-step-n { background: var(--wf-text-strong); color: var(--wf-bg); }
.wf-step--active { color: var(--wf-text-strong); font-weight: 500; }
.wf-step-line { flex: 1; height: 1px; background: var(--wf-line); }

/* ---- Empty / loading states ------------------------------------------- */
.wf-empty {
  text-align: center; padding: var(--wf-s-7) var(--wf-s-4);
  color: var(--wf-text-muted); display: flex; flex-direction: column; align-items: center; gap: var(--wf-s-3);
}
.wf-empty-icon { width: 48px; height: 48px; background: var(--wf-fill); border-radius: var(--wf-r-lg); }
.wf-skeleton { background: linear-gradient(90deg, var(--wf-surface-2), var(--wf-line), var(--wf-surface-2)); border-radius: var(--wf-r-sm); height: 10px; }

/* ---- Phone / email frames (for template mockups) ---------------------- */
.wf-phone-frame {
  width: 100%; max-width: 320px; margin: 0 auto;
  background: var(--wf-surface); border: 1px solid var(--wf-line);
  border-radius: 32px; padding: 12px; position: relative;
}
.wf-phone-frame::before {
  content: ""; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 80px; height: 18px; background: var(--wf-ink); border-radius: 999px;
}
.wf-phone-screen {
  background: var(--wf-bg); border-radius: 24px; padding: var(--wf-s-6) var(--wf-s-3) var(--wf-s-3);
  min-height: 480px; display: flex; flex-direction: column; gap: var(--wf-s-3);
}

.wf-email-frame {
  background: var(--wf-bg); border: 1px solid var(--wf-line); border-radius: var(--wf-r-lg); overflow: hidden;
}
.wf-email-header {
  padding: var(--wf-s-3) var(--wf-s-4); background: var(--wf-surface-2);
  border-bottom: 1px solid var(--wf-line); font-size: var(--wf-fs-small); color: var(--wf-text-muted);
  display: flex; flex-direction: column; gap: 2px;
}
.wf-email-body { padding: var(--wf-s-5); display: flex; flex-direction: column; gap: var(--wf-s-3); color: var(--wf-text); }

/* ---- Responsive helpers (applied globally, affect every variant) ------ */
/* Prevent horizontal page scroll */
html, body { overflow-x: hidden; }

/* Tables scroll horizontally on narrow widths (keep table layout at desktop) */
.wf-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  .wf-table { display: block; max-width: 100%; overflow-x: auto; white-space: nowrap; }
  .wf-table thead, .wf-table tbody { display: table; width: max-content; min-width: 100%; }
}

/* Hero H1 responsive shrink */
@media (max-width: 600px) {
  .wf-hero-title { font-size: 28px !important; line-height: 32px !important; }
  .wf-hero { padding: var(--wf-s-5) 0 !important; }
}
@media (max-width: 900px) {
  .wf-hero-title { font-size: 36px; line-height: 40px; }
}

/* Booking widget stacks below content at tablet/mobile */
@media (max-width: 900px) {
  .wf-booking-widget { position: static; }
}

/* Nav collapse at narrow widths */
@media (max-width: 600px) {
  .wf-nav { padding: var(--wf-s-2) var(--wf-s-3); gap: var(--wf-s-2); min-height: 48px; flex-wrap: wrap; }
  .wf-nav-actions .wf-btn--sm:not(.wf-btn--primary):not([id^="g-"]) { display: none; }
  .wf-chipbar { order: 10; flex-basis: 100%; justify-content: flex-end; padding-top: var(--wf-s-2); border-top: 1px solid var(--wf-line); margin-top: var(--wf-s-2); }
}

/* Container padding shrinks on mobile */
@media (max-width: 600px) {
  .wf-container { padding: 0 var(--wf-s-3); }
  .wf-section { padding: var(--wf-s-5) 0; }
  .wf-card { padding: var(--wf-s-3); }
}

/* Multi-step stepper wraps on narrow */
@media (max-width: 600px) {
  .wf-stepper { flex-wrap: wrap; gap: var(--wf-s-2); }
  .wf-step { font-size: 10px; }
  .wf-step-line { flex: 0 0 auto; min-width: 12px; }
}

/* OTP input wraps */
@media (max-width: 400px) {
  .wf-otp-row { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .wf-otp-cell { width: 38px; height: 46px; font-size: 18px; }
}

/* Footer always stacks on mobile */
@media (max-width: 500px) {
  .wf-footer { padding: var(--wf-s-5) 0; }
  .wf-footer-cols { grid-template-columns: 1fr !important; gap: var(--wf-s-4); }
}

/* Images max-width safety */
.wf-placeholder-img, .wf-placeholder-img--hero { max-width: 100%; }

/* Form grids collapse on mobile */
@media (max-width: 600px) {
  [class*="wf-grid"] { grid-template-columns: 1fr !important; }
}

/* ---- Misc utility ------------------------------------------------------ */
.wf-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.wf-mt-1 { margin-top: var(--wf-s-1); }
.wf-mt-2 { margin-top: var(--wf-s-2); }
.wf-mt-3 { margin-top: var(--wf-s-3); }
.wf-mt-4 { margin-top: var(--wf-s-4); }
.wf-mt-5 { margin-top: var(--wf-s-5); }
.wf-mt-6 { margin-top: var(--wf-s-6); }
.wf-text-right { text-align: right; }
.wf-text-center { text-align: center; }

/* ---- Hero ------------------------------------------------------------- */
.wf-hero {
  padding: var(--wf-s-7) 0; display: flex; flex-direction: column; gap: var(--wf-s-4);
}
.wf-hero-title { font-size: 32px; line-height: 36px; font-weight: 600; color: var(--wf-text-strong); margin: 0; }
@media (min-width: 900px) {
  .wf-hero-title { font-size: 40px; line-height: 44px; }
}

/* ---- Sticky sidebar booking widget ------------------------------------ */
.wf-booking-widget {
  position: sticky; top: calc(var(--wf-s-5) + 56px);
  background: var(--wf-surface); border: 1px solid var(--wf-line); border-radius: var(--wf-r-lg);
  padding: var(--wf-s-4); display: flex; flex-direction: column; gap: var(--wf-s-3);
  box-shadow: var(--wf-shadow-md);
}

/* ---- Map placeholder -------------------------------------------------- */
.wf-map {
  background: var(--wf-surface-2); border: 1px solid var(--wf-line); border-radius: var(--wf-r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--wf-text-faint); min-height: 180px; font-size: var(--wf-fs-small);
  background-image:
    linear-gradient(var(--wf-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--wf-line) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px;
}

/* ---- Chat bubble ------------------------------------------------------ */
.wf-chat-bubble {
  position: fixed; right: var(--wf-s-4); bottom: var(--wf-s-4);
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--wf-text-strong); color: var(--wf-bg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--wf-shadow-lg); z-index: 15; cursor: pointer;
}
.wf-chat-panel {
  position: fixed; right: var(--wf-s-4); bottom: calc(var(--wf-s-4) + 72px);
  width: 320px; max-height: 440px; background: var(--wf-bg); border: 1px solid var(--wf-line);
  border-radius: var(--wf-r-lg); box-shadow: var(--wf-shadow-lg); z-index: 15;
  display: flex; flex-direction: column;
}
.wf-chat-header { padding: var(--wf-s-3) var(--wf-s-4); border-bottom: 1px solid var(--wf-line); font-weight: 600; color: var(--wf-text-strong); }
.wf-chat-messages { flex: 1; overflow: hidden; padding: var(--wf-s-3); display: flex; flex-direction: column; gap: var(--wf-s-2); }
.wf-chat-msg {
  max-width: 80%; padding: var(--wf-s-2) var(--wf-s-3); border-radius: var(--wf-r-lg); font-size: var(--wf-fs-small);
}
.wf-chat-msg--ours { align-self: flex-end; background: var(--wf-text-strong); color: var(--wf-bg); }
.wf-chat-msg--theirs { align-self: flex-start; background: var(--wf-surface-2); color: var(--wf-text); }
.wf-chat-input { padding: var(--wf-s-3); border-top: 1px solid var(--wf-line); display: flex; gap: var(--wf-s-2); }

/* ---- Footer ----------------------------------------------------------- */
.wf-footer {
  background: var(--wf-surface); border-top: 1px solid var(--wf-line);
  padding: var(--wf-s-6) 0; margin-top: var(--wf-s-7);
}
.wf-footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--wf-s-5); }
@media (max-width: 900px) { .wf-footer-cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .wf-footer-cols { grid-template-columns: 1fr; } }
.wf-footer-col-title { font-size: var(--wf-fs-small); color: var(--wf-text-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--wf-s-3); }
.wf-footer-col ul { display: flex; flex-direction: column; gap: var(--wf-s-2); }
.wf-footer-link { color: var(--wf-text-muted); font-size: var(--wf-fs-small); }

/* ---- Cosmetic page affordances (injected by page.js) ------------------
   Non-functional visual guides that represent real-product behaviour.
   Gallery's global toggles (V1-V5, M/T/D, L/K, LTR/RTL) are the real controls. */
.wf-chipbar {
  display: inline-flex;
  align-items: center;
  gap: var(--wf-s-2);
  flex-wrap: wrap;
}
.wf-sidebar-affordances {
  margin-top: auto;
  padding-top: var(--wf-s-4);
  border-top: 1px solid var(--wf-line);
}
.wf-affordance-float {
  position: fixed; top: 8px; right: 8px; z-index: 50;
}

/* On mobile: collapse chipbar to just language switcher; drop currency + theme to save nav space.
   The real TricomHub UI likely folds these into a profile dropdown on mobile anyway. */
@media (max-width: 768px) {
  .wf-chipbar .wf-ccy-switcher,
  .wf-chipbar .wf-theme-toggle { display: none; }
  .wf-chipbar { gap: var(--wf-s-1); }
  .wf-chipbar .wf-lang-switcher { padding: 1px; }
  .wf-chipbar .wf-lang-btn { min-width: 28px; font-size: 10px; padding: 0 6px; }
}

/* Language switcher (EN / AR) */
.wf-lang-switcher, .wf-ccy-switcher {
  display: inline-flex;
  gap: 2px; padding: 2px;
  border: 1px solid var(--wf-line);
  border-radius: var(--wf-r-pill);
  background: var(--wf-surface);
}
.wf-lang-btn, .wf-ccy-btn {
  min-width: 34px; min-height: 24px;
  border: 0; background: transparent;
  color: var(--wf-text-muted);
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
  border-radius: var(--wf-r-pill);
  cursor: pointer; padding: 0 var(--wf-s-2);
}
.wf-lang-btn:hover, .wf-ccy-btn:hover { color: var(--wf-text-strong); }
.wf-lang-btn--active, .wf-ccy-btn--active {
  background: var(--wf-text-strong); color: var(--wf-bg);
}

/* Theme toggle (☀ / ☾) */
.wf-theme-toggle {
  width: 32px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--wf-line); background: var(--wf-surface);
  border-radius: var(--wf-r-pill);
  color: var(--wf-text-muted); cursor: pointer;
  font-size: 14px; line-height: 1;
}
.wf-theme-toggle:hover { color: var(--wf-text-strong); }
.wf-theme-icon { pointer-events: none; }

/* Back-to-top floating button */
.wf-back-to-top {
  position: fixed;
  right: var(--wf-s-4); bottom: var(--wf-s-4);
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--wf-line);
  background: var(--wf-bg); color: var(--wf-text-strong);
  box-shadow: var(--wf-shadow-md);
  cursor: pointer; font-size: 18px;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none; z-index: 20;
}
.wf-back-to-top--visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.wf-back-to-top:hover { background: var(--wf-surface); }
/* Don't show back-to-top on tiny mobile (overlaps bottom-nav and thumb-CTA in V4) */
body[data-variant="v4-mobile-native"] .wf-back-to-top { bottom: calc(var(--wf-s-4) + 64px); }
/* In RTL, flip to the other side */
html[dir="rtl"] .wf-back-to-top { right: auto; left: var(--wf-s-4); }

/* RTL tweaks — mostly browser-native via dir="rtl", a few manual flips */
html[dir="rtl"] .wf-sidebar { border-right: 0; border-left: 1px solid var(--wf-line); }
html[dir="rtl"] .wf-nav-links { margin-left: 0; margin-right: var(--wf-s-4); }
html[dir="rtl"] .wf-nav-actions { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .wf-card-footer { flex-direction: row-reverse; }
html[dir="rtl"] .wf-breadcrumb > *:not(:last-child)::after { transform: scaleX(-1); }

/* ---- Element-pick mode (feedback / approve selection) ---------------- */
body.wf-pick-mode { cursor: crosshair; }
body.wf-pick-mode a, body.wf-pick-mode button { cursor: crosshair !important; }
.wf-pick-hover {
  outline: 2px dashed var(--wf-text-strong) !important;
  outline-offset: 2px;
  background: rgba(0,0,0,0.02);
}
body.wf-pick-mode--approve .wf-pick-hover {
  outline-color: var(--wf-ok) !important;
  background: rgba(5, 150, 105, 0.05);
}
/* Small hint at top while in pick mode */
body.wf-pick-mode::before {
  content: "Click any section to continue";
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  background: var(--wf-text-strong); color: var(--wf-bg);
  padding: 4px 12px; border-radius: var(--wf-r-pill);
  font-size: 11px; z-index: 100; pointer-events: none;
  box-shadow: var(--wf-shadow-md);
}
body.wf-pick-mode--approve::before {
  content: "Click a section to approve just that part";
  background: var(--wf-ok);
}

/* ---- Variant data-attribute hooks (overlay CSSes key off these) ------- */
[data-variant="v1-editorial"] { --wf-variant-hero-ratio: 21/9; }
[data-variant="v2-operator"]  { --wf-variant-hero-ratio: 5/2; }
[data-variant="v3-search-first"] { --wf-variant-hero-ratio: 16/9; }
[data-variant="v4-mobile-native"] { --wf-variant-hero-ratio: 4/3; }
[data-variant="v5-concierge"] { --wf-variant-hero-ratio: 21/9; }
