/* =====================================================================
   SiggoFin UI — Liquid Glass (inspirado no iOS 27) + identidade SiggoFin
   Um único arquivo de estilo para todas as páginas.
   Tema: <html data-theme="dark|light">  ·  Transparência: --sg-ga (0..1)
   ===================================================================== */

/* ---------- Tokens da marca (extraídos da logo) ---------- */
:root {
    --brand-navy:   #002E65;
    --brand-navy-2: #013E81;
    --brand-blue:   #3383CC;
    --brand-sky:    #4EB5E7;
    --brand-green:  #46B274;
    --brand-lime:   #82D654;
    --brand-teal:   #00504D;

    --grad-brand:  linear-gradient(135deg, #4EB5E7 0%, #3383CC 48%, #2563B8 100%);
    --grad-fin:    linear-gradient(90deg, #4EB5E7 0%, #5DC28F 55%, #82D654 100%);
    --grad-green:  linear-gradient(135deg, #82D654 0%, #46B274 100%);

    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --sg-ga: 0.55;            /* intensidade do vidro (controlada pelo slider) */
    --tabbar-h: 74px;

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
}

/* ---------- Tema escuro ---------- */
html[data-theme="dark"] {
    color-scheme: dark;
    --bg:        #04122A;
    --surf-rgb:  28, 44, 78;          /* cor base do vidro */
    --surf-op:   calc(0.12 + var(--sg-ga) * 0.55);
    --fill:      rgba(255,255,255,0.07);
    --fill-2:    rgba(255,255,255,0.12);
    --stroke:    rgba(255,255,255,0.14);
    --hl:        rgba(255,255,255,0.22);
    --sep:       rgba(255,255,255,0.08);
    --shadow:    rgba(0,0,0,0.45);
    --label:     #F5F8FF;
    --label-2:   rgba(235,242,255,0.72);
    --label-3:   rgba(235,242,255,0.46);
    --blue:      #5CB8F0;
    --green:     #6FD08C;
    --red:       #FF6B6B;
    --orange:    #FFB340;
    --tint-blue:  rgba(78,181,231,0.16);
    --tint-green: rgba(70,178,116,0.18);
    --tint-red:   rgba(255,107,107,0.16);
    --tint-orange:rgba(255,179,64,0.16);
    --orb-1: rgba(51,131,204,0.70);
    --orb-2: rgba(0,120,105,0.75);
    --orb-3: rgba(130,214,84,0.30);
    --orb-4: rgba(78,181,231,0.28);
}

/* ---------- Tema claro ---------- */
html[data-theme="light"] {
    color-scheme: light;
    --bg:        #EAF1FA;
    --surf-rgb:  255, 255, 255;
    --surf-op:   calc(0.40 + var(--sg-ga) * 0.50);
    --fill:      rgba(0,46,101,0.05);
    --fill-2:    rgba(0,46,101,0.09);
    --stroke:    rgba(255,255,255,0.85);
    --hl:        rgba(255,255,255,0.95);
    --sep:       rgba(0,46,101,0.08);
    --shadow:    rgba(0,46,101,0.12);
    --label:     #0A1F3F;
    --label-2:   rgba(10,31,63,0.66);
    --label-3:   rgba(10,31,63,0.42);
    --blue:      #1F6FC4;
    --green:     #23955A;
    --red:       #E0353B;
    --orange:    #C9700A;
    --tint-blue:  rgba(51,131,204,0.12);
    --tint-green: rgba(70,178,116,0.14);
    --tint-red:   rgba(224,53,59,0.10);
    --tint-orange:rgba(201,112,10,0.12);
    --orb-1: rgba(78,181,231,0.55);
    --orb-2: rgba(130,214,84,0.38);
    --orb-3: rgba(51,131,204,0.30);
    --orb-4: rgba(70,178,116,0.22);
}

/* Medidas incluem o espaçamento interno (evita botões "vazando" da caixa) */
*, *::before, *::after { box-sizing: border-box; }

/* ---------- Base: tela travada como app ----------
   A página não rola nem "estica": só a área .sg-scroll rola por dentro.
   O tamanho da tela vem de --app-h (calculado no siggofin-ui.js), porque
   no app instalado o iPhone às vezes informa uma altura menor que a real. */
html {
    height: 100%; overflow: hidden; overscroll-behavior: none;
    background: var(--bg); -webkit-text-size-adjust: 100%; touch-action: manipulation;
}
body.sg {
    position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none;
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--label);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: -0.01em;
    transition: background-color .35s ease, color .35s ease;
}
/* Moldura do app: ocupa a tela inteira e serve de referência para tudo
   que é "fixo" (barra de abas, folhas, janelas) — graças ao transform. */
.sg-shell {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--app-h, 100dvh); min-height: 100%;
    overflow: hidden; transform: translateZ(0); isolation: isolate;
}
.sg-scroll {
    position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior: none;
}
.sg-content { min-height: 100%; box-sizing: border-box; }
.has-tabbar .sg-content { padding-bottom: calc(var(--tabbar-h) + 34px + env(safe-area-inset-bottom)); }

/* Sensação de app: sem seleção acidental, sem menu de "segurar" em imagens */
body.sg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.sg input, body.sg textarea, body.sg select, body.sg [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
body.sg img { -webkit-user-drag: none; }

/* fundo com "orbs" da marca — é o que dá vida ao vidro */
.sg-shell::before {
    content: ""; position: absolute; inset: -8vmax; z-index: -2; pointer-events: none;
    background:
        radial-gradient(46vmax 46vmax at 10% 6%,  var(--orb-1), transparent 68%),
        radial-gradient(50vmax 50vmax at 95% 92%, var(--orb-2), transparent 68%),
        radial-gradient(34vmax 34vmax at 90% 22%, var(--orb-3), transparent 70%),
        radial-gradient(30vmax 30vmax at 20% 80%, var(--orb-4), transparent 70%);
    filter: blur(10px);
    animation: sg-drift 28s ease-in-out infinite alternate;
}
@keyframes sg-drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-3vmax,2vmax,0) scale(1.06); } }


