/**
 * ResolveJá — Design System (Web)
 * Clean + Premium + Human + Marketplace
 * Identidade: azul #004AAD + laranja #F08446 (extraídos da logo oficial)
 */

:root {
  /* ——— Brand ——— */
  --brand-primary: #004AAD;
  --brand-primary-dark: #003D91;
  --brand-primary-light: rgba(0, 74, 173, 0.10);
  --brand-secondary: #F08446;
  --brand-secondary-dark: #C45A14; /* contraste seguro p/ texto/botões */
  --brand-secondary-light: rgba(240, 132, 70, 0.12);

  /* ——— Semantic aliases (componentes existentes) ——— */
  --color-primary: var(--brand-primary);
  --color-primary-hover: var(--brand-primary-dark);
  --color-primary-soft: var(--brand-primary-light);

  --color-accent: var(--brand-secondary-dark);
  --color-accent-hover: #A34B10;
  --color-accent-soft: var(--brand-secondary-light);

  --color-ink: #0c1f24;
  --color-text: #14262b;
  --color-text-muted: #5f7379;
  --color-text-inverse: #ffffff;

  --color-background: #f6f4f1;
  --color-surface: #ffffff;
  --color-surface-2: #f0eeea;
  --color-surface-elevated: #ffffff;

  --color-border: rgba(12, 31, 36, 0.09);
  --color-border-strong: rgba(12, 31, 36, 0.16);

  --color-success: #1b7a4a;
  --color-success-bg: #e8f6ee;
  --color-warning: #9a6700;
  --color-warning-bg: #fff6e0;
  --color-danger: #b42318;
  --color-danger-bg: #fceceb;
  --color-info: var(--brand-primary);
  --color-info-bg: rgba(0, 74, 173, 0.08);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(12, 31, 36, 0.04);
  --shadow-sm: 0 4px 14px rgba(12, 31, 36, 0.05);
  --shadow-md: 0 10px 30px rgba(12, 31, 36, 0.07);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;

  --container: 1160px;
  --header-h: 56px;
  --sidebar-w: 240px;
  --context-w: 280px;
  --bottom-nav-h: 64px;
  --transition: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-background);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin: 0; color: var(--color-ink); }
p { margin: 0; }

/* ——— Layout ——— */
.rj-shell { min-height: 100vh; display: flex; flex-direction: column; }
.rj-main { flex: 1; }
.rj-container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.rj-section { padding: var(--space-5) 0; }
.rj-section--tight { padding: var(--space-4) 0; }
.rj-section__head { margin-bottom: var(--space-6); max-width: 640px; }
.rj-section__title { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: var(--space-2); }
.rj-section__sub { color: var(--color-text-muted); font-size: 1.05rem; }

/* ——— Header ——— */
.rj-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(246, 244, 241, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.rj-header__inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
}
.rj-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.04em;
  color: var(--color-ink);
  white-space: nowrap;
}
.rj-logo span { color: var(--brand-secondary-dark); }
.rj-nav { display: flex; align-items: center; gap: 4px; }
.rj-nav__link {
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}
.rj-nav__link:hover, .rj-nav__link.is-active {
  color: var(--color-ink);
  background: rgba(12, 31, 36, 0.05);
}
.rj-header__actions { display: flex; align-items: center; gap: var(--space-2); }
.rj-auth-actions { display: flex; align-items: center; gap: var(--space-2); }
.rj-user-menu { position: relative; }
.rj-user-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-pill); padding: 4px 10px 4px 4px;
  cursor: pointer;
}
.rj-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-primary-soft); color: var(--color-primary);
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
  overflow: hidden;
}
.rj-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rj-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 200px; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 6px;
}
.rj-dropdown a, .rj-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; border: 0; background: transparent;
  border-radius: var(--radius-sm); color: var(--color-text); font-weight: 500;
  cursor: pointer;
}
.rj-dropdown a:hover, .rj-dropdown button:hover { background: var(--color-surface-2); }
.rj-dropdown__danger { color: var(--color-danger, #b42318) !important; font-weight: 600 !important; }
.rj-footer__logout {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  color: inherit; padding: 0; margin-top: 8px; cursor: pointer; font: inherit;
}
.rj-footer__logout:hover { color: var(--color-primary); }
.rj-menu-toggle {
  display: none; border: 1px solid var(--color-border); background: var(--color-surface);
  width: 40px; height: 40px; border-radius: var(--radius-sm);
}
.rj-mobile-nav {
  display: none; border-top: 1px solid var(--color-border);
  background: var(--color-background); padding: var(--space-3) 20px var(--space-4);
}
.rj-mobile-nav.is-open { display: block; }
.rj-mobile-nav a {
  display: block; padding: 12px 0; border-bottom: 1px solid var(--color-border);
  font-weight: 500;
}

/* ——— Buttons ——— */
.rj-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-pill); border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.rj-btn:hover { transform: translateY(-1px); }
.rj-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.rj-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.rj-btn--primary { background: var(--color-primary); color: var(--color-text-inverse); }
.rj-btn--primary:hover { background: var(--color-primary-hover); }
.rj-btn--accent { background: var(--color-accent); color: var(--color-text-inverse); }
.rj-btn--accent:hover { background: var(--color-accent-hover); }
.rj-btn--ghost { background: transparent; border-color: var(--color-border-strong); color: var(--color-text); }
.rj-btn--ghost:hover { background: var(--color-surface); }
.rj-btn--soft { background: var(--color-primary-soft); color: var(--color-primary); }
.rj-btn--danger { background: var(--color-danger); color: var(--color-text-inverse); }
.rj-btn--danger:hover { background: #912018; }
.rj-btn--block { width: 100%; }
.rj-btn--sm { min-height: 36px; padding: 0 14px; font-size: 0.88rem; }
.rj-btn--lg { min-height: 52px; padding: 0 24px; font-size: 1rem; }

/* ——— Forms ——— */
.rj-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--color-ink); }
.rj-field {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--color-surface); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md); transition: border-color var(--transition), box-shadow var(--transition);
}
textarea.rj-field { min-height: 110px; resize: vertical; }
.rj-field:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.rj-field-error { color: var(--color-danger); font-size: 0.85rem; margin-top: 6px; }
.rj-search {
  display: flex; gap: 10px; align-items: stretch;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); padding: 8px; box-shadow: var(--shadow-sm);
}
.rj-search__input {
  flex: 1; border: 0; background: transparent; padding: 12px 14px; min-width: 0; outline: none; font-size: 1.05rem;
}
.rj-search__icon { display: grid; place-items: center; padding-left: 10px; color: var(--color-text-muted); }

