/* flotry-app.css — Flotry client/helper App Shell (foundation, Phase 1)
 *
 * [FLOTRY-CLIENT-HELPER-APP-SHELL-PHASE1-V1]
 *
 * Injected by _inject_app_shell (app/api/ui_endpoints.py) into authenticated
 * CLIENT and HELPER pages ONLY when the CLIENT_HELPER_APP_SHELL_V2 flag is ON.
 * Never on landing, operator/admin, wizards or the legal gate.
 *
 * This is the FOUNDATION shell only: a role-aware bottom navigation (mobile),
 * a left rail (desktop >=600px) with the SAME destinations, and a slim top
 * status bar. It does NOT redesign any screen body — existing page content
 * renders inside the shell. Phases 2+ redesign the bodies.
 *
 * It reuses the canonical --fl-x-* tokens already published globally by
 * flotry-experience.css (teal #0C766C, coral #E55C3C, warm off-white #FBF7F2,
 * ink text, spacing/radii). It introduces NO new palette — only a few local
 * aliases for shell dimensions. Presentation only: no data, no fetch, no
 * behavior change to any API, auth, session, legal or payment path.
 */

:root {
  /* Shell dimensions (aliases; colours come from the global --fl-x-* tokens). */
  --fl-app-tap: 44px;              /* WCAG 2.5.5 AAA / Apple / MD3 touch floor */
  --fl-app-nav-h: 60px;            /* bottom nav height (>=56, each tab >=44)  */
  --fl-app-rail-w: 84px;           /* desktop left rail width                  */
  --fl-app-topbar-h: 56px;         /* top status bar height                    */
  --fl-app-bp: 600px;              /* MD3 window class: <600 bottom nav, >=600 rail */
  --fl-app-teal: var(--fl-x-teal, #0C766C);
  --fl-app-coral: var(--fl-x-coral, #E55C3C);
  --fl-app-surface: var(--fl-x-surface, #ffffff);
  --fl-app-canvas: var(--fl-x-canvas, #FBF7F2);
  --fl-app-ink: var(--fl-x-ink, #16302C);
  --fl-app-ink-soft: var(--fl-x-ink-soft, #4B635E);
  --fl-app-line: var(--fl-x-line, #E2ECE9);
  --fl-app-teal-soft: var(--fl-x-moss-soft, #E1EADB);
}

/* ---- Body offsets so fixed chrome never covers content (no data change) ---- */
body.fl-app {
  /* leave room for the top bar + the bottom nav (mobile) incl. safe areas */
  padding-top: calc(var(--fl-app-topbar-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--fl-app-nav-h) + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  /* WCAG 2.4.11: focused fields scroll clear of the sticky chrome */
  scroll-padding-top: calc(var(--fl-app-topbar-h) + 8px);
  scroll-padding-bottom: calc(var(--fl-app-nav-h) + 8px);
  overflow-x: hidden;               /* WCAG 1.4.10: no horizontal scroll */
}

/* ---- Top status bar ---- */
.fl-app-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--fl-app-topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  padding-right: 12px;
  background: var(--fl-app-surface);
  border-bottom: 1px solid var(--fl-app-line);
  z-index: 60;
}
.fl-app-topbar__brand {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--fl-app-teal);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--fl-app-tap);
}
.fl-app-topbar__title {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--fl-app-ink);
  margin-left: 4px;
}
.fl-app-topbar__stage {
  margin-left: auto;
  font-size: 12px;
  color: var(--fl-app-ink-soft);
  white-space: nowrap;
}

/* ---- Bottom navigation (mobile, <600px) ---- */
.fl-app-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--fl-app-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: var(--fl-app-surface);
  border-top: 1px solid var(--fl-app-line);
  z-index: 60;
}
.fl-app-nav__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: var(--fl-app-tap);
  padding: 6px 2px;
  text-decoration: none;
  color: var(--fl-app-ink-soft);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
}
.fl-app-nav__icon {
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fl-app-nav__icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; }
.fl-app-nav__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fl-app-nav__item[aria-current="page"] {
  color: var(--fl-app-teal);
}
.fl-app-nav__item[aria-current="page"] .fl-app-nav__icon {
  background: var(--fl-app-teal-soft);
  border-radius: 999px;
  box-shadow: 0 0 0 6px var(--fl-app-teal-soft);
}

/* ---- Left rail (desktop, >=600px) ---- */
.fl-app-rail { display: none; }

@media (min-width: 600px) {
  .fl-app-nav { display: none; }         /* one nav per window class */
  body.fl-app {
    padding-bottom: 0;
    padding-left: var(--fl-app-rail-w);
  }
  .fl-app-topbar { left: var(--fl-app-rail-w); }
  .fl-app-rail {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: var(--fl-app-rail-w);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 6px;
    background: var(--fl-app-surface);
    border-right: 1px solid var(--fl-app-line);
    z-index: 70;
  }
  .fl-app-rail__brand {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--fl-app-teal);
    text-align: center;
    text-decoration: none;
    padding: 8px 0 12px;
  }
  .fl-app-rail__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: var(--fl-app-tap);
    padding: 10px 4px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--fl-app-ink-soft);
    font-family: "Inter", system-ui, sans-serif;
    font-size: 12px;
    font-weight: 500;
  }
  .fl-app-rail__item .fl-app-nav__icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; }
  .fl-app-rail__item[aria-current="page"] {
    color: var(--fl-app-teal);
    background: var(--fl-app-teal-soft);
  }
}