::selection { background: rgba(78,181,231,0.35); }

/* ---------- Vidro ---------- */
.sg-glass, .glass {
    background: rgba(var(--surf-rgb), var(--surf-op));
    -webkit-backdrop-filter: blur(calc(14px + var(--sg-ga) * 22px)) saturate(185%);
    backdrop-filter: blur(calc(14px + var(--sg-ga) * 22px)) saturate(185%);
    border: 1px solid var(--stroke);
    box-shadow: inset 0 1px 0 var(--hl), 0 10px 40px -12px var(--shadow);
}
.sg-card { border-radius: var(--radius-xl); padding: 22px; }
.sg-card-sm { border-radius: var(--radius-lg); padding: 16px; }

/* ---------- Tipografia ---------- */
.sg-large-title { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; color: var(--label); }
.sg-title  { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--label); }
.sg-headline { font-size: 15px; font-weight: 650; color: var(--label); }
.sg-caption { font-size: 12px; font-weight: 600; color: var(--label-3); text-transform: uppercase; letter-spacing: 0.06em; }
.sg-sub { font-size: 13px; color: var(--label-2); }
.sg-muted { color: var(--label-3); }
.sg-text-fin { background: var(--grad-fin); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Botões ---------- */
.sg-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 50px; padding: 0 22px; border-radius: 999px; border: 0;
    font: 650 15px/1 var(--font); letter-spacing: -0.01em; cursor: pointer;
    transition: transform .18s cubic-bezier(.2,.8,.2,1), filter .2s, background .2s, opacity .2s;
    -webkit-user-select: none; user-select: none;
}
.sg-btn:active { transform: scale(0.96); }
.sg-btn:disabled { opacity: .55; cursor: not-allowed; }
.sg-btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 8px 24px -8px rgba(51,131,204,0.7), inset 0 1px 0 rgba(255,255,255,0.35); }
.sg-btn-primary:hover { filter: brightness(1.07); }
.sg-btn-success { background: var(--grad-green); color: #04220F; box-shadow: 0 8px 24px -8px rgba(70,178,116,0.7), inset 0 1px 0 rgba(255,255,255,0.4); }
.sg-btn-glass { background: var(--fill-2); color: var(--label); border: 1px solid var(--stroke); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.sg-btn-glass:hover { background: var(--fill); }
.sg-btn-danger { background: var(--tint-red); color: var(--red); }
.sg-btn-plain { background: transparent; color: var(--blue); min-height: 40px; padding: 0 10px; }
.sg-btn-block { width: 100%; }
.sg-btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; }
.sg-icon-btn {
    width: 42px; height: 42px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--fill-2); color: var(--label); border: 1px solid var(--stroke); cursor: pointer;
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: transform .18s;
}
.sg-icon-btn:active { transform: scale(0.92); }
.sg-icon-btn svg { width: 20px; height: 20px; }

