/* ─── LIGHT MODE VARIABLES ──────────────────────────────────────────────────── */
:root {
  --blue:             #0D1B3D;
  --green:            #16A34A;
  --green-light-bg:   #DCFCE7;
  --green-light-text: #15803D;
  --bg:               #F1F3F5;
  --text:             #111827;
  --muted:            #566074;
  --card:             #ffffff;
  --line:             #E5E7EB;
  --func-bg:          #F3F4F6;
  --danger:           #B42318;
  --radius:           24px;
  --shadow:           0 8px 32px rgba(13, 27, 61, 0.08);
}

/* ─── DARK MODE VARIABLES ───────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --blue:             #E2EBFF;
    --green:            #4ADE80;
    --green-light-bg:   rgba(74, 222, 128, 0.10);
    --green-light-text: #4ADE80;
    --bg:               #0F1117;
    --text:             #F0F6FC;
    --muted:            #7A8599;
    --card:             #1A1F2E;
    --line:             #2A3145;
    --func-bg:          #252D3D;
    --danger:           #F87171;
    --shadow:           0 8px 32px rgba(0, 0, 0, 0.50);
  }
}

/* ─── RESET ─────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  display: flex;
  justify-content: center;
}

/* ─── APP SHELL ─────────────────────────────────────────────────────────────── */
.app {
  width: 100%;
  max-width: 430px;
  min-height: auto;
  background: var(--card);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ─── TOPBAR ────────────────────────────────────────────────────────────────── */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 18px 20px 10px;
}

.brand-text {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  max-width: calc(100% - 110px);
  padding: 5px 9px;
  margin-left: -9px;
  border-radius: 10px;
  border: 0.5px solid transparent;
  transition: border-color 0.2s, background 0.15s;
}

.brand-text:hover {
  border-color: rgba(13, 27, 61, 0.2);
  background: rgba(13, 27, 61, 0.05);
}

.brand-line-main {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #0D1B3D;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-line-sub {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.1px;
  color: #0D1B3D;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-tela {
  color: #16A34A;
}

.brand-pix {
  color: #16A34A;
}

.seu-pix-btn {
  border: 0.5px solid rgba(13, 27, 61, 0.25);
  background: transparent;
  color: var(--blue);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  cursor: pointer;
  padding: 7px 13px;
  border-radius: 10px;
  line-height: 1;
  transition: border-color 0.2s, background 0.15s;
  display: flex;
  align-items: center;
}

.seu-pix-btn:hover {
  border-color: #16A34A;
  background: rgba(22, 163, 74, 0.07);
}

.seu-pix-btn:active {
  transform: scale(0.96);
}

.pix-green {
  color: #16A34A;
}