/* ——— Cards ——— */
.rj-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-xs); transition: box-shadow var(--transition), transform var(--transition);
}
.rj-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.rj-card__media { aspect-ratio: 16/11; background: var(--color-surface-2); overflow: hidden; }
.rj-card__media img { width: 100%; height: 100%; object-fit: cover; }
.rj-card__body { padding: var(--space-4); display: grid; gap: 8px; }
.rj-card__title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.02em; }
.rj-card__meta { color: var(--color-text-muted); font-size: 0.92rem; }
.rj-card__price { font-weight: 700; color: var(--color-ink); }
.rj-card__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.rj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
}
.rj-grid--cats {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}
.rj-cat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: var(--space-4); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  transition: border-color var(--transition), transform var(--transition);
}
.rj-cat:hover { border-color: var(--color-primary); transform: translateY(-2px); }
.rj-cat__icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--color-primary-soft); color: var(--color-primary);
  display: grid; place-items: center; font-weight: 700;
}
.rj-cat__name { font-weight: 600; font-size: 0.95rem; }

/* ——— Badge / Rating ——— */
.rj-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 600; background: var(--color-surface-2); color: var(--color-text-muted);
}
.rj-badge--teal { background: var(--color-primary-soft); color: var(--color-primary); }
.rj-badge--ink { background: rgba(12,31,36,.08); color: var(--color-ink); }
.rj-badge--warn { background: var(--color-warning-bg); color: var(--color-warning); }
.rj-badge--ok { background: var(--color-success-bg); color: var(--color-success); }
.rj-badge--danger { background: var(--color-danger-bg); color: var(--color-danger); }
.rj-rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 0.9rem; }
.rj-rating span { color: var(--color-text-muted); font-weight: 500; }

/* ——— Hero ——— */
.rj-hero {
  padding: var(--space-8) 0 var(--space-7);
  background:
    radial-gradient(800px 400px at 0% 0%, rgba(0, 74, 173, 0.08), transparent 60%),
    radial-gradient(700px 360px at 100% 10%, rgba(240, 132, 70, 0.06), transparent 55%),
    var(--color-background);
}
.rj-hero__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  max-width: 16ch; margin-bottom: var(--space-4);
}
.rj-hero__lead {
  font-size: 1.15rem; color: var(--color-text-muted);
  max-width: 42ch; margin-bottom: var(--space-6);
}
.rj-hero__search { max-width: 720px; }

/* ——— How it works ——— */
.rj-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.rj-step { padding: var(--space-5); background: var(--color-surface); border-radius: var(--radius-lg); border: 1px solid var(--color-border); }
.rj-step__num {
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 700;
  color: var(--color-primary); margin-bottom: var(--space-3);
}
.rj-step__title { font-size: 1.15rem; margin-bottom: var(--space-2); }
.rj-step__text { color: var(--color-text-muted); }

/* ——— Banner ——— */
.rj-banner {
  border-radius: var(--radius-xl); padding: clamp(28px, 5vw, 48px);
  background: var(--color-ink); color: #fff;
  display: grid; gap: var(--space-4); align-items: center;
}
.rj-banner--split { grid-template-columns: 1.4fr auto; }
.rj-banner h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.rj-banner p { color: rgba(255,255,255,.78); max-width: 48ch; }
.rj-banner--soft {
  background: linear-gradient(135deg, #e7f5f3, #f3ebe3);
  color: var(--color-ink); border: 1px solid var(--color-border);
}
.rj-banner--soft h2 { color: var(--color-ink); }
.rj-banner--soft p { color: var(--color-text-muted); }

/* ——— Discovery layout ——— */
.rj-discover { display: grid; grid-template-columns: 260px 1fr; gap: var(--space-6); align-items: start; }
.rj-sidebar {
  position: sticky; top: calc(var(--header-h) + 16px);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-4);
}
.rj-sidebar__title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); margin-bottom: var(--space-4); }
.rj-filter-group { margin-bottom: var(--space-4); }
.rj-filter-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.rj-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: var(--space-3); margin-bottom: var(--space-5);
}
.rj-toolbar__count { color: var(--color-text-muted); font-weight: 500; }