/* ---------- Campos ---------- */
.sg-input, .sg-select, .sg-textarea {
    width: 100%; box-sizing: border-box; min-height: 50px; padding: 12px 16px;
    border-radius: var(--radius-md); border: 1px solid transparent; outline: none;
    background: var(--fill); color: var(--label); font: 500 16px/1.3 var(--font);
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.sg-textarea { min-height: 90px; resize: vertical; }
.sg-input::placeholder, .sg-textarea::placeholder { color: var(--label-3); }
.sg-input:focus, .sg-select:focus, .sg-textarea:focus { border-color: var(--brand-sky); background: var(--fill-2); box-shadow: 0 0 0 4px rgba(78,181,231,0.18); }
.sg-select { appearance: none; -webkit-appearance: none; padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237d8ea8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center; }
.sg-select option { background: var(--bg); color: var(--label); }
.sg-label { display: block; font-size: 12px; font-weight: 650; color: var(--label-3); margin: 0 0 6px 4px; text-transform: uppercase; letter-spacing: .05em; }
input[type="date"].sg-input { min-height: 50px; }
input[type="checkbox"].sg-check { width: 20px; height: 20px; accent-color: var(--brand-blue); }

/* Switch estilo iOS */
.sg-switch { position: relative; width: 51px; height: 31px; flex-shrink: 0; }
.sg-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.sg-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--fill-2); transition: .25s; cursor: pointer; }
.sg-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: .25s cubic-bezier(.2,.8,.2,1); }
.sg-switch input:checked + span { background: var(--brand-green); }
.sg-switch input:checked + span::after { transform: translateX(20px); }

/* Slider estilo iOS */
.sg-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: var(--fill-2); outline: none; }
.sg-range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); cursor: pointer; }
.sg-range::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); cursor: pointer; }

/* Controle segmentado */
.sg-segment { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--fill); gap: 2px; position: relative; }
.sg-segment button {
    border: 0; background: transparent; color: var(--label-2); font: 600 13px/1 var(--font);
    padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: background .25s, color .25s, box-shadow .25s; white-space: nowrap;
}
.sg-segment button.is-active { background: rgba(var(--surf-rgb), 0.95); color: var(--label); box-shadow: 0 2px 8px var(--shadow); }
html[data-theme="dark"] .sg-segment button.is-active { background: rgba(255,255,255,0.18); }

/* Chips / pílulas */
.sg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--fill); color: var(--label-2); }
.sg-chip-blue   { background: var(--tint-blue);  color: var(--blue); }
.sg-chip-green  { background: var(--tint-green); color: var(--green); }
.sg-chip-red    { background: var(--tint-red);   color: var(--red); }
.sg-chip-orange { background: var(--tint-orange);color: var(--orange); }

/* Lista agrupada (Ajustes do iOS) */
.sg-list { border-radius: var(--radius-lg); overflow: hidden; }
.sg-list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; min-height: 52px; box-sizing: border-box; }
.sg-list-row + .sg-list-row { border-top: 1px solid var(--sep); }
a.sg-list-row { color: inherit; text-decoration: none; }
a.sg-list-row:active, button.sg-list-row:active { background: var(--fill); }
button.sg-list-row { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: left; }

/* ---------- Barra superior ---------- */
.sg-topbar {
    position: sticky; top: 0; z-index: 60;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sg-topbar-inner {
    max-width: 1200px; margin: 0 auto; width: 100%;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 8px 8px 16px; border-radius: 999px;
}
.sg-topbar img.sg-logo { height: 34px; width: auto; display: block; }
.sg-topbar-title { font-size: 15px; font-weight: 700; color: var(--label-2); }

/* ---------- Tab bar flutuante ---------- */
.sg-tabbar {
    position: fixed; z-index: 70; left: 50%; transform: translateX(-50%);
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: min(560px, calc(100% - 24px)); height: var(--tabbar-h); box-sizing: border-box;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 6px;
    border-radius: 999px;
}
.sg-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 100%; border-radius: 999px; text-decoration: none; color: var(--label-2);
    font: 600 10.5px/1 var(--font); letter-spacing: 0; transition: color .2s, background .25s, transform .18s;
}
.sg-tab svg { width: 24px; height: 24px; }
.sg-tab:active { transform: scale(0.92); }
.sg-tab.is-active { color: var(--blue); background: var(--fill-2); }