/* ---- Shared primitives (opt-in; used by the shell + future screens) ---- */
.fl-app-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  background: var(--fl-app-teal-soft);
  color: var(--fl-x-teal-ink, #095e56);
}
.fl-app-card {
  background: var(--fl-app-surface);
  border: 1px solid var(--fl-app-line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--fl-x-shadow, 0 1px 2px rgba(16,48,44,.05));
}
.fl-app-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--fl-app-coral);
  color: #fff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.fl-app-cta--secondary {
  background: transparent;
  color: var(--fl-app-teal);
  border: 1px solid var(--fl-app-teal);
}
.fl-app-empty {
  text-align: center;
  color: var(--fl-app-ink-soft);
  font-family: "Inter", system-ui, sans-serif;
  padding: 24px 16px;
}

/* Never let the shell fixed layers get restyled away by reduced motion / print */
@media print { .fl-app-topbar, .fl-app-nav, .fl-app-rail { display: none !important; } }

/* ============================================================================
 * [FLOTRY-CLIENT-HELPER-WORLDCLASS-UI-OVERHAUL-V1] V2 screen components.
 *
 * Body components for the redesigned client/helper screens (home, solicitudes,
 * trabajos, propuestas, agenda, mensajes, cuenta). Same doctrine as the shell:
 * built on the global --fl-x-* teal/coral tokens, 44px taps, single-column
 * mobile-first (390px), max 760px reading column on desktop, AA contrast,
 * reduced-motion safe. Presentation only.
 * ========================================================================== */

:root {
  --fl-app-ok: #3FA579;      --fl-app-ok-soft: #DDEFE5;
  --fl-app-warn: #D49A2E;    --fl-app-warn-soft: #F7E8C8;
  --fl-app-stop: #C2553D;    --fl-app-stop-soft: #F1D6CE;
  --fl-app-info: #2E6789;    --fl-app-info-soft: #DCE5EE;
  --fl-app-ink-muted: #7C8A86;
  --fl-app-coral-soft: #FBE7DC;
  --fl-app-maxw: 760px;
}

/* ---- Page scaffold ---- */
.fl-app-page {
  max-width: var(--fl-app-maxw);
  margin: 0 auto;
  padding: 20px 16px 32px;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--fl-app-ink);
}
.fl-app-page * { box-sizing: border-box; }
.fl-app-page img { max-width: 100%; }
.fl-app-h1 {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.25;
  margin: 0 0 4px;
  color: var(--fl-app-ink);
}
.fl-app-sub { font-size: 15px; color: var(--fl-app-ink-soft); margin: 0 0 20px; }
.fl-app-section { margin: 24px 0 0; }
.fl-app-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}
.fl-app-h2 {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin: 0;
}
.fl-app-section__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--fl-app-teal);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--fl-app-tap);
}
.fl-app-stack { display: flex; flex-direction: column; gap: 12px; }