/* ——— Detail ——— */
.rj-detail { display: grid; grid-template-columns: 1.45fr 0.8fr; gap: var(--space-6); align-items: start; }
.rj-sticky-card {
  position: sticky; top: calc(var(--header-h) + 16px);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-sm);
}
.rj-gallery { display: grid; gap: var(--space-3); }
.rj-gallery__main {
  aspect-ratio: 16/11; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface-2);
}
.rj-gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.rj-gallery__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.rj-gallery__thumbs button {
  border: 2px solid transparent; padding: 0; border-radius: var(--radius-sm); overflow: hidden; background: none; height: 64px;
}
.rj-gallery__thumbs button.is-active { border-color: var(--color-primary); }
.rj-gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.rj-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: var(--space-4); }
.rj-breadcrumb a:hover { color: var(--color-primary); }
.rj-pro {
  display: flex; gap: var(--space-3); align-items: center;
  padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface);
}
.rj-pro__avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--color-primary-soft);
  display: grid; place-items: center; font-weight: 700; color: var(--color-primary); overflow: hidden; flex-shrink: 0;
}
.rj-pro__avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ——— Wizard ——— */
.rj-wizard__steps { display: flex; gap: 8px; margin-bottom: var(--space-5); flex-wrap: wrap; }
.rj-wizard__pill {
  padding: 6px 12px; border-radius: var(--radius-pill); font-size: 0.82rem; font-weight: 600;
  background: var(--color-surface-2); color: var(--color-text-muted);
}
.rj-wizard__pill.is-active { background: var(--color-ink); color: #fff; }
.rj-wizard__pill.is-done { background: var(--color-primary-soft); color: var(--color-primary); }

/* ——— Auth ——— */
.rj-auth {
  display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; min-height: 100dvh;
}
.rj-auth__aside {
  background:
    linear-gradient(160deg, rgba(12, 31, 36, 0.90), rgba(0, 74, 173, 0.62)),
    url('https://images.unsplash.com/photo-1581578731548-c64695cc6952?auto=format&fit=crop&w=1200&q=70') center/cover;
  color: #fff; padding: var(--space-8) var(--space-6); display: flex; flex-direction: column; justify-content: end;
}
.rj-auth__aside h1 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: var(--space-3); }
.rj-auth__aside p { color: rgba(255,255,255,.8); max-width: 34ch; }
.rj-auth__eyebrow {
  display: inline-block;
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  border-left: 3px solid var(--brand-secondary);
  padding-left: 10px;
  line-height: 1.2;
}
.rj-auth__panel { display: grid; place-items: center; padding: var(--space-6); }
.rj-auth__card { width: min(100%, 420px); }
.rj-auth__brand {
  display: flex;
  margin-bottom: var(--space-4);
}
.rj-auth__brand .app-logo--mark .app-logo__img {
  height: 40px;
  width: 40px;
  max-width: 40px;
}
.rj-choice {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: var(--space-4);
}
.rj-choice button {
  border: 1px solid var(--color-border-strong); background: var(--color-surface);
  border-radius: var(--radius-md); padding: 14px; text-align: left; font-weight: 600;
}
.rj-choice button.is-active {
  border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary);
}
.rj-choice small { display: block; font-weight: 500; color: var(--color-text-muted); margin-top: 4px; }

/* ——— Pedidos ——— */
.rj-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-5); }
.rj-tab {
  border: 0; background: transparent; padding: 8px 14px; border-radius: var(--radius-pill);
  color: var(--color-text-muted); font-weight: 600;
}
.rj-tab.is-active { background: var(--color-ink); color: #fff; }
.rj-order {
  display: grid; grid-template-columns: 1fr auto; gap: var(--space-4); align-items: center;
  padding: var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); margin-bottom: var(--space-3);
}

.rj-review-done {
  margin-top: 10px; display: grid; gap: 4px;
}
.rj-stars-read {
  color: #c4a035; letter-spacing: 1px; font-size: 1.05rem;
}

.rj-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(12, 31, 36, .45);
  display: grid; place-items: center;
  padding: 16px;
}
.rj-modal__card {
  width: min(420px, 100%);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  padding: 20px;
}
.rj-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.rj-modal__head h2 { font-size: 1.2rem; margin: 0; }