/* ---------- Sheet (folha inferior) ---------- */
.sg-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(0,10,30,0.35); opacity: 0; pointer-events: none; transition: opacity .3s; }
.sg-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sg-sheet {
    position: fixed; z-index: 901; left: 50%; bottom: 0; width: min(560px, 100%); box-sizing: border-box;
    transform: translate(-50%, 105%); visibility: hidden;
    transition: transform .42s cubic-bezier(.2,.9,.25,1), visibility 0s linear .42s;
    border-radius: 34px 34px 0 0; padding: 10px 18px calc(24px + env(safe-area-inset-bottom));
    max-height: 92vh; overflow-y: auto;
}
.sg-sheet.is-open { transform: translate(-50%, 0); visibility: visible; transition: transform .42s cubic-bezier(.2,.9,.25,1), visibility 0s; }
.sg-sheet-grabber { width: 38px; height: 5px; border-radius: 99px; background: var(--fill-2); margin: 4px auto 14px; }
@media (min-width: 700px) {
    .sg-sheet { bottom: auto; top: 50%; border-radius: 34px; transform: translate(-50%, -40%) scale(.96); opacity: 0; pointer-events: none; transition: transform .35s cubic-bezier(.2,.9,.25,1), opacity .25s; }
    .sg-sheet.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
}

/* ---------- Toast ---------- */
.sg-toast-wrap { position: fixed; z-index: 2000; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: min(420px, calc(100% - 32px)); }
.sg-toast { padding: 14px 18px; border-radius: 22px; font-size: 14px; font-weight: 600; color: var(--label); animation: sg-toast-in .35s cubic-bezier(.2,.9,.25,1); display: flex; align-items: center; gap: 10px; }
.sg-toast.out { animation: sg-toast-out .3s forwards; }
@keyframes sg-toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sg-toast-out { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* Camadas sobrepostas (janelas, folhas, alertas) ficam mais foscas para o
   conteúdo de trás não atrapalhar a leitura — o ajuste que o iOS 27 fez. */
.modal-box.sg-glass, .sg-sheet.sg-glass, .sg-dialog.sg-glass {
    background: rgba(var(--surf-rgb), calc(var(--surf-op) + 0.32));
    -webkit-backdrop-filter: blur(40px) saturate(170%); backdrop-filter: blur(40px) saturate(170%);
}
html[data-theme="dark"] .modal-box.sg-glass, html[data-theme="dark"] .sg-sheet.sg-glass, html[data-theme="dark"] .sg-dialog.sg-glass { background: rgba(16, 28, 54, 0.90); }

/* ---------- Diálogo (alerta iOS) ---------- */
.sg-dialog-wrap { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: rgba(0,10,30,0.38); opacity: 0; transition: opacity .2s; }
.sg-dialog-wrap.is-open { opacity: 1; }
.sg-dialog { width: min(300px, 100%); border-radius: 26px; overflow: hidden; transform: scale(1.08); transition: transform .25s cubic-bezier(.2,.9,.25,1); }
.sg-dialog-wrap.is-open .sg-dialog { transform: scale(1); }
.sg-dialog-body { padding: 22px 18px 18px; text-align: center; }
.sg-dialog-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--label); }
.sg-dialog-msg { margin: 6px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--label-2); }
.sg-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--sep); }
.sg-dialog-actions.is-stack { grid-template-columns: 1fr; }
.sg-dialog-actions button { min-height: 48px; border: 0; background: transparent; color: var(--blue); font: 500 16px var(--font); cursor: pointer; }
.sg-dialog-actions button + button { border-left: 1px solid var(--sep); }
.sg-dialog-actions.is-stack button + button { border-left: 0; border-top: 1px solid var(--sep); }
.sg-dialog-actions button:active { background: var(--fill); }
.sg-dialog-actions button.is-bold { font-weight: 700; }
.sg-dialog-actions button.is-danger { color: var(--red); font-weight: 700; }

/* ---------- Utilitários ---------- */
.sg-page { max-width: 1200px; margin: 0 auto; padding: 8px 16px 24px; box-sizing: border-box; }
.sg-page-narrow { max-width: 620px; }
.sg-hidden { display: none !important; }
.sg-fade-in { animation: sg-fade .45s cubic-bezier(.2,.9,.25,1) both; }
@keyframes sg-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sg-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--fill-2); border-top-color: var(--brand-sky); animation: sg-spin .8s linear infinite; }
@keyframes sg-spin { to { transform: rotate(360deg); } }
.sg-num { font-variant-numeric: tabular-nums; }
.text-positive { color: var(--green) !important; }
.text-negative { color: var(--red) !important; }

