// Responsive styles live in index.html, keyed off [data-bp-and-below~="…"]
// or @container queries on .r-tower. Do not add new inline ternaries on
// viewport width or `compact` — convert to a CSS class instead.
// Cascading: [data-bp-and-below~="mobile"] also matches at narrow.
// Use exact [data-bp="…"] only when the rule applies at one bucket alone.

const { useState, useMemo, useEffect, useRef, Fragment } = React;

// ═══════════════════════════════════════════════════════════════
// SIDEBAR — profile filters
// ═══════════════════════════════════════════════════════════════
function Sidebar({ profile, setProfile, t, lang, setLang, dark, onReset, onClose, products }) {
  const isDark = dark;
  const bg = isDark ? "#1A1817" : "#FFFFFF";
  const border = isDark ? "#2A2825" : "#E2E0DF";
  const text = isDark ? "#FAF7F3" : "#393433";
  const muted = isDark ? "#8A827F" : "#6B6361";
  const faint = isDark ? "#6B6361" : "#9A9290";
  const surface = isDark ? "#0D0D0D" : "#FAF7F3";
  const accent = "#4866B2";

  const filled = window.countProfile(profile);
  const total = window.FILTERS.length;

  // Mark sidebar as touched when any profile field is set — used by the
  // matrix scroll-hint chip to skip showing the hint if the user has
  // already engaged the sidebar filters.
  useEffect(() => {
    if (profile && Object.values(profile).some(v => v != null && !(Array.isArray(v) && v.length === 0))) {
      window.__reuSidebarTouched = true;
    }
  }, [profile]);

  // Bridge for detail slideover "Filtered out" reason buttons: scroll a
  // FilterRow into view, flash a highlight, and focus its first control.
  useEffect(() => {
    window.focusFilter = (filterKey) => {
      if (!filterKey || typeof document === "undefined") return;
      const row = document.querySelector(`[data-filter-key="${CSS.escape(filterKey)}"]`);
      if (!row) return;
      row.scrollIntoView({ behavior: "smooth", block: "center" });
      row.classList.add("r-filter-row-flash");
      setTimeout(() => row.classList.remove("r-filter-row-flash"), 1200);
      const ctrl = row.querySelector("select, button, input, [tabindex]");
      if (ctrl && typeof ctrl.focus === "function") {
        setTimeout(() => ctrl.focus({ preventScroll: true }), 320);
      }
    };
    return () => { try { delete window.focusFilter; } catch {} };
  }, []);

  // Conditional visibility: a filter with showWhen = { fieldKey: [allowedValues] }
  // only renders when the current profile matches one of those values.
  const isFilterVisible = (f) => {
    if (!f.showWhen) return true;
    for (const [key, allowed] of Object.entries(f.showWhen)) {
      const v = profile[key];
      if (v == null) return false;
      const list = Array.isArray(allowed) ? allowed : [allowed];
      if (!list.includes(v)) return false;
    }
    return true;
  };

  // Render filters in display_order (the sheet's 08-FilterDimensions
  // display_order column drives window.FILTERS array order at sync time).
  // Visibility rules (showWhen) are applied at render time.
  const HIDDEN_FILTER_KEYS = new Set(window.SETTINGS?.hiddenFilterKeys ?? ["accredited", "impactTilt"]);
  const visibleFilters = window.FILTERS
    .filter((f) => !HIDDEN_FILTER_KEYS.has(f.key))
    .filter(isFilterVisible);

  return (
    <aside style={{
      width: 245,
      maxWidth: "100%",
      flex: 1,
      background: bg,
      borderRight: `1px solid ${border}`,
      display: "flex",
      flexDirection: "column",
      color: text,
      overflow: "hidden",
    }}>
      {/* The filters' label (the logo is in the site header above, story-page.jsx). In the drawer the
          close button sits at its right. */}
      <div style={{
        minHeight: 56, padding: "12px 24px",
        borderBottom: `1px solid ${border}`, position: "relative",
        display: "flex", alignItems: "center",
        boxSizing: "border-box",
      }}>
        {onClose && (
          <button onClick={onClose} aria-label="Close menu" className="r-sb-close" style={{
            display: "none",
            position: "absolute", top: 14, right: 14,
            width: 32, height: 32,
            background: "transparent", border: `1px solid ${border}`,
            color: muted, cursor: "pointer",
            alignItems: "center", justifyContent: "center",
            fontSize: 16, lineHeight: 1,
          }}>×</button>
        )}
        <div style={{
          fontFamily: "var(--font-mono)", fontSize: 10.5, letterSpacing: "0.08em",
          textTransform: "uppercase", color: muted,
        }}>
          {lang === "es" ? "Filtrar oportunidades" : "Filter opportunities"}
        </div>
      </div>

      {filled > 0 && (
        <div style={{ padding: "10px 24px", borderBottom: `1px solid ${border}`, display: "flex", justifyContent: "flex-end" }}>
          <button onClick={onReset} style={{
            background: "transparent", border: "none", padding: 0,
            color: muted, fontSize: 10, letterSpacing: "0.06em", textTransform: "uppercase",
            cursor: "pointer", fontFamily: "var(--font-mono)",
            textDecoration: "underline", textUnderlineOffset: 2, textDecorationColor: faint,
          }}>{t.reset}</button>
        </div>
      )}

      {/* Filters — flat list in display_order from sheet. The r-filter-group
          class anchors mobile-grid CSS rules. */}
      <div style={{ flex: 1, overflowY: "auto" }}>
        <div className="r-filter-group" style={{ padding: "14px 24px 6px" }}>
          {visibleFilters.map(f => (
            <FilterRow key={f.key}
              filter={f}
              value={profile[f.key]}
              onChange={(v) => setProfile(prev => ({ ...prev, [f.key]: v }))}
              lang={lang} dark={isDark} t={t}
            />
          ))}
        </div>
      </div>

      {/* CTA */}
      <div style={{ borderTop: `1px solid ${border}`, background: surface }}>
        <div style={{ padding: "12px 24px 16px" }}>
          <button onClick={() => {
            if (window.posthog) window.posthog.capture("schedule_call_clicked", { source: "sidebar" });
            window.openSchedulingModal && window.openSchedulingModal();
          }} style={{
            width: "100%", padding: "10px 14px", background: accent, color: "#fff",
            border: "none", fontFamily: "var(--font-body)", fontSize: 12.5,
            letterSpacing: "0.02em", cursor: "pointer",
            display: "flex", alignItems: "center", justifyContent: "center", gap: 8,
          }}>
            {t.contact}
            <svg width="10" height="10" viewBox="0 0 10 10" fill="none"><path d="M1 5h8M6 2l3 3-3 3" stroke="currentColor" strokeWidth="1.4"/></svg>
          </button>
          <div style={{ fontSize: 10.5, color: muted, marginTop: 8, lineHeight: 1.5, textAlign: "center" }}>
            {t.ctaText}
          </div>
        </div>
      </div>
    </aside>
  );
}