.rj-stars {
  display: flex; gap: 6px; justify-content: center; margin: 8px 0 4px;
}
.rj-star {
  border: 0; background: transparent; cursor: pointer;
  font-size: 2rem; line-height: 1; color: #cfc8bc;
  padding: 4px; transition: transform .12s ease, color .12s ease;
}
.rj-star.is-on { color: #c4a035; }
.rj-star:hover { transform: scale(1.08); }
.rj-stars-hint {
  text-align: center; color: var(--color-text-muted);
  font-size: .9rem; margin-bottom: 14px; min-height: 1.2em;
}

/* ——— States ——— */
.rj-empty, .rj-error-box {
  text-align: center; padding: var(--space-8) var(--space-4);
  background: var(--color-surface); border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
}
.rj-empty h3, .rj-error-box h3 { margin-bottom: var(--space-2); }
.rj-empty p, .rj-error-box p { color: var(--color-text-muted); margin-bottom: var(--space-5); }
.rj-skeleton {
  background: linear-gradient(90deg, #eceae6, #f7f5f2, #eceae6);
  background-size: 200% 100%; animation: rj-shimmer 1.2s infinite linear;
  border-radius: var(--radius-md); min-height: 180px;
}
.rj-toast-wrap {
  position: fixed; right: 16px; bottom: 16px; z-index: 80;
  display: grid; gap: 8px; width: min(360px, calc(100vw - 32px));
}
.rj-toast {
  background: var(--color-ink); color: #fff; padding: 12px 14px;
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  display: flex; gap: 10px; align-items: flex-start; animation: rj-fade .2s ease;
}
.rj-toast--success { background: #163a2c; }
.rj-toast--error { background: #5c1a16; }
.rj-toast--warning { background: #4d3600; }
.rj-toast button { border: 0; background: transparent; color: inherit; opacity: .7; margin-left: auto; }

/* ——— Footer ——— */
.rj-footer {
  border-top: 1px solid var(--color-border); padding: var(--space-7) 0 var(--space-5);
  background: #efece7; margin-top: auto;
}
.rj-footer__grid {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--space-5);
  margin-bottom: var(--space-6);
}
.rj-footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted); margin-bottom: var(--space-3); }
.rj-footer a { display: block; padding: 4px 0; color: var(--color-text); font-weight: 500; }
.rj-footer a:hover { color: var(--color-primary); }
.rj-footer__copy { color: var(--color-text-muted); font-size: 0.9rem; border-top: 1px solid var(--color-border); padding-top: var(--space-4); }

/* ——— Mobile bottom nav ——— */
.rj-bottom-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(246,244,241,.94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(4, 1fr); gap: 4px;
}
.rj-bottom-nav a,
.rj-bottom-nav button.rj-bottom-nav__logout {
  display: grid; place-items: center; gap: 2px; padding: 8px 4px;
  font-size: 0.72rem; font-weight: 600; color: var(--color-text-muted); border-radius: var(--radius-sm);
  background: transparent; border: 0; font-family: inherit; cursor: pointer; width: 100%;
}
.rj-bottom-nav a.is-active { color: var(--color-primary); background: var(--color-primary-soft); }
.rj-bottom-nav svg { width: 20px; height: 20px; }

.rj-cta-bar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-md);
}

.rj-stack { display: grid; gap: var(--space-3); }
.rj-muted { color: var(--color-text-muted); }
.rj-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@keyframes rj-shimmer { to { background-position: -200% 0; } }
@keyframes rj-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ——— Responsive ——— */
.rj-filter-open { display: none; }

@media (max-width: 1024px) {
  .rj-discover { grid-template-columns: 1fr; }
  .rj-sidebar { position: static; display: none; }
  .rj-sidebar.is-open {
    display: block; position: fixed; inset: 0; z-index: 70; border-radius: 0;
    overflow: auto; padding: var(--space-5);
  }
  .rj-filter-open { display: inline-flex; }
  .rj-detail { grid-template-columns: 1fr; }
  .rj-sticky-card { position: static; }
  .rj-steps { grid-template-columns: 1fr; }
  .rj-banner--split { grid-template-columns: 1fr; }
  .rj-footer__grid { grid-template-columns: 1fr 1fr; }
  .rj-auth { grid-template-columns: 1fr; }
  .rj-auth__aside { min-height: 220px; padding: var(--space-6); }
}