/* ---------- Modal genérico ---------- */
.modal, .modal-overlay { position: fixed; inset: 0; z-index: 1200; display: none; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; background: rgba(0,10,30,0.45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.modal.active, .modal-overlay.active { display: flex; }
.modal-box { border-radius: 32px; padding: 26px; width: 100%; max-width: 760px; margin-top: 24px; box-sizing: border-box; animation: sg-fade .35s cubic-bezier(.2,.9,.25,1); }

/* =====================================================================
   PONTE COM TAILWIND — converte as classes usadas nos HTMLs gerados
   via JavaScript para o novo visual (sem reescrever cada template).
   ===================================================================== */
body.sg .bg-white          { background: rgba(var(--surf-rgb), var(--surf-op)) !important; -webkit-backdrop-filter: blur(calc(14px + var(--sg-ga) * 22px)) saturate(185%); backdrop-filter: blur(calc(14px + var(--sg-ga) * 22px)) saturate(185%); border-color: var(--stroke) !important; }
body.sg .bg-slate-50,
body.sg .bg-slate-100,
body.sg .bg-slate-800,
body.sg .bg-slate-900,
body.sg .bg-slate-950       { background: var(--fill) !important; }
body.sg .bg-white\/5,
body.sg .bg-white\/10       { background: var(--fill) !important; }
body.sg .text-slate-800,
body.sg .text-slate-700,
body.sg .text-slate-200,
body.sg .text-slate-100     { color: var(--label) !important; }
body.sg .text-slate-600,
body.sg .text-slate-500     { color: var(--label-2) !important; }
body.sg .text-slate-400     { color: var(--label-3) !important; }
body.sg .border-slate-50,
body.sg .border-slate-100,
body.sg .border-slate-200,
body.sg .border-white\/5,
body.sg .border-white\/10   { border-color: var(--sep) !important; }
body.sg .text-emerald-400,
body.sg .text-emerald-500,
body.sg .text-emerald-600,
body.sg .text-emerald-700   { color: var(--green) !important; }
body.sg .text-rose-400,
body.sg .text-rose-500,
body.sg .text-rose-600,
body.sg .text-rose-700      { color: var(--red) !important; }
body.sg .text-indigo-300,
body.sg .text-indigo-400,
body.sg .text-indigo-500,
body.sg .text-indigo-600,
body.sg .text-indigo-700    { color: var(--blue) !important; }
body.sg .text-amber-700     { color: var(--orange) !important; }
body.sg .bg-emerald-50,
body.sg .bg-emerald-100,
body.sg .bg-emerald-500\/20 { background: var(--tint-green) !important; }
body.sg .bg-rose-50,
body.sg .bg-rose-100        { background: var(--tint-red) !important; }
body.sg .bg-indigo-100,
body.sg .bg-indigo-500\/20,
body.sg .bg-indigo-600\/10  { background: var(--tint-blue) !important; }
body.sg .bg-amber-50\/50,
body.sg .bg-amber-100       { background: var(--tint-orange) !important; }
body.sg .border-amber-200   { border-color: rgba(255,179,64,0.25) !important; }
body.sg .bg-indigo-600      { background: var(--grad-brand) !important; color: #fff !important; }
body.sg .bg-indigo-600.text-white,
body.sg .bg-indigo-600 *    { color: #fff; }

/* ---------- Acessibilidade ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
    :root { --sg-ga: 1 !important; }
}

/* CAPTCHA (Turnstile) — some quando desligado */
.sg-captcha:empty{display:none}
.sg-captcha{margin:10px 0 2px;min-height:65px;display:flex;justify-content:center}

/* =========================== Ajuda e primeiros passos =========================== */
.sg-ajuda-btn {
    position: fixed; z-index: 75; width: 50px; height: 50px; border-radius: 50%;
    left: max(14px, calc(50% - 280px)); bottom: calc(20px + env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer;
    border: 1px solid var(--glass-stroke, rgba(255,255,255,.6)); padding: 0;
    box-shadow: 0 10px 28px -10px rgba(0,46,101,.45); transition: transform .2s, opacity .2s;
}
.has-tabbar .sg-ajuda-btn { bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom)); }
.sg-ajuda-btn:active { transform: scale(.92); }
.sg-ajuda-btn.is-quieto { opacity: .72; width: 44px; height: 44px; font-size: 19px; }
.sg-ajuda-badge {
    position: absolute; top: -4px; right: -8px; min-width: 26px; height: 20px; padding: 0 6px; border-radius: 99px;
    background: var(--grad-green, #46B274); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
    box-shadow: 0 4px 10px -4px rgba(70,178,116,.8);
}
.has-tabbar.has-ajuda .sg-content { padding-bottom: calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom)); }
.sg-ajuda-sheet { max-height: min(86vh, 760px); overflow-y: auto; }
.sg-ajuda-sec { margin: 18px 6px 8px; }
.sg-ajuda-lista { display: flex; flex-direction: column; gap: 8px; }
.sg-ajuda-item { display: flex; align-items: center; gap: 10px; background: var(--fill); border-radius: 18px; padding: 10px 10px 10px 12px; flex-wrap: wrap; }
.sg-ajuda-ic { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--glass-bg, rgba(255,255,255,.55)); }
.sg-ajuda-item.is-feito .sg-ajuda-ic { background: var(--grad-green, #46B274); color: #fff; font-weight: 800; }
.sg-ajuda-nome { flex: 1 1 140px; min-width: 0; font-weight: 650; font-size: 14.5px; }
.sg-ajuda-item.is-feito .sg-ajuda-nome { color: var(--label-2); }
.sg-ajuda-acoes { display: flex; gap: 6px; margin-left: auto; }
.sg-ajuda-chip { border: 0; border-radius: 99px; padding: 7px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; background: var(--glass-bg, rgba(255,255,255,.7)); color: var(--blue); white-space: nowrap; }
.sg-ajuda-chip.is-forte { background: var(--blue); color: #fff; }
.sg-ajuda-progresso { background: var(--fill); border-radius: 18px; padding: 12px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.sg-ajuda-progresso .progress { height: 7px; border-radius: 99px; background: var(--fill-2, rgba(0,0,0,.08)); overflow: hidden; }
.sg-ajuda-progresso .progress i { display: block; height: 100%; background: var(--grad-green, #46B274); border-radius: 99px; transition: width .4s; }
.sg-ajuda-card { background: var(--fill); border-radius: 18px; padding: 12px 14px; }
.sg-ajuda-passos { margin: 0 0 10px; padding-left: 20px; font-size: 14px; line-height: 1.45; }
.sg-ajuda-passos li { margin: 4px 0; }
.sg-ajuda-linha-btn { display: flex; gap: 8px; flex-wrap: wrap; }

.sg-video-wrap { position: fixed; inset: 0; z-index: 2500; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(0,10,30,.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity .2s; }
.sg-video-wrap.is-open { opacity: 1; }
.sg-video-box { width: min(420px, 100%); max-height: calc(100% - 10px); display: flex; flex-direction: column; gap: 8px; }
.sg-video-top { display: flex; justify-content: space-between; align-items: center; color: #fff; font-size: 15px; gap: 10px; }
.sg-video-top .sg-btn { color: #fff; }
.sg-video-box video { width: 100%; max-height: calc(100dvh - 90px); border-radius: 22px; background: #0b1b33; object-fit: contain; }
.sg-video-erro { color: #fff; text-align: center; }

.sg-tour-spot { position: fixed; z-index: 2600; border-radius: 18px; pointer-events: none; opacity: 0;
    box-shadow: 0 0 0 4px rgba(78,181,231,.9), 0 0 0 9999px rgba(0,10,30,.58); transition: all .3s cubic-bezier(.2,.9,.25,1); }
.sg-tour-spot.is-on { opacity: 1; }
.sg-tour-spot::after { content: ""; position: fixed; inset: 0; pointer-events: auto; z-index: -1; }
.sg-tour-tip { position: fixed; z-index: 2601; left: 50%; transform: translateX(-50%); width: min(360px, calc(100% - 28px)); padding: 14px 16px 12px; border-radius: 22px; opacity: 0; transition: top .3s, opacity .2s; }
.sg-tour-tip.is-on { opacity: 1; }
.sg-tour-txt { margin: 0 0 10px; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--label); }
.sg-tour-pe { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sg-em-tour .sg-ajuda-btn { opacity: 0; pointer-events: none; }