// ─────────────────────────────────────────────────────────────
// FilterRow — renders pills for small option sets, select for large
// ─────────────────────────────────────────────────────────────
function FilterRow({ filter, value, onChange, lang, dark, t }) {
  const filled = value != null && value !== "";
  const border = dark ? "#2A2825" : "#E2E0DF";
  const text = dark ? "#FAF7F3" : "#393433";
  const muted = dark ? "#8A827F" : "#6B6361";
  const faint = dark ? "#6B6361" : "#9A9290";
  const accent = "#4866B2";
  const surface = dark ? "#22201E" : "#F6F2EC";

  const [whyOpen, setWhyOpen] = useState(false);

  return (
    <div className="r-filter-row" data-filter-key={filter.key} style={{ padding: "8px 0 12px" }}>
      <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 8 }}>
        <label style={{
          display: "inline-flex", alignItems: "center", gap: 7,
          fontSize: 10.5, letterSpacing: "0.01em",
          color: text, fontFamily: "var(--font-body)",
        }}>
          <span style={{ display: "inline-block", width: 6, height: 6, background: filled ? accent : "transparent", border: `1px solid ${filled ? accent : faint}`, verticalAlign: 1, borderRadius: 0 }}/>
          {filter.label[lang]}
        </label>
        {filter.why && (
          <button type="button" aria-label={t.whyLabel} aria-expanded={whyOpen} onClick={() => setWhyOpen(o => !o)} style={{
            width: 16, height: 16, borderRadius: "50%",
            border: `1px solid ${whyOpen ? text : border}`,
            background: whyOpen ? text : "transparent",
            color: whyOpen ? (dark ? "#1A1817" : "#FAF7F3") : muted,
            fontFamily: "Georgia, serif", fontStyle: "italic", fontSize: 10,
            cursor: "pointer", lineHeight: 1,
            padding: 0,
            display: "inline-flex", alignItems: "center", justifyContent: "center",
          }}>?</button>
        )}
      </div>

      {whyOpen && filter.why && (
        <div style={{
          fontSize: 11.5, color: muted, lineHeight: 1.5,
          padding: "8px 10px", marginBottom: 8,
          background: surface, borderLeft: `2px solid ${accent}`,
          fontFamily: "Georgia, serif", fontStyle: "italic",
        }}>
          {filter.why[lang]}
        </div>
      )}

      {filter.kind === "pills" ? (
        <PillRow filter={filter} value={value} onChange={onChange} lang={lang} dark={dark} t={t}/>
      ) : (
        <SelectInput filter={filter} value={value} onChange={onChange} lang={lang} dark={dark} t={t}/>
      )}

      {/* An always-visible hint under the control (content/filters.json "hint"), for choices that are
          easy to get wrong, such as tax residency for someone living outside their home country. */}
      {filter.hint && (
        <div style={{ marginTop: 6, fontSize: 10.5, lineHeight: 1.45, color: muted, fontFamily: "var(--font-body)" }}>
          {filter.hint[lang] || filter.hint.en}
        </div>
      )}
    </div>
  );
}