@media (max-width: 768px) {
  .rj-nav, .rj-desktop-only { display: none !important; }
  .rj-menu-toggle { display: inline-grid; place-items: center; }
  .rj-user-btn__name { display: none; }
  .rj-search { flex-direction: column; }
  .rj-bottom-nav { display: grid; grid-template-columns: repeat(4, 1fr); }
  .rj-shell { padding-bottom: 72px; }
  .rj-cta-bar.is-visible { display: block; }
  .rj-footer__grid { grid-template-columns: 1fr; }
  .rj-choice { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .rj-container { width: min(100% - 28px, var(--container)); }
  .rj-hero { padding: var(--space-6) 0; }
  .rj-grid { grid-template-columns: 1fr; }
}

/* ——— Chat ——— */
.rj-chat-row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface);
  text-decoration: none; color: inherit; transition: border-color .15s ease, transform .15s ease;
}
.rj-chat-row:hover { border-color: var(--color-primary); transform: translateY(-1px); }
.rj-chat-row__body { flex: 1; min-width: 0; }
.rj-chat-row__top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.rj-chat-row__preview {
  margin-top: 6px; color: var(--color-text-muted); font-size: .92rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.rj-chat-page { padding: var(--space-4) 0 var(--space-6); }
.rj-chat-shell { max-width: 760px; }
.rj-chat-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.rj-chat-head > div { flex: 1; min-width: 0; }
.rj-chat-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: min(70vh, 640px);
}
.rj-chat-messages {
  padding: 20px 16px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, #f7f5f2 0%, #fff 40%);
  max-height: min(58vh, 520px);
}
.rj-bubble {
  max-width: min(78%, 420px);
  padding: 10px 14px;
  border-radius: 16px;
  animation: rj-fade .15s ease;
}
.rj-bubble--mine {
  align-self: flex-end;
  background: var(--color-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.rj-bubble--theirs {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}
.rj-bubble__meta { font-size: .75rem; font-weight: 600; margin-bottom: 4px; color: var(--color-text-muted); }
.rj-bubble__text { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.rj-bubble__foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  margin-top: 6px;
}
.rj-bubble__time { font-size: .7rem; opacity: .75; }
.rj-bubble__status { font-size: .75rem; opacity: .9; line-height: 1; }
.rj-bubble--sending { opacity: .82; }
.rj-bubble--failed { outline: 1px solid rgba(180, 35, 24, .35); }
.rj-bubble--mine.rj-bubble--failed { background: #9f3b35; }
.rj-bubble__retry {
  border: 0; background: transparent; color: inherit;
  font-size: .7rem; font-weight: 700; text-decoration: underline;
  cursor: pointer; padding: 0;
}
.rj-chat-composer {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}
.rj-chat-composer .rj-field { flex: 1; }

@media (max-width: 768px) {
  .rj-chat-page { padding-bottom: 8px; }
  .rj-chat-messages { max-height: calc(100vh - 260px); }
}

/* ——— Floating chat widget ——— */
.rj-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.rj-chat-widget > * { pointer-events: auto; }

.rj-cw-fab {
  width: 58px; height: 58px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: var(--color-primary); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(0, 74, 173, 0.32);
  transition: transform .15s ease, background .15s ease;
}
.rj-cw-fab:hover { background: var(--color-primary-hover); transform: scale(1.04); }
.rj-cw-fab:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }

.rj-cw-panel {
  width: min(380px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 120px));
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(12, 31, 36, 0.18);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.rj-cw-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 12px 10px;
  background: var(--color-ink, #0c1f24); color: #fff;
}
.rj-cw-head__text { flex: 1; min-width: 0; }
.rj-cw-head__text strong {
  display: block; font-family: var(--font-display); font-size: .98rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rj-cw-head__text span {
  display: block; font-size: .75rem; opacity: .75;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rj-cw-icon-btn {
  width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
}
.rj-cw-icon-btn:hover { background: rgba(255,255,255,.2); }

.rj-cw-body, .rj-cw-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rj-cw-list { overflow-y: auto; flex: 1; }
.rj-cw-item {
  width: 100%; display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border: 0; border-bottom: 1px solid var(--color-border);
  background: transparent; text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.rj-cw-item:hover { background: var(--color-surface-2, #f3f1ed); }
.rj-cw-item__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rj-cw-item__top { display: flex; justify-content: space-between; gap: 8px; }
.rj-cw-item__top small { color: var(--color-text-muted); font-size: .7rem; flex-shrink: 0; }
.rj-cw-item__preview {
  font-size: .85rem; color: var(--color-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rj-cw-loading, .rj-cw-empty { padding: 28px 18px; text-align: center; color: var(--color-text-muted); }
.rj-cw-messages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, #f7f5f2 0%, #fff 45%);
}
.rj-cw-messages .rj-bubble { max-width: 85%; }
.rj-cw-composer {
  display: flex; gap: 8px; padding: 10px;
  border-top: 1px solid var(--color-border); background: var(--color-surface);
}
.rj-cw-composer .rj-field { flex: 1; min-height: 40px; }
.rj-cw-closed { padding: 12px 14px; margin: 0; font-size: .85rem; }

@media (max-width: 768px) {
  .rj-cw-panel {
    width: min(100vw - 20px, 400px);
    height: min(68vh, 520px);
  }
}

/* =========================================================
   SERVICE DETAIL — decision page
   ========================================================= */

.sd { padding-bottom: 24px; }

.sd-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  font-size: 0.92rem;
}
.sd-back:hover { color: var(--color-primary); }

.sd-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.sd-crumb a:hover { color: var(--color-primary); }

.sd-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 36px;
}

.sd-gallery__main {
  aspect-ratio: 4/3;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}
.sd-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sd-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.sd-gallery__thumbs button {
  border: 2px solid transparent;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: none;
  height: 68px;
  cursor: pointer;
}
.sd-gallery__thumbs button.is-active { border-color: var(--color-primary); }
.sd-gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.sd-book {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.sd-book__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.sd-book__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.sd-book__title {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  margin-bottom: 10px;
}
.sd-book__rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin-bottom: 16px;
}
.sd-book__rating--muted {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.92rem;
}
.sd-stars { color: #c4a035; }
.sd-book__price {
  display: grid;
  gap: 2px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.sd-book__price span {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.sd-book__price strong {
  font-family: var(--font-display);
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  color: var(--color-ink);
}
.sd-book__facts {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}
.sd-book__facts li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--color-text);
  font-size: 0.94rem;
  font-weight: 500;
}
.sd-book__facts li span:first-child {
  color: var(--color-primary);
  width: 1.1em;
  flex-shrink: 0;
}
.sd-book__actions {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.sd-book__note {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.sd-block {
  margin-bottom: 32px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.sd-block--flush { margin-bottom: 0; }
.sd-block__title {
  font-size: 1.15rem;
  margin-bottom: 14px;
}
.sd-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.sd-link {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.9rem;
}
.sd-prose {
  color: var(--color-text);
  font-size: 1.02rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.sd-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  margin-bottom: 32px;
  align-items: start;
}

.sd-checklist {
  display: grid;
  gap: 12px;
}
.sd-checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500;
  line-height: 1.45;
}
.sd-checklist li span:first-child {
  color: var(--color-success);
  font-weight: 700;
}

.sd-provider-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.sd-provider-card__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.sd-provider-card__name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 2px;
}
.sd-provider-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.sd-provider-card__rating {
  font-weight: 600;
  margin-bottom: 4px;
}

.sd-steps {
  display: grid;
  gap: 14px;
  counter-reset: none;
}
.sd-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
}
.sd-steps__num {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.9rem;
}
.sd-steps strong { display: block; margin-bottom: 4px; }
.sd-steps p { color: var(--color-text-muted); font-size: 0.94rem; }

.sd-other-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.sd-other-card {
  display: grid;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-2);
  transition: transform var(--transition), box-shadow var(--transition);
}
.sd-other-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.sd-other-card__media {
  aspect-ratio: 16/10;
  background: #e8e4de;
}
.sd-other-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sd-other-card__body {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #fff;
}
.sd-other-card__body strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
}
.sd-other-card__price {
  font-weight: 700;
  font-size: 0.9rem;
}

.sd-about__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
}
.sd-facts {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
}
.sd-facts dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.sd-facts dd {
  font-weight: 600;
  color: var(--color-ink);
}

.sd-faq { display: grid; gap: 8px; }
.sd-faq__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  padding: 0 14px;
}
.sd-faq__item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.sd-faq__item summary::-webkit-details-marker { display: none; }
.sd-faq__item summary::after {
  content: '▸';
  color: var(--color-text-muted);
  transition: transform .15s ease;
}
.sd-faq__item[open] summary::after { transform: rotate(90deg); }
.sd-faq__item p {
  padding: 0 0 14px;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0;
}

.sd-cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--color-ink);
  color: #fff;
  margin-bottom: 16px;
}
.sd-cta-band h2 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 6px;
}
.sd-cta-band p {
  color: rgba(255,255,255,.75);
  max-width: 46ch;
}