/* ---- Status chip tones (labels always Spanish via FlotryHumanize) ---- */
.fl-app-chip--ok      { background: var(--fl-app-ok-soft);   color: #1F6B4C; }
.fl-app-chip--info    { background: var(--fl-app-info-soft); color: #235273; }
.fl-app-chip--heads-up{ background: var(--fl-app-warn-soft); color: #7A5A16; }
.fl-app-chip--muted   { background: #ECEFEE;                 color: var(--fl-app-ink-soft); }
.fl-app-chip--stop    { background: var(--fl-app-stop-soft); color: #8F3A27; }

/* ---- Signature component: service status timeline ---- */
.fl-app-tl {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 12px 0 4px;
  padding: 0;
  list-style: none;
}
.fl-app-tl__step {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  position: relative;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  color: var(--fl-app-ink-muted);
}
.fl-app-tl__dot {
  width: 12px; height: 12px;
  border-radius: 999px;
  background: var(--fl-app-surface);
  border: 2px solid var(--fl-app-line);
  z-index: 1;
}
.fl-app-tl__step::before {
  content: "";
  position: absolute;
  top: 6px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--fl-app-line);
}
.fl-app-tl__step:first-child::before { display: none; }
.fl-app-tl__step[data-tl="done"] { color: var(--fl-app-ink-soft); }
.fl-app-tl__step[data-tl="done"] .fl-app-tl__dot {
  background: var(--fl-app-ok);
  border-color: var(--fl-app-ok);
}
.fl-app-tl__step[data-tl="done"]::before { background: var(--fl-app-ok); }
.fl-app-tl__step[data-tl="current"] { color: var(--fl-app-teal); font-weight: 600; }
.fl-app-tl__step[data-tl="current"] .fl-app-tl__dot {
  background: var(--fl-app-teal);
  border-color: var(--fl-app-teal);
  box-shadow: 0 0 0 4px var(--fl-app-teal-soft);
  transition: box-shadow 250ms ease;
}
.fl-app-tl__step[data-tl="current"]::before { background: var(--fl-app-ok); }
.fl-app-tl__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- "¿Qué sigue?" next-action slot ---- */
.fl-app-next {
  display: flex;
  gap: 8px;
  align-items: baseline;
  background: var(--fl-app-teal-soft);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--fl-app-ink);
  margin: 10px 0 0;
}
.fl-app-next__k { font-weight: 700; color: var(--fl-x-teal-ink, #095e56); white-space: nowrap; }

/* ---- Request / job cards ---- */
.fl-app-reqcard { display: block; }
.fl-app-reqcard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.fl-app-reqcard__title {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin: 0 0 2px;
  color: var(--fl-app-ink);
}
.fl-app-reqcard__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--fl-app-ink-muted);
  margin: 0 0 4px;
}
.fl-app-reqcard__desc {
  font-size: 14px;
  color: var(--fl-app-ink-soft);
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fl-app-reqcard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.fl-app-reqcard__actions .fl-app-cta { width: auto; flex: 1 1 auto; }
.fl-app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--fl-app-tap);
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--fl-app-teal);
  background: transparent;
  color: var(--fl-app-teal);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

/* ---- Honest notice (payments / operating stage) ---- */
.fl-app-note {
  background: var(--fl-app-info-soft);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #235273;
}

/* ---- Account rows ---- */
.fl-app-acct { padding: 0; }
.fl-app-acct__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 16px;
  color: var(--fl-app-ink);
  text-decoration: none;
  font-size: 15px;
  border-top: 1px solid var(--fl-app-line);
  background: transparent;
  border-left: 0; border-right: 0; border-bottom: 0;
  width: 100%;
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
  text-align: left;
}
.fl-app-acct__row:first-child { border-top: 0; }
.fl-app-acct__row::after {
  content: "›";
  margin-left: auto;
  color: var(--fl-app-ink-muted);
  font-size: 18px;
}
.fl-app-acct__row--plain::after { content: ""; }
.fl-app-acct__hint { font-size: 12px; color: var(--fl-app-ink-muted); display: block; }

/* ---- Message preview rows ---- */
.fl-app-msgrow {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  min-height: 52px;
  text-decoration: none;
  color: var(--fl-app-ink);
  border-top: 1px solid var(--fl-app-line);
}
.fl-app-msgrow:first-child { border-top: 0; }
.fl-app-msgrow__title { font-weight: 600; font-size: 15px; }
.fl-app-msgrow__hint { font-size: 13px; color: var(--fl-app-ink-soft); }

/* ---- Loading skeleton (honest: replaced by content or an empty state) ---- */
.fl-app-skel {
  border-radius: 8px;
  background: linear-gradient(90deg, #EEF2F0 25%, #F7FAF8 50%, #EEF2F0 75%);
  background-size: 200% 100%;
  animation: fl-app-shimmer 1.2s linear infinite;
  min-height: 72px;
}
@keyframes fl-app-shimmer { to { background-position: -200% 0; } }

/* ---- Focus + motion safety ---- */
.fl-app-page a:focus-visible,
.fl-app-page button:focus-visible,
.fl-app-nav__item:focus-visible,
.fl-app-rail__item:focus-visible {
  outline: 3px solid var(--fl-app-teal);
  outline-offset: 2px;
  border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .fl-app-skel { animation: none; }
  .fl-app-tl__step[data-tl="current"] .fl-app-tl__dot { transition: none; }
}

/* ============================================================================
 * [FLOTRY-CLIENT-HELPER-V2-WORLDCLASS-POLISH-V1] Shell-wrapped legacy pages.
 *
 * When a legacy journey page (coordination, request/opportunity detail,
 * payments, services) renders INSIDE the V2 app shell (body.fl-app), its own
 * stage banner and page-local brand/header duplicate the shell topbar + nav
 * (brand shown three times, two navs and two stage framings on one screen).
 * Hide those page-local duplicates ONLY under the shell — flag OFF / classic
 * renders every page unchanged. Back-links ("← Mis solicitudes", "Volver al
 * panel", …) live outside these headers and keep working. Presentation only.
 * ========================================================================== */
body.fl-app .fl-pilot-note,
body.fl-app .pilot,
body.fl-app .fl-brandbar,
body.fl-app .coord-page .fl-header,
body.fl-app .flapp > .web > .header { display: none; }

/* Desktop shell: the rail already carries the brand — a second "Flotry" in
   the topbar right next to it reads as a glitch. Page title + stage remain. */
@media (min-width: 600px) {
  .fl-app-topbar__brand { display: none; }
}

/* Filter chips (Solicitudes: Todas / Activas / Terminadas): the pressed
   filter must be VISIBLY distinct, not only aria-pressed — visibility of
   system status. */
.fl-app-btn[aria-pressed="true"] {
  background: var(--fl-app-teal-soft);
  color: var(--fl-x-teal-ink, #095e56);
  border-color: var(--fl-app-teal);
  font-weight: 700;
}

/* ============================================================================
 * [FLOTRY-BRAND-GUARD-V1] Official lockup in the app shell (topbar + rail).
 * The inline SVG mark keeps its 1:1 viewBox (no distortion); heights are
 * fixed per surface so the logo never overwhelms navigation. The visible
 * wordmark doubles as the accessible/text fallback.
 * ========================================================================== */
.fl-app-topbar__brand,
.fl-app-rail__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.fl-app-brand__mark {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: block;
}
.fl-app-rail__brand .fl-app-brand__mark { width: 28px; height: 28px; }
.fl-app-brand__wm {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
}
/* Re-assert the desktop dedup AFTER the brand display rules above: the rail
   carries the lockup at >=600px; the topbar brand stays hidden there. */
@media (min-width: 600px) {
  .fl-app-topbar__brand { display: none; }
}

/* [FLOTRY-FULL-JOURNEY-FINALIZATION-V1] F2: a disabled action must LOOK
   disabled — before this, locked "Invitar"/"Enviar cotización" buttons kept
   full-primary styling and read as active no-ops. */
.fl-app-cta[disabled],
.fl-app-btn[disabled],
button.fl-app-cta:disabled,
button.fl-app-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  filter: saturate(0.6);
}

/* ============================================================================
 * [FLOTRY-INTERACTION-EXPERIENCE-V2] C1/C2 — the service room.
 * Turn badge, counterpart identity, collapsed Historial. Same restrained
 * teal/coral system; the turn badge is the one accented element per room.
 * ========================================================================== */
.fl-app-roomchips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.fl-app-turn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  background: #ECEFEE;
  color: var(--fl-app-ink-soft);
}
.fl-app-turn--me {
  background: var(--fl-app-coral-soft);
  color: #8F3A1E;
}
.fl-app-turn--me::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--fl-app-coral);
}
.fl-app-counterpart {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--fl-app-line);
  border-radius: 12px;
  background: var(--fl-app-surface);
}
.fl-app-counterpart__avatar {
  flex: none;
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--fl-app-teal-soft);
  color: var(--fl-x-teal-ink, #095e56);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
}
.fl-app-counterpart__txt { display: flex; flex-direction: column; min-width: 0; }
.fl-app-counterpart__k { font-size: 12px; color: var(--fl-app-ink-muted); }
.fl-app-counterpart__name {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--fl-app-ink);
}
.fl-app-history {
  margin: 24px 0 0;
  border: 1px solid var(--fl-app-line);
  border-radius: 12px;
  background: var(--fl-app-surface);
}
.fl-app-history__summary {
  cursor: pointer;
  list-style: none;
  min-height: var(--fl-app-tap);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--fl-app-ink);
}
.fl-app-history__summary::after {
  content: "›";
  margin-left: auto;
  color: var(--fl-app-ink-muted);
  font-size: 18px;
  transform: rotate(90deg);
  transition: transform 160ms ease-out;
}
.fl-app-history[open] .fl-app-history__summary::after { transform: rotate(-90deg); }
.fl-app-history__list {
  margin: 0;
  padding: 0 16px 12px;
  list-style: none;
}
.fl-app-history__item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 0;
  border-top: 1px solid var(--fl-app-line);
  font-family: "Inter", system-ui, sans-serif;
}
.fl-app-history__label { font-size: 14px; color: var(--fl-app-ink); }
.fl-app-history__meta { font-size: 12px; color: var(--fl-app-ink-muted); }
.fl-app-descedit { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) {
  .fl-app-history__summary::after { transition: none; }
}