function PillRow({ filter, value, onChange, lang, dark, t }) {
  const text = dark ? "#FAF7F3" : "#393433";
  const muted = dark ? "#8A827F" : "#6B6361";
  const border = dark ? "#2A2825" : "#E2E0DF";
  const accent = "#4866B2";
  const inputBg = dark ? "#26231F" : "#FFFFFF";

  const pills = filter.options.map(o => ({ v: String(o.value), label: (o.short && o.short[lang]) || o.label[lang] }));

  if (filter.multi) {
    // Array-valued. `undefined` => untouched default (shown but not "set").
    const sel = Array.isArray(value) ? value : (value == null ? (filter.default || []) : [String(value)]);
    const has = (v) => sel.includes(v);
    const toggle = (v) => {
      const base = Array.isArray(value) ? value.slice() : (filter.default || []).slice();
      const i = base.indexOf(v);
      if (i >= 0) base.splice(i, 1); else base.push(v);
      onChange(base); // may be [] (explicit baseline)
    };
    const isAny = Array.isArray(value) && value.length === 0;
    return (
      <div style={{ display: "flex", gap: 6, flexWrap: "wrap" }}>
        <PillButton active={isAny} ariaPressed={isAny} onClick={() => onChange([])} dark={dark} placeholder>
          {t.none_opt || "Any"}
        </PillButton>
        {pills.map(p => (
          <PillButton key={p.v} active={has(p.v)} ariaPressed={has(p.v)} onClick={() => toggle(p.v)} dark={dark}>
            {p.label}
          </PillButton>
        ))}
      </div>
    );
  }

  // Single-select (unchanged)
  const isUnset = value == null || value === "";
  return (
    <div style={{ display: "flex", gap: 6, flexWrap: "wrap" }}>
      <PillButton
        active={isUnset}
        onClick={() => onChange(null)}
        dark={dark}
        placeholder>
        {t.none_opt || "Any"}
      </PillButton>
      {pills.map(p => (
        <PillButton key={p.v}
          active={value === p.v}
          onClick={() => onChange(p.v === value ? null : p.v)}
          dark={dark}>
          {p.label}
        </PillButton>
      ))}
    </div>
  );
}

function PillButton({ active, onClick, dark, children, placeholder, ariaPressed }) {
  const text = dark ? "#FAF7F3" : "#393433";
  const muted = dark ? "#8A827F" : "#6B6361";
  const faint = dark ? "#6B6361" : "#9A9290";
  const border = dark ? "#2A2825" : "#E2E0DF";
  const inputBg = dark ? "#26231F" : "#FFFFFF";
  const accent = "#4866B2";

  // Placeholder pill (the "Any" clear-state) is smaller / more muted
  if (placeholder) {
    return (
      <button type="button" aria-pressed={ariaPressed} onClick={onClick} style={{
        padding: "6px 10px",
        background: active ? (dark ? "#1A1817" : "#FAF7F3") : "transparent",
        border: `1px dashed ${active ? (dark ? "#5A5654" : "#A9A3A0") : border}`,
        color: active ? muted : faint,
        fontFamily: "var(--font-mono)", fontSize: 10, letterSpacing: "0.12em", textTransform: "uppercase",
        cursor: "pointer",
        transition: "background 160ms, border-color 160ms, color 160ms",
      }}>
        {children}
      </button>
    );
  }

  return (
    <button type="button" aria-pressed={ariaPressed} onClick={onClick} style={{
      padding: "6px 11px",
      background: active ? "#EDFE38" : inputBg,
      border: `1px solid ${active ? "#EDFE38" : border}`,
      color: active ? "#393433" : text,
      fontFamily: "var(--font-body)", fontSize: 12, letterSpacing: "-0.005em",
      cursor: "pointer",
      fontWeight: active ? 500 : 400,
      transition: "background 160ms, border-color 160ms, color 160ms",
    }}>
      {children}
    </button>
  );
}