.sd-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(12,31,36,.45);
  display: grid;
  place-items: center;
  padding: 16px;
}
.sd-modal__card {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.sd-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.sd-modal__head h2 { font-size: 1.25rem; margin: 0; }
.sd-modal__foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}

.sd-mobile-cta {
  display: none;
}

@media (max-width: 1024px) {
  .sd-hero,
  .sd-split,
  .sd-about__grid {
    grid-template-columns: 1fr;
  }
  .sd-book { position: static; }
}

@media (max-width: 768px) {
  .sd-block { padding: 18px; }
  .sd-mobile-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    z-index: 55;
    padding: 10px 14px;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -8px 24px rgba(12,31,36,.06);
  }
  .sd-mobile-cta__price {
    display: grid;
    font-size: 0.78rem;
    color: var(--color-text-muted);
  }
  .sd-mobile-cta__price strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--color-ink);
  }
  .sd-cta-band { flex-direction: column; align-items: stretch; }
}

/* =========================================================
   APP SHELL — platform chrome (not a marketing website)
   ========================================================= */

.app {
  --app-bg: #f3f1ed;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}

.app-topbar__left,
.app-topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 0;
  flex-shrink: 0;
  text-decoration: none;
}
.app-logo__img {
  display: block;
  width: auto;
  height: 32px;
  max-width: 32px;
  object-fit: contain;
  object-position: center;
}
.app-logo--nav .app-logo__img {
  height: 32px;
  width: 32px;
  max-width: 32px;
}
.app-logo__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.04em;
  color: var(--brand-primary);
  white-space: nowrap;
  line-height: 1.2;
}
.app-logo__word span { color: var(--brand-secondary-dark); }
.app-logo--mark .app-logo__img {
  height: 32px;
  width: 32px;
  max-width: 32px;
}
.app-logo--auth .app-logo__img,
.app-logo--aside .app-logo__img {
  height: auto;
  width: min(100%, 200px);
  max-width: 200px;
  max-height: 140px;
}
.app-logo--aside {
  display: block;
  margin-bottom: var(--space-5);
}
.app-logo--aside .app-logo__img {
  width: min(100%, 180px);
  max-height: 120px;
}

/* legacy text lockup fallback */
.app-logo--text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
  color: var(--brand-primary);
  white-space: nowrap;
  line-height: 1.2;
}
.app-logo--text span { color: var(--brand-secondary-dark); }

.app-icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.app-icon-btn:hover { background: rgba(12, 31, 36, 0.06); }

.app-topbar__menu { display: none; }

.app-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, 100%);
  margin-inline: auto;
  height: 40px;
  padding: 0 14px;
  background: var(--color-surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.app-search:focus-within {
  background: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.app-search svg { color: var(--color-text-muted); flex-shrink: 0; }
.app-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
}
.app-search input::placeholder { color: var(--color-text-muted); }

.app-topbar__guest,
.app-topbar__user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-body {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 0;
}

.app-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--color-border);
  z-index: 60;
}

.app-side-nav {
  flex: 1;
  overflow: auto;
  padding: 16px 12px 8px;
}

.app-side-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 14px 10px 8px;
}
.app-side-label:first-child { margin-top: 0; }

.app-side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.94rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
}
.app-side-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}
.app-side-link:hover {
  background: rgba(12, 31, 36, 0.05);
}
.app-side-link.is-active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.app-side-link.is-active svg { color: var(--color-primary); }

.app-sidebar__foot {
  padding: 12px;
  border-top: 1px solid var(--color-border);
}

.app-sidebar-backdrop {
  display: none;
}

.app-main {
  min-width: 0;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
}

.app-main__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: min(100%, 1280px);
  margin-inline: auto;
  min-height: 100%;
}

.app-main:has(.app-context) .app-main__inner {
  grid-template-columns: minmax(0, 1fr) var(--context-w);
}

.app-content {
  min-width: 0;
  max-width: 100%;
  padding: 20px 24px 40px;
  overflow-x: clip;
}

.app-context {
  padding: 20px 20px 40px 0;
  border-left: 1px solid transparent;
}