@media (prefers-color-scheme: dark) {
  .brand-text:hover { border-color: rgba(226, 235, 255, 0.2); background: rgba(226, 235, 255, 0.06); }
  .brand-line-main { color: #E2EBFF; }
  .brand-line-sub { color: #E2EBFF; }
  .brand-tela { color: #4ADE80; }
  .brand-pix { color: #4ADE80; }
  .seu-pix-btn { color: #E2EBFF; border-color: rgba(226, 235, 255, 0.2); }
  .seu-pix-btn:hover { border-color: #4ADE80; background: rgba(74, 222, 128, 0.10); }
  .pix-green { color: #4ADE80; }
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  border-radius: 12px;
  padding: 8px;
  line-height: 1;
  cursor: pointer;
}

.gear-btn {
  font-size: 22px;
}

.topbar-right {
  position: absolute;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.version-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--func-bg);
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

/* ─── MAIN ──────────────────────────────────────────────────────────────────── */
.main {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

/* ─── VIEWS ─────────────────────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: flex; flex-direction: column; }

/* ─── CALC SECTION ──────────────────────────────────────────────────────────── */
.calc-section {
  padding: 12px 22px 10px;
}

.calc-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.calc-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 6px;
}

.calc-expr {
  font-size: 20px;
  font-weight: 600;
  color: var(--blue);
  min-height: 24px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
}

.expr-op {
  color: var(--blue);
  margin: 0 4px;
}

.expr-pct {
  color: var(--green);
  font-weight: 700;
}

.cursor {
  display: inline-block;
  color: var(--green);
  animation: blink 1s step-end infinite;
  font-weight: 300;
  margin-left: 1px;
  min-width: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.amount-display {
  font-size: 64px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -3px;
  color: var(--blue);
  margin: 8px 0 4px;
}

.amount-display small {
  font-size: 24px;
  letter-spacing: 0;
  margin-right: 4px;
  color: var(--muted);
  font-weight: 400;
}

.amount-display.flash-error {
  animation: flash-zero 0.6s ease-in-out;
}

@keyframes flash-zero {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ─── KEYPAD CARD ───────────────────────────────────────────────────────────── */
.keypad-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 12px;
  margin: 0 14px;
}

/* Operator row: %, ÷, ×, −, + */
.op-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-bottom: 7px;
}

.op-btn {
  height: 50px;
  border: none;
  border-radius: 13px;
  background: var(--green-light-bg);
  color: var(--green-light-text);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s;
  touch-action: manipulation;
}

/* Number grid: 4 columns, 4 rows explícitos */
.num-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 58px);
  gap: 7px;
}

.num-grid button {
  height: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  font-size: 22px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  transition: transform 0.08s;
  touch-action: manipulation;
}

/* Backspace button */
.func-btn {
  background: var(--func-bg) !important;
  border-color: transparent !important;
  font-size: 18px !important;
}

/* Clear (C) — ocupa linhas 2 e 3, coluna 4 */
.clear-btn {
  grid-column: 4;
  grid-row: 2 / span 2;
}

/* Zero wide — ocupa 2 colunas */
.zero-wide {
  grid-column: span 2;
}

.num-grid button:active,
.op-btn:active {
  transform: scale(0.94);
}

/* ─── PERCENT HINT ──────────────────────────────────────────────────────────── */
.percent-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 14px;
  padding: 10px 13px;
  background: var(--green-light-bg);
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.hint-icon {
  font-size: 17px;
  flex-shrink: 0;
  margin-top: 1px;
}

.percent-hint strong {
  color: var(--green);
}

.hint-example {
  color: var(--green);
  font-weight: 600;
}

/* ─── ACTIONS ───────────────────────────────────────────────────────────────── */
.home-actions {
  padding: 8px 14px 4px;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.primary,
.secondary {
  width: 100%;
  border: 0;
  border-radius: 16px;
  font-weight: 750;
  font-size: 16px;
  padding: 17px 18px;
  cursor: pointer;
  transition: transform 0.08s;
}

.primary {
  background: linear-gradient(135deg, var(--green), #10B981);
  color: white;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.25);
}

.secondary {
  background: #EEF2FF;
  color: var(--blue);
}

@media (prefers-color-scheme: dark) {
  .secondary { background: #1E2A4A; }
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  text-decoration: underline;
  font-weight: 650;
  padding: 10px;
  cursor: pointer;
}

.primary:active,
.secondary:active { transform: scale(0.98); }

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── FOOTER ────────────────────────────────────────────────────────────────── */
.footer {
  padding: 8px 22px 20px;
  text-align: center;
}

.donate-link {
  display: block;
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 700;
  font-size: 15px;
  margin: 0 auto 4px;
  padding: 8px;
  border-radius: 14px;
  cursor: pointer;
}

.donate-link .heart {
  transition: color 0.2s;
}

.donate-link:hover .heart {
  color: #E24B4A;
}

.footer-links,
.copyright {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-links {
  margin-top: 2px;
}

.footer-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  padding: 3px 2px;
  cursor: pointer;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--green);
  outline: none;
}

.copyright {
  margin-top: 5px;
  opacity: 0.78;
}

.copyright-sep {
  color: var(--muted);
}

.instagram-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.instagram-link:hover {
  color: var(--text);
}

/* ─── HERO (QR / DONATE VIEWS) ──────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin: 14px 22px 18px;
}

.hero h1 {
  font-size: 25px;
  margin: 0 0 8px;
  color: var(--blue);
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

/* ─── CARD (DONATE VIEW) ────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 0 22px;
}

/* ─── QR CODE ───────────────────────────────────────────────────────────────── */
.qr-wrap {
  display: grid;
  place-items: center;
  margin: 16px 0;
}

.qr-box {
  background: white;
  border: 3px solid var(--green);
  border-radius: 14px;
  padding: 14px;
  width: min(100% - 44px, 290px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.qr-box canvas, .qr-box img {
  width: 100% !important;
  height: 100% !important;
}

.qr-amount-display {
  font-size: 58px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -3px;
  color: var(--blue);
  text-align: center;
  margin: 8px 0 18px;
}

.qr-amount-display small {
  font-size: 24px;
  margin-right: 4px;
}

/* ─── COPY CODE ─────────────────────────────────────────────────────────────── */
.copy-code {
  width: calc(100% - 44px);
  margin: 12px 22px 0;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text);
  background: var(--bg);
  resize: none;
}

/* ─── FORM FIELDS ───────────────────────────────────────────────────────────── */
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 14px;
  font-size: 16px;
  outline: none;
  background: var(--card);
  color: var(--text);
}

.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.field-inline label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
}

.field-inline input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  background: var(--card);
  color: var(--text);
  text-align: center;
}

.field-inline input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

/* ─── DONATE VALUES ─────────────────────────────────────────────────────────── */
.donate-amount-display {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -3px;
  color: var(--blue);
  text-align: center;
  margin: 8px 0 16px;
  line-height: 1.05;
}

.donate-amount-display small {
  font-size: 24px;
  letter-spacing: 0;
  margin-right: 4px;
  color: var(--muted);
  font-weight: 400;
}

.donate-values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 22px;
  margin-bottom: 16px;
}

.donate-val-btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s;
}

.donate-val-btn.active {
  border: 2px solid var(--green);
  background: var(--green-light-bg);
  color: var(--green-light-text);
}

.donate-val-btn:active { transform: scale(0.96); }

.error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
}

/* ─── KEY TYPE TAG ──────────────────────────────────────────────────────────── */
.key-type-tag {
  font-size: 13px;
  font-weight: 600;
  min-height: 20px;
  margin-bottom: 10px;
}

.key-type-tag.valid   { color: var(--green); }
.key-type-tag.invalid { color: var(--danger); }

/* ─── SETTINGS SHEET ────────────────────────────────────────────────────────── */
.sheet {
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 61, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  z-index: 5;
}

.sheet.open { display: flex; }

.sheet-panel {
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border-radius: 28px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.sheet-head h2 {
  font-size: 20px;
  margin: 0;
  color: var(--blue);
}

.close-btn {
  border: 0;
  background: var(--func-bg);
  color: var(--text);
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

/* ─── OFFLINE BANNER ────────────────────────────────────────────────────────── */
.offline {
  display: none;
  margin: 6px 14px 0;
  background: #FFF7ED;
  color: #9A3412;
  border: 1px solid #FED7AA;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
}

.offline.show { display: block; }

@media (prefers-color-scheme: dark) {
  .offline {
    background: #2D1708;
    color: #FDBA74;
    border-color: #7C2D12;
  }
}

/* ─── DARK MODE OVERRIDES ───────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .op-btn {
    background: rgba(74, 222, 128, 0.10);
    border: 1px solid rgba(74, 222, 128, 0.20);
  }

  .keypad-card {
    background: #1A1F2E;
    border-color: #2A3145;
  }

  .num-grid button {
    background: #212636;
    border-color: #2A3145;
  }

  .percent-hint {
    background: rgba(74, 222, 128, 0.07);
    border: 1px solid rgba(74, 222, 128, 0.15);
  }
}

/* ─── QR VIEW SPACING FIX ───────────────────────────────────────────────────── */
#qrView {
  padding: 0 0 16px;
  justify-content: flex-start;
  flex: 0;
}

#qrView .actions {
  margin-top: 8px;
  padding: 0 14px;
}

#qrView .hero {
  margin: 10px 22px 4px;
}