function SelectInput({ filter, value, onChange, lang, dark, t }) {
  const filled = value != null && value !== "";
  const border = dark ? "#2A2825" : "#E2E0DF";
  const text = dark ? "#FAF7F3" : "#393433";
  const faint = dark ? "#6B6361" : "#9A9290";
  const inputBg = dark ? "#26231F" : "#FFFFFF";

  return (
    <div style={{ position: "relative" }}>
      <select
        value={filled ? value : ""}
        onChange={(e) => onChange(e.target.value || null)}
        style={{
          width: "100%",
          appearance: "none", WebkitAppearance: "none",
          background: inputBg,
          border: filled ? `1px solid ${text}` : `1px solid ${border}`,
          color: filled ? text : faint,
          fontFamily: "var(--font-body)",
          fontSize: 13,
          padding: "8px 28px 8px 10px",
          borderRadius: 0,
          cursor: "pointer",
          outline: "none",
          letterSpacing: "-0.005em",
        }}
      >
        <option value="">{t.none_opt}</option>
        {filter.options.map(o => (
          <option key={String(o.value)} value={String(o.value)}>
            {o.label[lang]}
          </option>
        ))}
      </select>
      <svg width="10" height="10" viewBox="0 0 10 10" fill="none"
        style={{ position: "absolute", right: 10, top: "50%", transform: "translateY(-50%)", pointerEvents: "none", color: filled ? text : faint }}>
        <path d="M2 3.5L5 6.5L8 3.5" stroke="currentColor" strokeWidth="1.3" fill="none"/>
      </svg>
    </div>
  );
}