/* ============================================================================
 * [FLOTRY-INTERACTION-EXPERIENCE-V2] C3 — embedded conversation.
 * Bubbles aligned per author; system events as quiet centered markers; the
 * unread divider is the coral accent line; composer pinned under the thread.
 * ========================================================================== */
.fl-app-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 2px;
  overscroll-behavior: contain;
}
.fl-app-thread__older {
  align-self: center;
  margin-bottom: 8px;
  min-height: 36px;
  font-size: 13px;
}
.fl-app-msg { display: flex; }
.fl-app-msg--mine { justify-content: flex-end; }
.fl-app-msg--other { justify-content: flex-start; }
.fl-app-msg__bubble {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 14px;
  font-family: "Inter", system-ui, sans-serif;
}
.fl-app-msg--mine .fl-app-msg__bubble {
  background: var(--fl-app-teal-soft);
  color: var(--fl-app-ink);
  border-bottom-right-radius: 4px;
}
.fl-app-msg--other .fl-app-msg__bubble {
  background: var(--fl-app-surface);
  border: 1px solid var(--fl-app-line);
  color: var(--fl-app-ink);
  border-bottom-left-radius: 4px;
}
.fl-app-msg__body {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.fl-app-msg__meta {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--fl-app-ink-muted);
}
.fl-app-msg--pending .fl-app-msg__bubble { opacity: .7; }
.fl-app-msg__failed { color: var(--fl-app-stop); display: flex; gap: 8px; align-items: center; }
.fl-app-composer__retry {
  border: 0;
  background: transparent;
  color: var(--fl-app-teal);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 24px;
  padding: 0;
}
.fl-app-sysevent {
  align-self: center;
  max-width: 92%;
  text-align: center;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  color: var(--fl-app-ink-muted);
  background: #F1F4F3;
  border-radius: 999px;
  padding: 4px 12px;
}
.fl-app-unread-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #8F3A1E;
}
.fl-app-unread-divider::before,
.fl-app-unread-divider::after {
  content: "";
  flex: 1 1 0;
  height: 2px;
  border-radius: 2px;
  background: var(--fl-app-coral-soft);
}
.fl-app-composer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--fl-app-line);
}
.fl-app-composer__input {
  flex: 1 1 200px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--fl-app-line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 44px;
}
.fl-app-composer__send { width: auto; flex: none; min-width: 96px; }
.fl-app-history--inset { margin: 0 0 12px; }