.app-context__card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
}
.app-context__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.app-context__list {
  display: grid;
  gap: 8px;
}
.app-context__list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}
.app-context__list a:hover { background: var(--color-surface-2); }
.app-context__hint {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.app-sidebar__head {
  display: none;
}

.app-bottom-nav {
  display: none;
}

/* Auth: no chrome density */
.app--auth .app-body { grid-template-columns: 1fr; }
.app--auth .app-content { padding: 0; max-width: none; }
.app--auth .app-main__inner { width: 100%; }
.app--auth .app-topbar {
  grid-template-columns: auto 1fr auto;
  background: transparent;
  border-bottom: 0;
  position: absolute;
  left: 0; right: 0;
}

/* Page chrome inside main */
.app-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.app-page-head h1 {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  margin-bottom: 4px;
}
.app-page-head p {
  color: var(--color-text-muted);
  font-size: 0.98rem;
}
.app-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 4px;
  margin-bottom: 20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.app-chip-row::-webkit-scrollbar { display: none; }
.app-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-text);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.app-chip:hover,
.app-chip.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.app-chip--sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}
.app-chip-row--tight {
  margin-bottom: 0;
}
.app-filter-bar {
  display: grid;
  gap: 14px;
}
.app-filter-group {
  display: grid;
  gap: 8px;
}
.app-filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.app-filter-clear {
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.app-filter-clear:hover { text-decoration: underline; }

.app-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--context-w);
  gap: 24px;
  align-items: start;
  max-width: 100%;
  min-width: 0;
}
.app-home__main {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}
.app-home__rail {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: grid;
  gap: 0;
}
.app-home__mobile-filters { display: none; }
.app-home__lead { color: var(--color-text-muted); }
.app-home-discover { margin-bottom: 20px; }
.app-home-discover__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.app-home-discover__label {
  font-size: 0.95rem;
  margin: 0;
}
.app-home-filterstrip {
  margin-top: 10px;
}
.app-home-filterstrip__sep {
  width: 1px;
  height: 22px;
  background: var(--color-border-strong);
  flex: 0 0 auto;
  align-self: center;
  margin: 0 2px;
}
.app-home-count {
  font-size: 0.9rem;
  font-weight: 700;
}
.app-home-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.app-rail-filters {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
}
.app-rail-filters .rj-label { margin-top: 6px; }
.app-rail-filters .rj-label:first-child { margin-top: 0; }
.app-rail-filters .rj-field { min-height: 42px; }
.app-rail-active { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--color-border); }
.app-rail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}
.app-rail-stats div {
  padding: 10px 6px;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
}
.app-rail-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-ink);
}
.app-rail-stats span {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 600;
}
.app-rail-list { display: grid; gap: 4px; }
.app-rail-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
}
.app-rail-item:hover { background: var(--color-surface-2); }
.app-rail-item__body {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.app-rail-item__body strong {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-rail-item__body small {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1200px) {
  .app-home { grid-template-columns: 1fr; }
  .app-home__rail { display: none; }
  .app-home__mobile-filters { display: block; }
}
.app-chip__dot {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.app-feed-block { margin-bottom: 28px; }
.app-feed-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.app-feed-block__head h2 {
  font-size: 1.15rem;
}
.app-feed-block__head a {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-primary);
}

.app-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.app-quick {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), transform var(--transition);
}
.app-quick:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}
.app-quick strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
}
.app-quick span {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.app-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #0c1f24, #1a3d45);
  color: #fff;
}
.app-plan-badge--soft {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.app-loc-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}
.app-switch {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: #c5c0b8;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .15s ease;
}
.app-switch.is-on { background: var(--color-primary); }
.app-switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
  box-shadow: var(--shadow-xs);
}
.app-switch.is-on .app-switch__knob { transform: translateX(20px); }
.app-loc-coords { font-size: 0.85rem; }
.app-eta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-primary);
}

/* Compact containers inside shell */
.app .rj-container { width: 100%; max-width: none; }
.app .rj-section,
.app .rj-section--tight { padding: 0; }
.app .rj-hero {
  padding: 8px 0 20px;
  background: none;
}
.app .rj-hero__title {
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  max-width: none;
}
.app .rj-hero__lead {
  font-size: 1rem;
  margin-bottom: var(--space-4);
}

.rj-toast-wrap {
  bottom: calc(16px + env(safe-area-inset-bottom));
}

@media (min-width: 1280px) {
  .app-main:has(.app-context) .app-main__inner {
    grid-template-columns: minmax(0, 1fr) var(--context-w);
  }
  .app-context {
    padding-right: 8px;
  }
}

@media (max-width: 1200px) {
  .app-main:has(.app-context) .app-main__inner {
    grid-template-columns: 1fr;
  }
  .app-context {
    display: none;
  }
}

@media (max-width: 1024px) {
  .app-body { grid-template-columns: 1fr; }
  .app-topbar__menu { display: grid; }
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    width: min(300px, 88vw);
    transform: translateX(-105%);
    transition: transform 200ms ease;
    box-shadow: var(--shadow-md);
    border-right: 0;
    z-index: 80;
  }
  .app-sidebar.is-open { transform: translateX(0); }
  .app-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--color-border);
  }
  .app-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(12, 31, 36, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    z-index: 75;
  }
  .app-sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  .app-content { padding: 16px 16px 28px; }
  .app-quick-grid { grid-template-columns: 1fr; }
  .app-side-link { min-height: 44px; }
}