function ReurbanoMark({ dark, symbol }) {
  const c = dark ? "#FAF7F3" : "#393433";
  // symbol: only the drawn mark, without the REURBANO wordmark and rule under it (the story header)
  return (
    <svg width="120" height="72" viewBox={symbol ? "12.5 0 95 37" : "0 0 120 72"} fill="none" aria-label="Reurbano" role="img" style={{ display: "block", width: "auto", height: 40, color: c }}>
      <path fill="currentColor" d="M106.924 0.00421143C106.924 5.98645 106.886 11.9687 106.937 17.9466C106.967 21.2634 106.206 24.3617 104.602 27.2242C101.895 32.0623 97.743 35.0149 92.3846 36.309C90.9734 36.6475 89.5365 36.7375 88.0911 36.7375C77.4385 36.7333 66.7817 36.7247 56.1291 36.7247C47.4993 36.7247 39.9685 30.7639 38.0441 22.339C37.2957 19.0737 37.4198 15.8211 38.5445 12.6415C38.6343 12.3929 38.6599 12.2172 38.3221 12.2172C35.8118 12.2172 33.2845 12.033 30.7913 12.2944C27.5626 12.6329 25.3004 15.2212 25.2833 18.4909C25.2533 24.2931 25.3047 30.0954 25.326 35.8976C25.326 36.729 25.3474 36.729 24.5306 36.7247C23.6026 36.7247 22.6789 36.7118 21.7509 36.7247C21.4131 36.7247 21.2848 36.609 21.2891 36.2533C21.3532 30.2196 21.3019 24.186 21.3148 18.1523C21.3276 12.7957 26.0958 8.1805 31.4242 8.2405C34.345 8.27478 37.2701 8.25336 40.1909 8.27478C40.5629 8.27478 40.7554 8.12908 40.9649 7.84197C41.8758 6.56067 42.8209 5.30509 44.1851 4.45661C44.2834 4.39661 44.4374 4.34947 44.3946 4.18663C44.3561 4.04951 44.2064 4.03236 44.091 4.00237C43.9883 3.97666 43.8772 3.97666 43.7703 3.98094C39.6392 4.11378 35.5039 4.01094 31.3729 4.04094C28.311 4.06236 25.4714 4.85514 23.0424 6.74923C19.2663 9.69749 17.1196 13.52 17.1196 18.418C17.1196 24.3274 17.111 30.2368 17.1324 36.1462C17.1324 36.639 16.987 36.7504 16.5294 36.7375C15.5501 36.7075 14.5708 36.7161 13.5915 36.729C13.2323 36.7333 13.0869 36.6261 13.0869 36.2404C13.104 30.3311 13.1382 24.4217 13.1126 18.5123C13.0784 10.4431 18.5094 3.08532 26.2583 0.818413C27.1948 0.544155 28.1399 0.282754 29.1363 0.291324C29.2689 0.291324 29.4015 0.239901 29.6153 0.192763C29.3459 0.115628 29.1663 0.0599199 28.9867 0.00421143C44.061 0.00421143 59.1354 0.00421143 74.2098 0.00421143C74.2227 6.02073 74.2355 12.0372 74.244 18.0538C74.244 19.5408 74.4023 21.0063 74.8427 22.4376C76.5448 27.9827 81.4883 32.5251 87.9543 32.7137C91.2556 32.8079 94.3218 32.0409 96.9946 30.0397C100.993 27.04 102.935 23.0075 102.93 18.0023C102.926 12.003 102.866 6.00359 102.969 0.00421143H106.924ZM64.8701 32.6837C69.2663 32.7694 72.9739 32.6237 76.6773 32.7737C76.7971 32.778 76.9553 32.8251 77.0152 32.688C77.0964 32.4994 76.8911 32.4608 76.7928 32.3837C75.5783 31.4495 74.5733 30.3182 73.7394 29.0455C73.4614 28.6212 73.1707 28.5013 72.7002 28.5055C67.1067 28.5184 61.5131 28.5184 55.9196 28.5227C55.2781 28.5227 54.6324 28.5098 54.008 28.3641C47.7644 26.8986 45.3012 21.182 45.8529 17.0467C46.4901 12.2601 50.8178 8.25764 55.6416 8.26193C58.3144 8.26193 60.9871 8.26621 63.6556 8.2705C65.704 8.2705 67.7524 8.26193 69.8008 8.27907C70.1943 8.27907 70.3268 8.17194 70.314 7.76055C70.2841 6.67209 70.2969 5.58363 70.3012 4.49517C70.3012 4.21663 70.2926 4.02808 69.912 4.03236C65.0839 4.04951 60.2559 3.98523 55.4321 4.08379C51.0359 4.17378 47.4394 6.00359 44.7111 9.50465C41.6748 13.4042 40.905 17.7495 42.1666 22.4762C42.8594 25.0602 44.3433 27.1728 46.2891 28.9855C48.701 31.2353 51.5491 32.5551 54.8291 32.6665C58.4042 32.7908 61.9878 32.6965 64.8744 32.6965L64.8701 32.6837ZM63.1767 24.5502V24.5417C65.7254 24.5417 68.2699 24.5331 70.8186 24.5502C71.2805 24.5502 71.3318 24.4688 71.1607 24.0189C70.7887 23.0547 70.5449 22.0434 70.4551 21.0106C70.4166 20.5478 70.2755 20.3721 69.7795 20.3764C65.3961 20.3935 61.0171 20.3892 56.6337 20.3892C56.313 20.3892 55.9923 20.3892 55.6715 20.355C54.7179 20.2564 53.9524 19.455 53.8968 18.5123C53.8412 17.5652 54.4955 16.6996 55.4278 16.4682C55.7784 16.3825 56.1334 16.3911 56.4883 16.3911C60.8888 16.3911 65.2892 16.3911 69.6897 16.4082C70.1558 16.4082 70.3097 16.2797 70.2926 15.804C70.2627 14.8055 70.267 13.8028 70.314 12.8086C70.3354 12.3329 70.2199 12.2001 69.7367 12.2044C65.8195 12.2258 61.898 12.2087 57.9808 12.2215C56.9844 12.2215 55.988 12.1787 54.9916 12.3072C50.7708 12.8643 48.376 17.8995 50.6339 21.5205C51.8441 23.4618 53.6017 24.516 55.9025 24.5459C58.3229 24.5759 60.7477 24.5545 63.1681 24.5545L63.1767 24.5502Z"/>
      <path fill="currentColor" d="M98.6923 0.00428527C98.6966 6.12365 98.7095 12.243 98.7095 18.3624C98.7095 24.576 93.133 29.3455 86.9963 28.3985C82.1939 27.6528 78.4478 23.2819 78.4563 18.4181C78.4649 12.2816 78.4777 6.14508 78.4862 0.00428527H82.4419C82.3436 0.377104 82.4248 0.749922 82.4248 1.12274C82.4163 6.90357 82.3949 12.6887 82.4248 18.4695C82.4505 22.4462 86.4404 25.3945 90.2678 24.3232C92.8679 23.5947 94.7281 21.2378 94.7409 18.5252C94.7666 13.0829 94.7538 7.64064 94.7538 2.19406C94.7538 1.46128 94.7409 0.732781 94.7324 0C96.0495 0 97.3709 0 98.6881 0L98.6923 0.00428527Z"/>
      <path fill="currentColor" d="M0.0134277 47.0352C1.70262 47.1552 3.3918 47.0352 5.08527 47.0352C5.73101 47.0352 6.36392 47.0909 6.98828 47.2409C8.80576 47.678 9.96894 49.0879 10.0759 50.9905C10.187 53.0089 9.27616 54.423 7.41592 55.0615C6.96262 55.2158 7.07808 55.3701 7.31328 55.6358C8.66891 57.1785 9.83637 58.8668 11.1279 60.4567C11.2134 60.5595 11.3288 60.6624 11.3075 60.8509C9.9775 60.8509 8.6518 60.8509 7.32611 60.8509C6.99255 60.8509 6.8386 60.5767 6.68893 60.341C5.88068 59.0597 5.08099 57.7741 4.27275 56.4928C4.08458 56.1971 3.94346 55.85 3.52865 55.7729C3.37042 55.9186 3.43029 56.1114 3.45167 56.27C3.61845 57.6027 3.49871 58.944 3.57141 60.281C3.59707 60.7609 3.41318 60.8895 2.95561 60.8723C1.97631 60.8381 0.997005 60.8638 0.0177042 60.8638V47.0438L0.0134277 47.0352ZM3.48588 51.569C3.48588 51.569 3.5201 51.569 3.5372 51.569C3.5372 51.9804 3.55003 52.3918 3.5372 52.7989C3.52437 53.1203 3.63128 53.2617 3.96912 53.236C4.43097 53.2017 4.89283 53.1546 5.3333 53.0089C6.46228 52.6361 6.79584 51.2819 5.98759 50.412C5.38462 49.7649 4.58493 49.7949 3.80662 49.7649C3.55003 49.7564 3.49444 49.9663 3.49444 50.1763C3.49016 50.6391 3.49444 51.1019 3.49444 51.5647L3.48588 51.569Z"/>
      <path fill="currentColor" d="M0.0135782 67.7115C7.49304 67.7115 14.9725 67.7115 22.4562 67.7115C23.1276 67.7115 23.1319 67.7115 23.1276 68.41C23.1276 69.3185 23.1148 70.2313 23.1063 71.1398C15.5498 71.1398 7.98911 71.1398 0.432668 71.1526C0.052066 71.1526 -0.00780391 71.0583 0.000748935 70.707C0.0306839 69.7085 0.00930178 68.71 0.00930178 67.7115H0.0135782Z"/>
      <path fill="currentColor" d="M90.5672 0.00428527C90.58 6.07223 90.5928 12.1402 90.6014 18.2081C90.6014 19.4937 89.776 20.3807 88.6043 20.3765C87.4411 20.3765 86.5815 19.4423 86.5815 18.1524C86.5901 12.1359 86.6072 6.12365 86.62 0.107132C86.62 0.0728496 86.6158 0.0342822 86.6115 0C87.9286 0 89.25 0 90.5672 0V0.00428527Z"/>
      <path fill="currentColor" d="M91.4603 52.4731C91.3491 52.5673 91.3534 52.6959 91.3662 52.8202C91.6143 55.0271 91.4475 57.2426 91.486 59.4538C91.4902 59.7752 91.5031 60.0966 91.5159 60.4179C91.5245 60.7179 91.4304 60.8722 91.0883 60.8636C90.1432 60.8465 89.2024 60.8422 88.2573 60.8636C87.9152 60.8722 87.8211 60.7222 87.8296 60.4222C87.8425 60.118 87.8553 59.818 87.8553 59.5138C87.8553 55.6784 87.8596 51.8388 87.8553 48.0035C87.8553 47.0265 87.8467 47.0308 88.8303 47.0393C89.506 47.0479 90.1859 47.0608 90.8616 47.0393C91.2764 47.0265 91.5458 47.1722 91.8024 47.5064C93.7739 50.0819 95.7624 52.6402 97.7509 55.2028C97.8193 55.2928 97.8621 55.4685 98.0203 55.3913C98.1444 55.3313 98.1444 55.1814 98.1315 55.0571C97.8878 52.5116 98.1743 49.9576 97.9733 47.4122C97.9519 47.1293 98.0631 47.0565 98.2898 47.0522C99.2862 47.0479 100.283 47.0522 101.283 47.0522C101.63 47.0522 101.608 47.2922 101.608 47.5364C101.608 50.5361 101.604 53.5315 101.608 56.5312C101.608 57.7782 101.625 59.0295 101.647 60.2765C101.655 60.6879 101.54 60.8936 101.069 60.8679C100.36 60.8293 99.6411 60.8208 98.9355 60.8679C98.3539 60.9065 97.9647 60.6965 97.6226 60.2423C96.2071 58.3867 94.766 56.5484 93.3377 54.7014C92.833 54.0543 92.3327 53.403 91.8238 52.7645C91.7297 52.6488 91.657 52.4816 91.4731 52.4731H91.4603Z"/>
      <path fill="currentColor" d="M119.98 53.7158C120.266 57.2383 117.474 61.3179 112.565 61.4121C108.096 61.4978 104.705 58.2796 104.615 53.8315C104.538 49.9662 107.985 46.6451 112.103 46.4951C116.084 46.3537 120.254 49.5805 119.98 53.7158ZM112.261 57.8639C114.493 57.8554 116.319 56.0598 116.311 53.8872C116.302 51.7703 114.485 49.9619 112.376 49.9747C110.277 49.9876 108.378 51.7617 108.382 53.7201C108.382 56.0041 110.136 57.8725 112.261 57.8639Z"/>
      <path fill="currentColor" d="M65.5715 53.5359C65.6356 53.5616 65.6955 53.5959 65.7553 53.6088C67.158 53.8445 67.8765 54.7401 68.1245 56.0814C68.4025 57.6027 68.0774 58.9182 66.786 59.8867C65.7981 60.6281 64.6349 60.8209 63.4546 60.8466C61.6927 60.8852 59.9266 60.8466 58.1647 60.8638C57.8482 60.8638 57.7371 60.7909 57.7413 60.4524C57.7542 56.1328 57.7542 51.8133 57.7413 47.4894C57.7413 47.1337 57.8525 47.0395 58.1989 47.0438C59.8368 47.0566 61.4789 47.018 63.1168 47.0523C64.1987 47.0738 65.2165 47.2966 66.0504 48.1065C67.111 49.135 67.3547 52.0018 65.9221 53.116C65.7853 53.2231 65.6271 53.3174 65.5757 53.5317L65.5715 53.5359ZM61.3506 56.6128C61.3292 56.9384 61.3079 57.2941 61.2779 57.6498C61.2608 57.8683 61.2865 58.0569 61.5602 58.0612C62.2358 58.0698 62.9115 58.1083 63.5701 57.9069C64.2372 57.7012 64.6093 57.2384 64.6135 56.6556C64.6135 56.0085 64.2329 55.4986 63.5615 55.2843C62.9244 55.0829 62.2615 55.1258 61.6072 55.1343C61.3464 55.1343 61.2822 55.28 61.2993 55.5157C61.3292 55.8714 61.3378 56.2271 61.3549 56.6128H61.3506ZM61.2779 51.1233C61.3036 52.6232 61.4019 52.7132 62.6849 52.3875C62.7533 52.3703 62.8217 52.3446 62.8859 52.3189C63.399 52.1089 63.7454 51.5861 63.7112 51.0676C63.6727 50.4548 63.3392 50.0477 62.7319 49.902C62.424 49.8292 62.1033 49.7906 61.7868 49.752C61.4404 49.7092 61.2437 49.8206 61.2737 50.2191C61.295 50.5191 61.2779 50.8234 61.2779 51.1276V51.1233Z"/>
      <path fill="currentColor" d="M42.7738 53.9515C42.7738 51.8088 42.7824 49.6662 42.7653 47.5236C42.7653 47.1508 42.8593 47.0351 43.2399 47.0393C44.8778 47.0565 46.5157 47.0222 48.1578 47.0393C49.3681 47.0522 50.5312 47.2793 51.4977 48.0935C52.8576 49.2334 53.1057 50.7418 52.802 52.3702C52.5369 53.8015 51.6046 54.68 50.2105 55.0614C49.7957 55.1728 49.9026 55.357 50.0993 55.5842C51.4165 57.084 52.5369 58.7467 53.8155 60.2808C53.884 60.3622 53.9438 60.4522 54.0037 60.5422C54.1491 60.7522 54.1961 60.8808 53.8369 60.8765C52.6994 60.8551 51.5576 60.8422 50.4158 60.8679C49.9753 60.8765 49.7187 60.6879 49.5049 60.3494C48.6325 58.9395 47.6831 57.5811 46.8664 56.137C46.7808 55.9827 46.7552 55.687 46.4986 55.7599C46.2463 55.8327 46.2848 56.1113 46.3019 56.3127C46.4302 57.6111 46.319 58.9181 46.4045 60.2165C46.4344 60.6879 46.3061 60.8936 45.7887 60.8679C44.9548 60.8251 44.1123 60.8293 43.2784 60.8679C42.8337 60.8893 42.761 60.7265 42.761 60.328C42.7781 58.2025 42.7695 56.0813 42.7695 53.9558L42.7738 53.9515ZM46.3361 51.5089C46.3361 51.5089 46.3617 51.5089 46.3746 51.5089C46.3746 51.6332 46.3746 51.7574 46.3746 51.8817C46.3874 53.4201 46.4515 53.4672 47.9568 53.0516C48.7779 52.8245 49.1756 52.3316 49.1885 51.5346C49.2013 50.7461 48.7736 50.1376 47.9953 49.9276C47.6062 49.8205 47.1914 49.7991 46.7894 49.7476C46.4686 49.7048 46.3318 49.8633 46.3361 50.1762C46.3404 50.6218 46.3361 51.0632 46.3361 51.5089Z"/>
      <path fill="currentColor" d="M26.8098 51.8475C26.8098 50.4034 26.8184 48.955 26.8013 47.5109C26.8013 47.168 26.8868 47.0266 27.2503 47.0352C28.174 47.0609 29.102 47.0695 30.03 47.0566C30.3421 47.0523 30.4277 47.1509 30.4234 47.4509C30.4063 49.752 30.402 52.0532 30.402 54.3587C30.402 54.8387 30.4234 55.3229 30.4704 55.8029C30.6073 57.2384 31.4711 58.0526 32.831 58.044C34.2251 58.0355 35.1061 57.2041 35.1745 55.7386C35.2301 54.5644 35.2044 53.3817 35.2044 52.2075C35.2044 50.6391 35.2044 49.0664 35.1788 47.498C35.1745 47.1637 35.2814 47.0438 35.5936 47.0438C36.5558 47.048 37.518 47.048 38.4802 47.0523C38.7496 47.0523 38.8437 47.168 38.8394 47.4466C38.818 50.2663 38.8437 53.086 38.7966 55.9057C38.741 58.9525 36.8167 60.9409 33.7761 61.1509C32.6215 61.228 31.4626 61.228 30.3379 60.8638C28.174 60.1653 26.9681 58.6011 26.8611 56.1928C26.797 54.7487 26.8483 53.3045 26.8483 51.8561C26.8355 51.8561 26.8227 51.8561 26.8098 51.8561V51.8475Z"/>
      <path fill="currentColor" d="M13.3686 53.9387C13.3686 51.7789 13.3814 49.6192 13.36 47.4637C13.3557 46.9409 13.685 47.0437 13.963 47.0437C16.1867 47.0437 18.4148 47.0566 20.6385 47.0651C21.3313 47.0651 22.0283 47.078 22.7211 47.0566C23.0162 47.048 23.1402 47.1251 23.1316 47.4423C23.1103 48.1922 23.0974 48.9421 23.1231 49.6877C23.1359 50.0734 22.9862 50.1505 22.627 50.1463C20.9336 50.1291 19.2444 50.1548 17.5509 50.1291C17.0933 50.1205 16.9351 50.2705 16.995 50.7076C17.0164 50.849 16.995 50.9947 16.995 51.1362C16.995 51.9818 17.424 52.4046 18.2822 52.4046C19.672 52.4046 21.0619 52.4175 22.4474 52.4046C22.8964 52.4046 23.0803 52.5246 23.0247 53.026C22.9606 53.6088 22.9948 54.2001 23.0247 54.7915C23.0547 55.4171 23.0461 55.4471 22.3961 55.4471C20.7753 55.4471 19.1546 55.4514 17.5338 55.4257C17.1233 55.4214 16.9437 55.5071 16.9821 55.9571C17.0206 56.3985 17.0121 56.8484 16.9821 57.2941C16.9565 57.6798 17.1019 57.7783 17.4697 57.7783C19.1631 57.7698 20.8523 57.7998 22.5458 57.7912C23.0034 57.7912 23.1701 57.9155 23.1274 58.404C23.0718 59.0425 23.0932 59.6896 23.1145 60.3281C23.1274 60.718 23.0376 60.8766 22.5928 60.8723C19.7105 60.8509 16.8239 60.8466 13.9373 60.8723C13.437 60.8766 13.3557 60.7009 13.36 60.2595C13.3814 58.1554 13.3686 56.0471 13.3686 53.943H13.60L13.3686 53.9387Z"/>
      <path fill="currentColor" d="M82.7367 60.8552C82.5785 60.8552 82.416 60.8552 82.2578 60.8552C81.3255 60.8552 80.7069 60.4009 80.4018 59.4925C80.034 58.404 80.034 58.4212 78.9136 58.4469C77.8274 58.4683 76.7412 58.4597 75.655 58.434C75.206 58.4254 74.9536 58.5369 74.7911 59.0082C74.5773 59.621 74.5303 60.4181 73.9743 60.7609C73.4697 61.0694 72.7598 60.8338 72.1398 60.8552C71.6608 60.8723 71.1776 60.8552 70.6986 60.8595C70.4292 60.8595 70.3052 60.838 70.4377 60.5038C72.1269 56.1757 73.8033 51.8475 75.4711 47.5109C75.6037 47.1723 75.7961 47.0395 76.1425 47.0438C77.1047 47.0523 78.0669 47.0566 79.0291 47.0352C79.3926 47.0266 79.5508 47.168 79.6791 47.5109C81.2357 51.6804 82.8052 55.8414 84.3746 60.0067C84.6953 60.8595 84.6996 60.8595 83.8101 60.8595C83.4552 60.8595 83.096 60.8595 82.741 60.8595L82.7367 60.8552ZM77.5494 55.6957C77.9044 55.6957 78.2593 55.67 78.6143 55.7043C79.0205 55.7429 79.0547 55.6057 78.9307 55.2543C78.5843 54.2859 78.2807 53.3045 77.9386 52.3361C77.8317 52.0275 77.8146 51.5176 77.4767 51.5176C77.1902 51.5176 77.2244 52.0404 77.1389 52.3318C76.8567 53.3045 76.5231 54.2559 76.1596 55.2029C76.0527 55.4857 75.9757 55.7686 76.4846 55.7086C76.8353 55.6657 77.1945 55.7 77.5494 55.7V55.6957Z"/>
      <path fill="currentColor" d="M33.4296 27.2758C33.4382 30.2198 33.3398 33.1638 33.4852 36.1078C33.5109 36.6048 33.3398 36.7634 32.848 36.7463C31.8858 36.712 30.9236 36.7206 29.9657 36.7334C29.5637 36.7377 29.4141 36.6263 29.4141 36.1849C29.4397 30.5455 29.4483 24.9061 29.4611 19.2709C29.4611 18.9324 29.4611 18.5939 29.4953 18.2553C29.6108 17.0812 30.4917 16.3312 31.6763 16.3912C32.6813 16.4427 33.4211 17.2954 33.4253 18.4482C33.4339 21.3921 33.4253 24.3361 33.4253 27.2801L33.4296 27.2758Z"/>
    </svg>
  );
}

window.Sidebar = Sidebar;
window.ReurbanoMark = ReurbanoMark;