/* [FLOTRY-INTERACTION-EXPERIENCE-V2] C5 — urgency segments + conversation
   list. Summary cards are quiet links (the room carries the action); the
   numeric badge is Mensajes-only, dots everywhere else. */
.fl-app-sumcard {
  display: block;
  text-decoration: none;
  color: inherit;
}
.fl-app-sumcard:hover { border-color: var(--fl-app-teal); }
.fl-app-sumcard__right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.fl-app-sumcard__turn {
  margin: 4px 0 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--fl-app-ink-soft);
}
.fl-app-history__stack { padding: 12px 16px; }
.fl-app-convrow__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fl-app-convrow__badge {
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--fl-app-coral);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.fl-app-convrow__preview {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fl-app-convrow__when { margin-left: 8px; color: var(--fl-app-ink-muted); }

/* [FLOTRY-INTERACTION-EXPERIENCE-V2] C6 — problema (dispute) page. */
.fl-app-problema__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.fl-app-problema__opt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--fl-app-line);
  border-radius: 10px;
  background: var(--fl-app-surface);
  padding: 12px 14px;
  min-height: var(--fl-app-tap);
  cursor: pointer;
  font-family: "Inter", system-ui, sans-serif;
}
.fl-app-problema__opt--on {
  border-color: var(--fl-app-teal);
  background: var(--fl-app-teal-soft);
}
.fl-app-problema__opt-title { font-size: 14px; font-weight: 700; color: var(--fl-app-ink); }
.fl-app-problema__opt-desc { font-size: 13px; color: var(--fl-app-ink-soft); }
.fl-app-problema__notelbl {
  display: block;
  margin-top: 14px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--fl-app-ink);
}
.fl-app-problema__note {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--fl-app-line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
}