#qrView .qr-wrap {
  margin: 8px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS ICON BUTTON (v2.9)
   ═══════════════════════════════════════════════════════════════════════════ */

.settings-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  background: rgba(13, 27, 61, 0.07);
  border: 1px solid rgba(13, 27, 61, 0.15);
  border-radius: 8px;
  color: #0D1B3D;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 16px;
}

.settings-icon-btn:hover {
  background: rgba(13, 27, 61, 0.12);
  border-color: rgba(13, 27, 61, 0.25);
}

.settings-icon-btn:active {
  transform: scale(0.96);
}

.settings-icon-btn svg {
  display: block;
}

@media (prefers-color-scheme: dark) {
  .settings-icon-btn { 
    background: rgba(255, 255, 255, 0.05); 
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
  }
  .settings-icon-btn:hover { 
    background: rgba(255, 255, 255, 0.1); 
    border-color: rgba(255, 255, 255, 0.15); 
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRIVACY LINK (v2.9)
   ═══════════════════════════════════════════════════════════════════════════ */

.privacy-card-chevron {
  margin-left: auto;
  flex-shrink: 0;
}

.privacy-link {
  background: none;
  border: none;
  color: #4B5563;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.15s ease;
}

.privacy-link:hover {
  color: #0F6E56;
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .privacy-link { color: rgba(255, 255, 255, 0.5); }
  .privacy-link:hover { color: rgba(255, 255, 255, 0.8); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRIVACY SHEET CONTENT (v2.9)
   ═══════════════════════════════════════════════════════════════════════════ */

.privacy-summary {
  background: #E6F1FB;
  border-left: 3px solid #378ADD;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #0C447C;
}

@media (prefers-color-scheme: dark) {
  .privacy-summary {
    background: rgba(55, 138, 221, 0.1);
    border-left-color: #5DCAA5;
    color: #9FE1CB;
  }
}

.privacy-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.privacy-card {
  background: #F9FAFB;
  border: 0.5px solid #D1D5DB;
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.privacy-card:hover {
  background: #F3F4F6;
  border-color: #9CA3AF;
}

.privacy-card:active {
  transform: scale(0.98);
}

.privacy-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.privacy-card-header svg:first-child {
  flex-shrink: 0;
  color: #378ADD;
}

.privacy-card-header span {
  font-weight: 500;
  font-size: 15px;
  color: #111827;
}

.privacy-card-header svg:last-child {
  flex-shrink: 0;
  color: #9CA3AF;
}

.privacy-card p {
  margin: 0 0 0 32px;
  font-size: 13px;
  color: #6B7280;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  .privacy-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
  }
  .privacy-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
  }
  .privacy-card-header svg:first-child {
    color: #5DCAA5;
  }
  .privacy-card-header span {
    color: rgba(255, 255, 255, 0.9);
  }
  .privacy-card-header svg:last-child {
    color: rgba(255, 255, 255, 0.4);
  }
  .privacy-card p {
    color: rgba(255, 255, 255, 0.6);
  }
}

.privacy-footer {
  margin: 20px 0 0;
  font-size: 12px;
  color: #9CA3AF;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .privacy-footer {
    color: rgba(255, 255, 255, 0.4);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRIVACY CONTENT (v2.9)
   ═══════════════════════════════════════════════════════════════════════════ */

.privacy-content {
  padding: 20px;
  line-height: 1.7;
  color: #374151;
}

.privacy-content h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 24px 0 12px 0;
  color: #111827;
}

.privacy-content h3:first-child {
  margin-top: 0;
}

.privacy-content p {
  margin: 0 0 16px 0;
  font-size: 14px;
}

.privacy-content ul {
  margin: 12px 0 16px 0;
  padding-left: 24px;
}

.privacy-content li {
  margin-bottom: 8px;
  font-size: 14px;
}

.privacy-content strong {
  font-weight: 500;
  color: #111827;
}

.privacy-content a {
  color: #378ADD;
  text-decoration: none;
}

.privacy-content a:hover {
  text-decoration: underline;
}

.privacy-date {
  margin-top: 32px !important;
  padding-top: 20px;
  border-top: 0.5px solid #E5E7EB;
  font-size: 13px;
  color: #6B7280;
}

@media (prefers-color-scheme: dark) {
  .privacy-content {
    color: rgba(255, 255, 255, 0.7);
  }
  .privacy-content h3 {
    color: rgba(255, 255, 255, 0.9);
  }
  .privacy-content strong {
    color: rgba(255, 255, 255, 0.9);
  }
  .privacy-content a {
    color: #5DCAA5;
  }
  .privacy-date {
    border-top-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BACK BUTTON (v2.9)
   ═══════════════════════════════════════════════════════════════════════════ */

.back-btn {
  background: none;
  border: none;
  color: #378ADD;
  font-size: 24px;
  cursor: pointer;
  padding: 0 8px 0 0;
  line-height: 1;
  transition: color 0.15s ease;
  font-weight: 300;
}

.back-btn:hover {
  color: #0F6E56;
}

.back-btn:active {
  transform: scale(0.95);
}

@media (prefers-color-scheme: dark) {
  .back-btn { color: #5DCAA5; }
  .back-btn:hover { color: #9FE1CB; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DETAIL SHEETS - FIXED HEADER & SCROLLABLE CONTENT (v3.0)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Sheet panel com estrutura para header fixo */
#privacyPolicySheet .sheet-panel,
#termsSheet .sheet-panel {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

/* Header fixo sempre visível */
#privacyPolicySheet .sheet-head,
#termsSheet .sheet-head {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 10;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  #privacyPolicySheet .sheet-head,
  #termsSheet .sheet-head {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
}

/* Container de conteúdo com scroll */
#privacyPolicySheet .privacy-content,
#termsSheet .privacy-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-top: 14px;
}

/* Texto introdutório */
.terms-intro {
  font-size: 14px;
  line-height: 1.6;
  color: #6B7280;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #E5E7EB;
}

@media (prefers-color-scheme: dark) {
  .terms-intro {
    color: rgba(255, 255, 255, 0.6);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
}

/* ─── ACCORDION SECTIONS ─────────────────────────────────────────────────── */

.accordion-section {
  margin-bottom: 8px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  .accordion-section {
    border-color: rgba(255, 255, 255, 0.1);
  }
}

.accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background: rgba(0, 0, 0, 0.02);
}

.accordion-header:active {
  background: rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  .accordion-header {
    color: rgba(255, 255, 255, 0.9);
  }
  .accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
  }
  .accordion-header:active {
    background: rgba(255, 255, 255, 0.08);
  }
}

.accordion-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  color: #6B7280;
  font-size: 18px;
}

.accordion-section.open .accordion-icon {
  transform: rotate(180deg);
}

@media (prefers-color-scheme: dark) {
  .accordion-icon {
    color: rgba(255, 255, 255, 0.5);
  }
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-section.open .accordion-content {
  max-height: 2000px;
}

.accordion-body {
  padding: 0 16px 16px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
}

@media (prefers-color-scheme: dark) {
  .accordion-body {
    color: rgba(255, 255, 255, 0.7);
  }
}

.accordion-body p {
  margin: 0 0 12px 0;
}

.accordion-body p:last-child {
  margin-bottom: 0;
}

.accordion-body ul {
  margin: 8px 0 12px 0;
  padding-left: 20px;
}

.accordion-body li {
  margin-bottom: 6px;
}

.accordion-body strong {
  font-weight: 500;
  color: #111827;
}

@media (prefers-color-scheme: dark) {
  .accordion-body strong {
    color: rgba(255, 255, 255, 0.9);
  }
}

.accordion-body a {
  color: #378ADD;
  text-decoration: none;
}

.accordion-body a:hover {
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .accordion-body a {
    color: #5DCAA5;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ONBOARDING SHEET (v3.2)
   ═══════════════════════════════════════════════════════════════════════════ */

#onboardingSheet { background: rgba(13, 27, 61, 0.85); }

#onboardingSheet .sheet-panel {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.onboarding-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.onboarding-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #E1F5EE;
  color: #0F6E56;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

@media (prefers-color-scheme: dark) {
  .onboarding-pill {
    background: rgba(29, 158, 117, 0.15);
    color: #5DCAA5;
  }
}

.onboarding-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

/* ─── Animação ───────────────────────────────────────────────────────────── */

.onboarding-anim {
  flex-shrink: 0;
  width: 96px;
  background: var(--bg);
  border: 0.5px solid var(--border, #E5E7EB);
  border-radius: 14px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  align-self: flex-start;
}

@media (prefers-color-scheme: dark) {
  .onboarding-anim {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
  }
}

.onboarding-anim-label {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

.onboarding-anim-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--blue);
  text-align: center;
  min-height: 20px;
  font-variant-numeric: tabular-nums;
}

.onboarding-anim-arrow {
  font-size: 14px;
  color: #1D9E75;
}

.onboarding-qr {
  background: white;
  border-radius: 8px;
  padding: 5px;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onboarding-qr.show {
  opacity: 1;
  transform: scale(1);
}

/* ─── Passos ─────────────────────────────────────────────────────────────── */

.onboarding-steps {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 0;
  padding-left: 8px;
}

.onboarding-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.35;
  margin-bottom: 6px;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg, #374151);
}

.onboarding-step-n {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #E1F5EE;
  color: #0F6E56;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboarding-step--highlight .onboarding-step-n {
  background: #0D1B3D;
  color: white;
}

.onboarding-step--highlight span {
  font-weight: 600;
  color: var(--blue);
}

@media (prefers-color-scheme: dark) {
  .onboarding-step-n {
    background: rgba(29, 158, 117, 0.2);
    color: #5DCAA5;
  }
  .onboarding-step--highlight .onboarding-step-n {
    background: rgba(255,255,255,0.15);
    color: white;
  }
  .onboarding-step--highlight span {
    color: rgba(255,255,255,0.9);
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   HISTORY & BACKUP — v4.0
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── UTILITY ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── HISTORY HEADER BUTTON ────────────────────────────────────────────── */
.history-header-btn {
  background: var(--func-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s;
}
.history-header-btn:hover { opacity: 0.8; }

.history-btn-cta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.history-btn-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.history-btn-period { font-size: 10px; color: var(--muted); line-height: 1.2; }
.history-btn-total  { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.2; }

/* ─── CONVERSION SHEET ──────────────────────────────────────────────────── */
.conversion-body {
  display: flex;
  gap: 14px;
  padding: 4px 20px 24px;
  align-items: flex-start;
}
.conversion-preview {
  flex-shrink: 0;
  min-width: 140px;
  background: var(--func-bg);
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 8px 10px;
}
.conv-prev-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.conv-prev-row:last-child { border-bottom: none; }
.conv-prev-day { font-size: 9px;  color: var(--muted); white-space: nowrap; }
.conv-prev-val { font-size: 10px; font-weight: 500; color: var(--text); white-space: nowrap; }

.conversion-text     { flex: 1; }
.conversion-title    { font-size: 15px; font-weight: 500; color: var(--text); margin: 0 0 10px; line-height: 1.3; }
.conversion-items    { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.conversion-items li { font-size: 12px; color: var(--muted); padding-left: 14px; position: relative; }
.conversion-items li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-size: 11px; }

/* ─── PIN SHEET ─────────────────────────────────────────────────────────── */
.pin-sheet-body {
  padding: 4px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pin-subtitle { font-size: 13px; color: var(--muted); text-align: center; margin: 0 0 20px; }

.pin-dots    { display: flex; gap: 14px; justify-content: center; margin: 0 0 18px; }
.pin-dot     { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--muted); background: transparent; transition: background 0.15s, border-color 0.15s; }
.pin-dot.filled { background: var(--blue); border-color: var(--blue); }
.pin-dot.error  { background: var(--danger); border-color: var(--danger); }

.pin-warning { font-size: 11px; color: var(--muted); background: var(--func-bg); border-radius: 8px; padding: 10px 12px; margin: 0 0 18px; line-height: 1.5; text-align: center; width: 100%; box-sizing: border-box; }
.pin-error   { font-size: 12px; color: var(--danger); text-align: center; min-height: 18px; margin: -12px 0 8px; }

.pin-keypad  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.pin-key     { background: var(--func-bg); border: none; border-radius: 10px; height: 52px; font-size: 22px; font-weight: 500; color: var(--text); cursor: pointer; transition: opacity 0.1s, transform 0.1s; }
.pin-key:active     { transform: scale(0.95); opacity: 0.7; }
.pin-key-empty      { background: none; cursor: default; }
.pin-key-back       { font-size: 20px; color: var(--muted); }
.pin-key-empty:active { transform: none; opacity: 1; }

/* ─── PIN SUCCESS SHEET ─────────────────────────────────────────────────── */
.pin-success-body  { padding: 20px 20px 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pin-success-icon  { width: 56px; height: 56px; border-radius: 50%; background: var(--green-light-bg); display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--green); }
.pin-success-title { font-size: 18px; font-weight: 500; color: var(--text); margin: 0; }

.pin-reminder       { background: var(--func-bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; width: 100%; text-align: center; box-sizing: border-box; }
.pin-reminder-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 6px; }
.pin-reminder-val   { font-size: 32px; font-weight: 500; color: var(--green); letter-spacing: 10px; margin: 0; }
.pin-success-sub    { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6; margin: 0; }

/* ─── HISTORY SHEET ─────────────────────────────────────────────────────── */
.history-sheet-panel { display: flex; flex-direction: column; max-height: 85vh; }

.history-top-row    { display: flex; align-items: center; gap: 8px; padding: 8px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.history-date-btn   { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); background: var(--func-bg); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; cursor: pointer; white-space: nowrap; transition: opacity 0.15s; }
.history-date-btn:hover { opacity: 0.8; }
.history-top-sep    { width: 1px; height: 20px; background: var(--line); flex-shrink: 0; }
.history-top-stat   { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 1px; }
.history-stat-label { font-size: 10px; color: var(--muted); }
.history-stat-val   { font-size: 13px; font-weight: 500; color: var(--text); }

.history-list-header { display: flex; align-items: center; padding: 6px 20px; border-bottom: 1px solid var(--line); gap: 10px; flex-shrink: 0; }
.history-col-day     { width: 66px; font-size: 11px; color: var(--muted); flex-shrink: 0; }
.history-col-time    { width: 38px; font-size: 11px; color: var(--muted); flex-shrink: 0; }
.history-col-val     { flex: 1; font-size: 11px; color: var(--muted); text-align: right; }

.history-cb { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--muted); background: transparent; flex-shrink: 0; cursor: pointer; position: relative; transition: background 0.15s, border-color 0.15s; }
.history-cb.checked { background: var(--blue); border-color: var(--blue); }
.history-cb.checked::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 8' fill='none'%3E%3Cpath d='M1 4L3.5 6.5L9 1' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/10px no-repeat; }

.history-tx-scroll  { overflow-y: auto; flex: 1; min-height: 80px; }
.history-tx-item    { display: flex; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--line); gap: 10px; cursor: pointer; transition: background 0.1s; }
.history-tx-item:last-child { border-bottom: none; }
.history-tx-item.selected   { background: var(--func-bg); }
.history-tx-day  { width: 66px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.history-tx-time { width: 38px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.history-tx-val  { flex: 1; font-size: 14px; font-weight: 500; color: var(--text); text-align: right; }

.history-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 20px; margin: 0; }

.history-action-bar        { display: flex; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); flex-shrink: 0; }
.history-action-bar.hidden { display: none; }

.danger-btn       { flex: 1; padding: 11px; border: 1.5px solid var(--danger); border-radius: 10px; background: transparent; color: var(--danger); font-size: 14px; font-weight: 500; cursor: pointer; transition: opacity 0.15s; }
.danger-btn:hover { opacity: 0.8; }

/* ─── HISTORY CALENDAR SHEET ────────────────────────────────────────────── */
.hcal-shortcuts { display: flex; gap: 8px; padding: 0 20px 12px; border-bottom: 1px solid var(--line); }
.hcal-sh-btn    { flex: 1; font-size: 12px; padding: 7px 6px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; text-align: center; transition: background 0.15s, color 0.15s; }
.hcal-sh-btn.active { background: var(--func-bg); color: var(--text); border-color: var(--blue); font-weight: 500; }

.hcal-nav     { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px 4px; }
.hcal-month   { font-size: 14px; font-weight: 500; color: var(--text); }
.hcal-nav-btn { font-size: 22px; color: var(--muted); background: none; border: none; cursor: pointer; padding: 0 4px; line-height: 1; }

.hcal-grid    { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 12px 14px; }
.hcal-dn      { font-size: 10px; color: var(--muted); text-align: center; padding: 4px 0; }
.hcal-day     { font-size: 12px; color: var(--text); text-align: center; padding: 6px 2px; border-radius: 50%; cursor: pointer; user-select: none; }
.hcal-empty   { visibility: hidden; cursor: default; }
.hcal-muted   { color: var(--muted); cursor: default; opacity: 0.4; }
.hcal-today   { font-weight: 500; }
.hcal-single,
.hcal-start,
.hcal-end     { background: var(--blue); color: var(--card); font-weight: 500; }
.hcal-in-range           { background: var(--func-bg); color: var(--text); border-radius: 0; }
.hcal-start.hcal-in-range { border-radius: 50% 0 0 50%; }
.hcal-end.hcal-in-range   { border-radius: 0 50% 50% 0; }

/* ─── HISTORY ALERT ─────────────────────────────────────────────────────── */
.history-alert-panel { padding: 28px 20px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.history-alert-title { font-size: 17px; font-weight: 500; color: var(--text); margin: 0; }
.history-alert-sub   { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 8px; }


/* ─── GUIA PAGATELA ───────────────────────────────────────────────────────── */
.guide-body { min-height: 100vh; background: var(--bg); color: var(--text); }
    .guide-shell { width: min(100%, 760px); margin: 0 auto; padding: 18px 18px 28px; }
    .guide-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
    .guide-logo { color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -0.03em; }
    .guide-logo span { color: var(--green); }
    .guide-back { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; }
    .guide-hero { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 28px 22px; box-shadow: var(--shadow); }
    .guide-kicker { color: var(--green); font-weight: 800; font-size: 13px; margin-bottom: 8px; }
    .guide-hero h1 { font-size: clamp(34px, 10vw, 56px); line-height: .95; letter-spacing: -0.07em; margin: 0 0 14px; }
    .guide-hero p { color: var(--muted); font-size: 17px; line-height: 1.45; margin: 0 0 20px; }
    .guide-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 16px; background: var(--green); color: white; text-decoration: none; font-weight: 800; box-shadow: 0 12px 30px rgba(31, 178, 90, .22); }
    .guide-section { margin-top: 26px; }
    .guide-section h2 { font-size: 24px; line-height: 1.1; letter-spacing: -0.045em; margin: 0 0 12px; }
    .guide-section-sub { color: var(--muted); margin: -4px 0 14px; line-height: 1.45; }
    .steps { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .step-card, .feature-card, .faq-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
    .step-num { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 999px; background: rgba(31, 178, 90, .12); color: var(--green); font-weight: 900; margin-bottom: 8px; }
    .step-card strong, .feature-card strong { display: block; margin-bottom: 4px; }
    .step-card p, .feature-card p, .faq-card p { margin: 0; color: var(--muted); line-height: 1.42; font-size: 14px; }
    .story-list { display: flex; flex-direction: column; gap: 12px; }
    .story-card { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; text-decoration: none; color: var(--text); box-shadow: 0 10px 28px rgba(12, 20, 32, .06); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
    .story-card:hover { transform: translateY(-1px); border-color: rgba(14, 165, 91, .35); box-shadow: 0 14px 34px rgba(12, 20, 32, .09); }
    .story-emoji { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: rgba(31, 178, 90, .12); font-size: 22px; }
    .story-copy { min-width: 0; }
    .story-copy h3 { margin: 0 0 5px; font-size: 19px; letter-spacing: -0.035em; }
    .story-copy strong { display: block; margin-bottom: 5px; color: var(--text); font-size: 14px; }
    .story-copy p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.45; }
    .story-link { color: var(--green); font-weight: 800; font-size: 14px; }
    .features { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .feature-icon { font-size: 20px; margin-bottom: 6px; }
    .faq-list { display: grid; gap: 10px; }
    .faq-card h3 { margin: 0 0 6px; font-size: 16px; }
    .guide-footer { margin-top: 30px; padding: 20px 0 4px; text-align: center; color: var(--muted); font-size: 12px; }
    .guide-footer a { color: var(--muted); text-decoration: none; font-weight: 700; }
    @media (min-width: 620px) {
      .steps, .features { grid-template-columns: repeat(3, 1fr); }
      .guide-hero { padding: 36px 34px; }
    }

/* ─── GUIA: PÁGINAS DE CASO DE USO ──────────────────────────────────────── */
.case-hero { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 24px 20px; box-shadow: var(--shadow); }
.case-kicker { color: var(--green); font-weight: 800; font-size: 13px; margin-bottom: 8px; }
.case-hero h1 { font-size: clamp(32px, 9vw, 52px); line-height: .98; letter-spacing: -0.065em; margin: 0 0 12px; }
.case-lead { color: var(--muted); font-size: 17px; line-height: 1.48; margin: 0 0 18px; }
.case-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.case-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border-radius: 16px; background: var(--func-bg); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 800; }
.case-storyboard { margin-top: 18px; overflow: hidden; border-radius: 24px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 10px 28px rgba(12, 20, 32, .06); }
.case-storyboard img { display: block; width: 100%; height: auto; }
.case-content { display: grid; gap: 12px; margin-top: 20px; }
.case-block { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
.case-block h2, .case-block h3 { margin: 0 0 8px; letter-spacing: -0.035em; }
.case-block h2 { font-size: 22px; }
.case-block h3 { font-size: 18px; }
.case-block p { margin: 0; color: var(--muted); line-height: 1.5; }
.case-list { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.55; }
.case-list li + li { margin-top: 6px; }
.case-next { display: grid; gap: 10px; margin-top: 20px; }
.case-next-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; color: var(--text); text-decoration: none; }
.case-next-card strong { display: block; margin-bottom: 4px; }
.case-next-card span { color: var(--green); font-weight: 800; font-size: 14px; }
@media (min-width: 620px) {
  .case-hero { padding: 34px 32px; }
  .case-content { grid-template-columns: 1fr 1fr; }
  .case-block.wide { grid-column: 1 / -1; }
  .case-next { grid-template-columns: repeat(3, 1fr); }
}

/* v5.5.0 — Página "Instalar como app": passos e diagramas */
.install-section { margin-top: 22px; }
.install-h { font-size: 22px; letter-spacing: -0.035em; margin: 0 0 6px; color: var(--text); }
.install-note { color: var(--muted); line-height: 1.5; margin: 0 0 14px; font-size: 14px; }
.install-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
}
.install-text { display: flex; gap: 12px; align-items: flex-start; }
.install-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-text h3 { margin: 2px 0 4px; font-size: 16px; letter-spacing: -0.02em; color: var(--text); }
.install-text p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 14px; }
.install-fig { margin: 0; text-align: center; }
.install-fig svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  color: var(--muted);
}
.install-fig figcaption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.install-tip { margin: 12px 0 0; color: var(--muted); line-height: 1.5; font-size: 14px; }
@media (min-width: 620px) {
  .install-step { flex-direction: row; align-items: center; justify-content: space-between; }
  .install-text { flex: 1; }
  .install-fig { flex-shrink: 0; width: 220px; }
}

/* v5.1.1 — mensagem de erro do QR sem CSS inline (compatível com CSP) */
.qr-error {
  text-align: center;
  font-size: 13px;
  color: #b42318;
}


/* ── v5.7.0 — Consentimento no Onboarding ──────────────────────────────── */
.onboarding-consent {
  padding: 2px 0 10px;
}
.consent-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.4;
}
.consent-check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--green);
  cursor: pointer;
  margin: 0;
}
.consent-terms-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--green);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
  line-height: inherit;
}