@media (max-width: 768px) {
  .app-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0 8px;
    gap: 6px;
    height: 52px;
  }
  .app-logo__word { display: none; }
  .app-logo--nav .app-logo__img,
  .app-logo--mark .app-logo__img { height: 28px; width: 28px; max-width: 28px; }
  .app-search {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    gap: 6px;
  }
  .app-search svg { width: 16px; height: 16px; }
  .app-search input {
    font-size: 16px; /* evita zoom iOS */
  }
  .app-topbar__guest .rj-btn--ghost { display: none; }
  .app-topbar__guest .rj-btn--sm { min-height: 34px; padding: 0 12px; }
  .app-icon-btn { width: 40px; height: 40px; }
  .rj-user-btn {
    padding: 2px;
    border: 0;
    background: transparent;
  }
  .rj-user-btn__name,
  .rj-user-btn > span[aria-hidden] { display: none; }

  .app-page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }
  .app-page-head h1 { font-size: 1.35rem; }
  .app-page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .app-page-actions .rj-btn { width: 100%; }

  .app-chip-row {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
  }
  .app-chip { min-height: 40px; max-width: min(78vw, 280px); }
  .app-chip > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 65;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-border);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    min-height: calc(56px + env(safe-area-inset-bottom));
  }
  .app-bottom-nav a,
  .app-bottom-nav button {
    display: grid;
    place-items: center;
    gap: 2px;
    padding: 8px 4px;
    min-height: 48px;
    border: 0;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: 10px;
    cursor: pointer;
  }
  .app-bottom-nav svg { width: 22px; height: 22px; }
  .app-bottom-nav a.is-active,
  .app-bottom-nav button.is-active {
    color: var(--color-primary);
    background: var(--color-primary-soft);
  }
  .app {
    --header-h: 52px;
    --bottom-nav-h: 56px;
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  }
  .rj-toast-wrap {
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    width: auto;
  }
  /* No mobile o chat abre pelo ícone do topbar / menu Mais */
  .rj-chat-widget .rj-cw-fab { display: none; }
  .rj-chat-widget {
    left: 0;
    right: 0;
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    align-items: stretch;
    padding: 0 8px 8px;
  }
  .rj-cw-panel {
    width: 100%;
    height: min(70vh, 560px);
    border-radius: 16px 16px 12px 12px;
  }

  .app .rj-hero__search .rj-btn--lg { width: 100%; }
  .app .rj-search { flex-direction: column; }

  .rj-order {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .rj-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .rj-tab { flex: 0 0 auto; min-height: 40px; }

  .rj-discover .rj-sidebar.is-open {
    padding-top: calc(12px + env(safe-area-inset-top));
  }

  .sd-modal {
    padding: 0;
    align-items: end;
  }
  .sd-modal__card {
    width: 100%;
    max-height: min(92vh, 100%);
    border-radius: 18px 18px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .sd-book__actions .rj-btn { min-height: 48px; }
  .sd-gallery__main { aspect-ratio: 1 / 1; border-radius: var(--radius-lg); }
  .sd { padding-bottom: calc(72px + var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .sd-mobile-cta {
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    min-height: 64px;
  }
  .sd-mobile-cta .rj-btn { min-height: 44px; min-width: 120px; }

  .rj-auth__aside { min-height: 140px; padding: var(--space-5); }
  .rj-auth__aside h1 { font-size: 1.4rem; }
  .rj-auth__panel { padding: 20px 16px 32px; }
  .rj-choice { grid-template-columns: 1fr; }

  .app-home__mobile-filters .app-filter-label { margin-top: 4px; }

  /* Home mobile: feed limpo, menos chrome */
  .app-home__head-actions { display: none; }
  .app-home__head {
    margin-bottom: 12px;
    gap: 4px;
  }
  .app-home__head h1 { margin-bottom: 2px; }
  .app-home__lead { font-size: 0.92rem; }
  .app-home-discover {
    position: sticky;
    top: var(--header-h);
    z-index: 20;
    width: 100%;
    max-width: 100%;
    margin: 0 0 14px;
    padding: 10px 0 12px;
    background: rgba(243, 241, 237, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    overflow-x: clip;
  }
  .app-home-discover__top {
    padding: 0 2px;
  }
  .app-home-discover__label { font-size: 0.82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); }
  .app-home-discover .app-chip-row {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .app-home-filterstrip {
    margin-top: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  .app-home-filterstrip .app-chip-row {
    margin-bottom: 0;
  }
  .app-home-results { margin-bottom: 8px; }
  .app-home-results .app-feed-block__head { margin-bottom: 10px; }
  .app-home-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .app-home-card .rj-card__media { aspect-ratio: 16 / 10; }
  .app-home-card .rj-card__body { gap: 6px; padding: 12px 14px 14px; }
  .app-home-card .rj-card__title { font-size: 1rem; }

  .app-services-search { align-items: stretch; }
  .app-services-search__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
  }
  .app-services-search__actions .rj-btn { flex: 1; }
}

@media (max-width: 480px) {
  .app-content { padding: 12px 12px 24px; }
  .app-page-actions { grid-template-columns: 1fr; }
  .rj-grid { grid-template-columns: 1fr; gap: 12px; }
  .app-topbar__guest .rj-btn--primary { font-size: 0.82rem; }
  .app-services-search {
    flex-direction: column;
    padding: 10px;
  }
  .app-services-search .rj-search__icon { display: none; }
}