/* [FLOTRY-INTERACTION-EXPERIENCE-V2] C4 — visit schedule form. */
.fl-app-schedform__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.fl-app-schedform__lbl {
  display: block;
  flex: 1 1 140px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--fl-app-ink);
}
.fl-app-schedform__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--fl-app-line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}

/* ============================================================================
 * [FLOTRY-INTERACTION-EXPERIENCE-V2] B2 — notification bell + panel + badges.
 * The badge is visual only (aria-hidden); counts are spoken through the bell
 * and Mensajes-tab aria-labels. Coral is the attention accent; red stays
 * reserved for reclamo.
 * ========================================================================== */
.fl-app-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--fl-app-tap);
  height: var(--fl-app-tap);
  margin-left: 4px;
  flex: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fl-app-ink-soft);
  cursor: pointer;
}
.fl-app-bell:hover { background: var(--fl-app-teal-soft); color: var(--fl-app-teal); }
.fl-app-bell:focus-visible {
  outline: 3px solid var(--fl-app-teal);
  outline-offset: 2px;
}
.fl-app-bell svg { width: 24px; height: 24px; stroke: currentColor; fill: none; }
.fl-app-bell__badge,
.fl-app-nav__count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--fl-app-coral);
  color: #fff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--fl-app-surface);
}
.fl-app-nav__icon { position: relative; }
.fl-app-nav__count { top: -6px; right: -10px; }

/* Panel: bottom sheet on mobile, anchored card on desktop. */
.fl-app-notifpanel {
  position: fixed;
  z-index: 90;
  left: 0; right: 0;
  top: calc(var(--fl-app-topbar-h) + env(safe-area-inset-top, 0px));
  max-height: calc(100vh - var(--fl-app-topbar-h) - var(--fl-app-nav-h) - 24px);
  overflow-y: auto;
  background: var(--fl-app-surface);
  border-bottom: 1px solid var(--fl-app-line);
  box-shadow: 0 18px 36px rgba(16, 48, 44, .18);
  display: flex;
  flex-direction: column;
}
@media (min-width: 600px) {
  .fl-app-notifpanel {
    left: auto;
    right: 12px;
    width: 400px;
    max-width: calc(100vw - var(--fl-app-rail-w) - 24px);
    border: 1px solid var(--fl-app-line);
    border-radius: 14px;
    top: calc(var(--fl-app-topbar-h) + 8px);
  }
}
.fl-app-notifpanel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--fl-app-line);
}
.fl-app-notifpanel__title {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--fl-app-ink);
}
.fl-app-notifpanel__readall {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--fl-app-teal);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  min-height: 32px;
  cursor: pointer;
  padding: 0 4px;
}
.fl-app-notifpanel__close {
  border: 1px solid var(--fl-app-line);
  background: transparent;
  color: var(--fl-app-ink-soft);
  border-radius: 8px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
}
.fl-app-notifpanel__list { display: flex; flex-direction: column; }
.fl-app-notifpanel__hint {
  font-size: 13px;
  color: var(--fl-app-ink-soft);
  padding: 14px 16px;
  margin: 0;
}
.fl-app-notifpanel__empty { padding: 22px 16px 26px; text-align: center; }
.fl-app-notifrow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  border-top: 1px solid var(--fl-app-line);
  background: transparent;
  padding: 12px 16px;
  min-height: 52px;
  cursor: pointer;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--fl-app-ink);
}
.fl-app-notifrow:first-child { border-top: 0; }
.fl-app-notifrow--unread { background: #F4FAF8; }
.fl-app-notifrow__icon {
  flex: none;
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--fl-app-teal-soft);
  color: var(--fl-x-teal-ink, #095e56);
  font-size: 14px;
  font-weight: 700;
}
.fl-app-notifrow__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fl-app-notifrow__title { font-size: 14px; font-weight: 600; }
.fl-app-notifrow--unread .fl-app-notifrow__title { font-weight: 700; }
.fl-app-notifrow__body {
  font-size: 13px;
  color: var(--fl-app-ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fl-app-notifrow__when { font-size: 12px; color: var(--fl-app-ink-muted); }
.fl-app-notifrow__dot {
  flex: none;
  width: 8px; height: 8px;
  margin-top: 6px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--fl-app-coral);
}

/* [FLOTRY-INTERACTION-EXPERIENCE-V2] C7 — push opt-in card (bell panel). */
.fl-app-pushoptin {
  border-top: 1px solid var(--fl-app-line);
  padding: 14px 16px 16px;
  background: #F7FAF9;
}
.fl-app-pushoptin__row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.fl-app-pushoptin__row .fl-app-cta { width: auto; flex: 1 1 auto; min-height: 44px; }

/* Unread dot for dashboard cards (C5) — same visual language. */
.fl-app-unread-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--fl-app-coral);
}

/* ============================================================================
 * [FLOTRY-INTERACTION-EXPERIENCE-V2] B1 — connection banner.
 * Shown by the live runtime after 2 consecutive poll failures (debounced);
 * removed silently on recovery. Informational tone, never red (red = reclamo).
 * ========================================================================== */
.fl-app-connbanner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--fl-app-nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 80;
  background: var(--fl-app-ink);
  color: #F6FAF8;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(16, 48, 44, .25);
  max-width: calc(100vw - 32px);
  white-space: nowrap;
}
@media (min-width: 600px) {
  .fl-app-connbanner { bottom: 20px; }
}

/* [FLOTRY-FULL-JOURNEY-FINALIZATION-V1] round-2: the [hidden] attribute must
   ALWAYS win. Component display rules (.fl-app-reqcard__actions{display:flex},
   .fl-app-cta{display:inline-flex}, .fl-app-acct__hint{display:block}) were
   silently overriding the UA [hidden] rule, so "hidden" controls kept
   rendering (stale Elegir-profesionales CTA, sent quote button, consent hint). */
[hidden] { display: none !important; }
