/* ==========================================================================
   Bíblia Explicada — estilos
   Sóbrio, escuro opaco por padrão (tema claro opcional), sem brilhos vibrantes.
   Mobile first: o básico é o celular; telas maiores ganham ajustes no fim.
   ========================================================================== */

/* ---------- Fontes (arquivos locais, sem depender do Google) ---------- */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('../fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('../fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-weight: 400; font-display: swap; src: url('../fonts/lora-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-weight: 400; font-style: italic; font-display: swap; src: url('../fonts/lora-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-weight: 600; font-display: swap; src: url('../fonts/lora-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-display: swap; src: url('../fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-display: swap; src: url('../fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); }

/* ---------- Cores (mesmos tons do app original) ---------- */
html.dark,
body.dark {
    --background: 0 0% 8%;
    --foreground: 36 18% 88%;
    --card: 0 0% 11%;
    --popover: 0 0% 12%;
    --primary: 36 22% 78%;
    --primary-foreground: 0 0% 10%;
    --secondary: 0 0% 16%;
    --muted: 0 0% 14%;
    --muted-foreground: 36 8% 60%;
    --accent: 36 30% 55%;
    --accent-foreground: 0 0% 8%;
    --destructive: 0 60% 45%;
    --success: 140 30% 45%;
    --warning: 38 80% 50%;
    --border: 0 0% 20%;
    --input: 0 0% 18%;
    --shadow: 0 0% 0% / 0.45;
    color-scheme: dark;
}

:root,
.light {
    --background: 40 25% 97%;
    --foreground: 30 15% 14%;
    --card: 0 0% 100%;
    --popover: 0 0% 100%;
    --primary: 30 18% 22%;
    --primary-foreground: 40 25% 97%;
    --secondary: 36 18% 92%;
    --muted: 36 16% 90%;
    --muted-foreground: 30 8% 40%;
    --accent: 32 55% 42%;
    --accent-foreground: 40 25% 98%;
    --destructive: 0 70% 45%;
    --success: 140 40% 35%;
    --warning: 38 85% 42%;
    --border: 30 12% 84%;
    --input: 40 30% 99%;
    --shadow: 30 20% 20% / 0.15;
    color-scheme: light;
}

:root {
    --paper-sepia-bg: 36 38% 90%;
    --paper-sepia-fg: 28 30% 18%;
    --paper-cream-bg: 40 22% 95%;
    --paper-cream-fg: 0 0% 12%;
    --paper-charcoal-bg: 30 6% 14%;
    --paper-charcoal-fg: 36 18% 86%;
    --radius: 0.625rem;
    --sidebar-width: 15rem;
    --bottom-nav-height: 4.25rem;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid hsl(var(--accent)); outline-offset: 2px; border-radius: 4px; }

/* Barras de rolagem fininhas e discretas em todo o app */
* { scrollbar-width: thin; scrollbar-color: hsl(var(--muted-foreground) / 0.35) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(var(--muted-foreground) / 0.35); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground) / 0.55); }

/* ---------- Ícones (sprite SVG) ---------- */
.icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}
.icon.filled { fill: currentColor; }
.icon.inline { width: 0.95em; height: 0.95em; vertical-align: -0.12em; color: hsl(var(--accent)); }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Utilitários de texto ---------- */
.muted { color: hsl(var(--muted-foreground)); }
.faint { opacity: 0.6; }
.accent { color: hsl(var(--accent)); }
.strong { font-weight: 600; }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.75rem; }
.italic { font-style: italic; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tabular { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.pre-wrap { white-space: pre-wrap; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp-2, .clamp-3, .clamp-4 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }
.clamp-4 { -webkit-line-clamp: 4; }
.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
}
.eyebrow .icon { width: 0.85rem; height: 0.85rem; }
.eyebrow.accent { color: hsl(var(--accent)); margin-bottom: 0.1rem; }
.link { color: hsl(var(--accent)); display: inline-flex; align-items: center; gap: 0.35rem; }
.link:hover { text-decoration: underline; }
.link .icon { width: 0.9rem; height: 0.9rem; }

/* ---------- Layout utilitário ---------- */
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: 0.6rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.75rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-width: 0; }
.row-start { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.row-end { display: flex; justify-content: flex-end; }
.section-label { margin-bottom: 0.6rem; }
.button-row { display: flex; gap: 0.6rem; margin-top: 1.25rem; }

/* ---------- Botões ---------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 1.1rem;
    border-radius: var(--radius);
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.15s, background-color 0.15s, transform 0.1s;
    white-space: nowrap;
}
.button:hover { opacity: 0.92; }
.button:active { transform: scale(0.98); }
.button .icon { width: 1rem; height: 1rem; }
.button.small { min-height: 2.25rem; padding: 0 0.8rem; font-size: 0.8rem; }
.button.large { min-height: 3rem; padding: 0 1.5rem; font-size: 1rem; }
.button.block { width: 100%; }
.button.grow { flex: 1; flex-direction: row; }
.button.outline { background: transparent; color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); }
.button.outline:hover { background: hsl(var(--secondary)); }
.button.secondary { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.button.ghost { background: transparent; color: hsl(var(--foreground)); }
.button.ghost:hover { background: hsl(var(--secondary)); }
.button.danger { background: hsl(var(--destructive)); color: #fff; }
.button.icon-only { width: 2.75rem; padding: 0; flex-shrink: 0; }

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
    color: inherit;
    transition: background-color 0.15s;
}
.icon-button:hover { background: hsl(var(--foreground) / 0.08); }
.icon-button.small { width: 2rem; height: 2rem; }
.icon-button.small .icon { width: 1rem; height: 1rem; }
.icon-button.round { border-radius: 50%; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); width: 2.25rem; height: 2.25rem; }
.icon-button.round .icon { width: 1rem; height: 1rem; }

/* ---------- Cartões ---------- */
.card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
    position: relative;
}
.card.flush { padding: 0; overflow: hidden; }
.card.column { display: flex; flex-direction: column; align-items: stretch; gap: 0.35rem; }
.card-link { display: flex; align-items: center; gap: 0.8rem; transition: border-color 0.15s; overflow: hidden; }
.card-link:hover { border-color: hsl(var(--accent) / 0.5); }
.card-head-link { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1rem; transition: background-color 0.15s; }
.card-head-link:hover { background: hsl(var(--muted) / 0.5); }

.tile-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: hsl(var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tile-icon.accent-bg { background: hsl(var(--accent) / 0.15); color: hsl(var(--accent)); }

.progress-line {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    background: hsl(var(--accent) / 0.55);
    transition: width 0.3s;
}

/* ---------- Formulários (respiro generoso entre label, campo e próximo campo) ---------- */
.form { display: flex; flex-direction: column; gap: 1.35rem; }
.field { display: flex; flex-direction: column; gap: 0.55rem; }
.field label, .setting-label { font-size: 0.85rem; font-weight: 500; display: flex; align-items: center; gap: 0.45rem; }
.field label .icon, .setting-label .icon { width: 1rem; height: 1rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--input));
    font-size: 1rem; /* 16px evita o zoom automático do iPhone */
    transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 9rem; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: hsl(var(--accent)); box-shadow: 0 0 0 3px hsl(var(--accent) / 0.2); }
input[type="search"]::-webkit-search-cancel-button { display: none; }
.password-field { position: relative; }
.password-field input { padding-right: 3rem; }
.password-field .icon-button { position: absolute; right: 0.2rem; top: 50%; transform: translateY(-50%); }
.form-grid { display: grid; gap: 1.35rem; }
.form-grid .actions { justify-content: flex-end; }

input[type="range"] { width: 100%; accent-color: hsl(var(--accent)); height: 1.75rem; }

.switch {
    appearance: none;
    width: 2.75rem;
    height: 1.55rem;
    border-radius: 99px;
    background: hsl(var(--secondary));
    border: 1px solid hsl(var(--border));
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    transition: background-color 0.2s;
}
.switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: hsl(var(--foreground));
    transition: transform 0.2s;
}
.switch:checked { background: hsl(var(--accent)); border-color: hsl(var(--accent)); }
.switch:checked::after { transform: translateX(1.2rem); background: hsl(var(--accent-foreground)); }
.switch-row { display: flex; align-items: flex-start; gap: 0.8rem; cursor: pointer; }
.switch-row > .icon { margin-top: 0.15rem; width: 1rem; height: 1rem; }

/* Abas / grupos de opção */
.segmented {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0.3rem;
    padding: 0.25rem;
    border-radius: 0.75rem;
    background: hsl(var(--secondary) / 0.7);
    margin-bottom: 1rem;
}
.segmented > * {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    padding: 0 0.5rem;
    border-radius: 0.55rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
}
.segmented > * .icon { width: 1rem; height: 1rem; }
.segmented > .is-active { background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: 0 1px 3px hsl(var(--shadow)); }
.segmented.compact { display: inline-grid; border-radius: 99px; margin-bottom: 0.75rem; }
.segmented.compact > * { border-radius: 99px; padding: 0 1rem; min-height: 2.1rem; }

.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.option-grid.two { grid-template-columns: repeat(2, 1fr); }
.option-grid.seven { grid-template-columns: repeat(7, 1fr); gap: 0.35rem; }
.option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 2.6rem;
    padding: 0.6rem 0.4rem;
    border-radius: 0.5rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--secondary) / 0.4);
    font-size: 0.9rem;
}
.option.row { flex-direction: row; gap: 0.45rem; }
.option.row .icon { width: 1rem; height: 1rem; }
.option small { font-family: 'Inter', sans-serif; font-size: 0.65rem; opacity: 0.7; }
.option.small { font-size: 0.75rem; padding: 0.5rem 0.1rem; }
.option:hover { border-color: hsl(var(--accent) / 0.5); }
.option.is-active { border-color: hsl(var(--accent)); background: hsl(var(--accent) / 0.12); color: hsl(var(--accent)); }
.option.paper-sepia.is-active, .option.paper-cream.is-active, .option.paper-charcoal.is-active { color: inherit; box-shadow: 0 0 0 2px hsl(var(--accent)); }

/* Alertas */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    border: 1px solid;
    line-height: 1.45;
}
.alert .icon { width: 1rem; height: 1rem; margin-top: 0.1rem; }
.alert.error { border-color: hsl(var(--destructive) / 0.4); background: hsl(var(--destructive) / 0.08); color: hsl(var(--destructive)); }
.light .alert.error { color: hsl(0 70% 38%); }
.alert.success { border-color: hsl(var(--success) / 0.4); background: hsl(var(--success) / 0.08); }
.alert.warning { border-color: hsl(var(--warning) / 0.35); background: hsl(var(--warning) / 0.06); color: hsl(var(--muted-foreground)); font-size: 0.75rem; }
.alert.warning .icon { color: hsl(var(--warning)); }

/* ==========================================================================
   Moldura do app (celular: barra inferior / computador: menu lateral)
   ========================================================================== */
.sidebar { display: none; }

.app-main { min-height: 100vh; padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom)); }

.page-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: calc(0.75rem + var(--safe-top)) 1.25rem 0.75rem;
    background: hsl(var(--background) / 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid hsl(var(--border));
}
.page-header .icon-button { margin-left: -0.5rem; }
.page-title { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.help-fab {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    animation: help-pulse 2.6s ease-out infinite;
    flex-shrink: 0;
}
.help-fab .icon { width: 1.25rem; height: 1.25rem; }
@keyframes help-pulse {
    0% { box-shadow: 0 0 0 0 hsl(var(--accent) / 0.55); }
    70% { box-shadow: 0 0 0 12px hsl(var(--accent) / 0); }
    100% { box-shadow: 0 0 0 0 hsl(var(--accent) / 0); }
}

.page-content { padding: 1rem 1.25rem 2rem; max-width: 60rem; margin: 0 auto; }

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: hsl(var(--card));
    border-top: 1px solid hsl(var(--border));
    padding-bottom: var(--safe-bottom);
}
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.7rem 0.2rem;
    font-size: 0.7rem;
    color: hsl(var(--muted-foreground));
    min-width: 0;
}
.bottom-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav a.is-active { color: hsl(var(--accent)); }

.brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 600; letter-spacing: -0.01em; }
.brand.small { font-size: 0.875rem; }
.brand-mark {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, hsl(var(--accent)), hsl(var(--primary)));
    color: hsl(var(--accent-foreground));
}
.brand-mark .icon { width: 1rem; height: 1rem; }

/* ---------- Toasts (avisos rápidos) ---------- */
.toast-area {
    position: fixed;
    left: 50%;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 0.75rem);
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(92vw, 24rem);
    pointer-events: none;
}
.reader-body .toast-area, .public-body .toast-area { bottom: calc(1.25rem + var(--safe-bottom)); }
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius);
    background: hsl(var(--popover));
    border: 1px solid hsl(var(--border));
    box-shadow: 0 8px 24px hsl(var(--shadow));
    font-size: 0.85rem;
    animation: toast-in 0.2s ease-out;
}
.toast .icon { width: 1rem; height: 1rem; margin-top: 0.1rem; }
.toast.success .icon { color: hsl(var(--success)); }
.toast.error .icon { color: hsl(var(--destructive)); }
.toast.warning .icon { color: hsl(var(--warning)); }
.toast small { display: block; color: hsl(var(--muted-foreground)); margin-top: 0.1rem; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: all 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Painéis (bottom sheet no celular, janela no computador) ---------- */
dialog.sheet {
    position: fixed;
    inset: auto 0 0 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    max-height: 85dvh;
    padding: 0;
    border: 1px solid hsl(var(--border));
    border-bottom: 0;
    border-radius: 1rem 1rem 0 0;
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    box-shadow: 0 -10px 40px hsl(var(--shadow));
    flex-direction: column;
    overflow: hidden;
}
dialog.sheet[open] { display: flex; animation: sheet-up 0.22s ease-out; }
dialog.sheet.tall { height: 88vh; height: 88dvh; max-height: 88dvh; }
dialog.sheet:focus { outline: none; }
dialog.sheet::backdrop { background: hsl(0 0% 0% / 0.55); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-header {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 1.1rem 1.25rem 0.8rem;
    border-bottom: 1px solid hsl(var(--border));
}
.sheet-header .icon-button { margin: -0.4rem -0.6rem 0 0; }
.sheet-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; }
.sheet-title .icon { width: 1.05rem; height: 1.05rem; }
.sheet-body { padding: 1.1rem 1.25rem calc(1.5rem + var(--safe-bottom)); overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.badges { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.45rem;
    border-radius: 0.35rem;
    border: 1px solid hsl(var(--border));
    font-size: 0.65rem;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
}
.badge .icon { width: 0.75rem; height: 0.75rem; }
button.badge:hover { border-color: hsl(var(--accent)); color: hsl(var(--foreground)); }
.badge.solid { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: transparent; }
.badge.ot { border-color: hsl(38 90% 50% / 0.4); color: hsl(38 85% 55%); }
.badge.nt { border-color: hsl(200 80% 55% / 0.4); color: hsl(200 75% 60%); }

.help-list { display: flex; flex-direction: column; gap: 1.2rem; }
.help-list h3 { font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.help-list h3 .icon { width: 1rem; height: 1rem; color: hsl(var(--accent)); }
.help-list p { font-size: 0.875rem; color: hsl(var(--muted-foreground)); line-height: 1.6; padding-left: 1.5rem; }
.help-list p.muted { padding-left: 0; }
.help-list b { color: hsl(var(--foreground)); font-weight: 600; }

/* Carregando */
.loading-line { display: flex; align-items: center; gap: 0.5rem; color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.loading-line .icon { width: 1rem; height: 1rem; animation: spin 0.9s linear infinite; }
.skeleton { border-radius: var(--radius); background: hsl(var(--muted) / 0.6); animation: pulse 1.4s ease-in-out infinite; height: 4.5rem; }
@keyframes pulse { 50% { opacity: 0.5; } }

.empty-state { text-align: center; color: hsl(var(--muted-foreground)); padding: 3rem 1rem; font-size: 0.875rem; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.empty-state .icon { width: 2.25rem; height: 2.25rem; opacity: 0.45; margin-bottom: 0.5rem; }

/* Texto em markdown vindo da IA */
.markdown { font-size: 0.9rem; line-height: 1.7; overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown p, .markdown ul, .markdown ol { margin: 0.75rem 0; }
.markdown ul, .markdown ol { padding-left: 1.25rem; }
.markdown li { margin: 0.35rem 0; }
.markdown h1, .markdown h2, .markdown h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; line-height: 1.35; }
.markdown h2 { font-size: 1.05rem; }
.markdown strong { color: hsl(var(--foreground)); font-weight: 600; }
.markdown hr { border: 0; border-top: 1px solid hsl(var(--border)); margin: 1.25rem 0; }
.markdown a { color: hsl(var(--accent)); text-decoration: underline; }
.markdown code { font-size: 0.85em; background: hsl(var(--muted)); padding: 0.05rem 0.3rem; border-radius: 4px; }
.markdown blockquote { margin: 0.75rem 0; padding-left: 0.85rem; border-left: 2px solid hsl(var(--accent) / 0.6); color: hsl(var(--muted-foreground)); }
.typing::after { content: '▍'; display: inline-block; margin-left: 2px; animation: blink 1s steps(1) infinite; color: hsl(var(--accent)); }
@keyframes blink { 50% { opacity: 0; } }

/* ==========================================================================
   Telas
   ========================================================================== */

/* Início (versões) */
.continue-card { border-color: hsl(var(--accent) / 0.4); }
.version-list { display: flex; flex-direction: column; }
.version-item { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.7rem 0; border-bottom: 1px solid hsl(var(--border)); }
.version-item:first-child { padding-top: 0; }
.version-item:last-child { border-bottom: 0; }
.continue-inline {
    margin-left: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    background: hsl(var(--secondary) / 0.5);
    border: 1px solid hsl(var(--border));
}
.continue-inline:hover { border-color: hsl(var(--accent) / 0.4); }
.continue-inline .icon { width: 0.9rem; height: 0.9rem; }
.verse-of-day { flex-direction: column; align-items: stretch; gap: 0.6rem; border-color: hsl(var(--accent) / 0.3); }
.verse-quote { font-style: italic; font-size: 0.9rem; line-height: 1.65; opacity: 0.92; }

/* Outras formas de ler (início) */
.plan-today { border-color: hsl(var(--accent) / 0.4); }
.ways-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.way-tile {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.8rem 0.7rem;
    border-radius: var(--radius);
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    min-width: 0;
    transition: border-color 0.15s;
}
.way-tile:hover { border-color: hsl(var(--accent) / 0.45); }
.way-tile .tile-icon { width: 2.1rem; height: 2.1rem; margin-bottom: 0.15rem; }
.way-tile .tile-icon .icon { width: 1.05rem; height: 1.05rem; }
.way-tile .strong { line-height: 1.25; }
.way-tile .tiny { line-height: 1.35; }
@media (max-width: 400px) { .way-tile .tiny { display: none; } }

/* Busca */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.search-box > .icon { position: absolute; left: 0.8rem; width: 1rem; height: 1rem; pointer-events: none; }
.search-box input { padding-left: 2.4rem; padding-right: 2.5rem; }
.search-box .icon-button { position: absolute; right: 0.3rem; }
.search-results { display: flex; flex-direction: column; gap: 0.9rem; }
.result-group-title { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: hsl(var(--accent)); margin-bottom: 0.4rem; }
.result-card {
    display: block;
    padding: 0.7rem 0.8rem;
    border-radius: 0.5rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    margin-bottom: 0.4rem;
}
.result-card:hover { border-color: hsl(var(--accent) / 0.45); }
.result-card .ref { font-size: 0.72rem; font-weight: 600; margin-bottom: 0.2rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.result-card p { font-size: 0.8rem; line-height: 1.55; opacity: 0.88; }
mark { background: hsl(var(--accent) / 0.3); color: inherit; border-radius: 3px; padding: 0 0.1rem; }

/* Livros e capítulos */
.book-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.book-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    overflow: hidden;
    min-width: 0;
}
.book-tile:hover { border-color: hsl(var(--accent) / 0.45); }
.chapter-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; }
.chapter-tile {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    font-weight: 500;
    font-size: 0.9rem;
}
.chapter-tile:hover { border-color: hsl(var(--accent) / 0.45); }
.chapter-tile.is-read { background: hsl(var(--accent) / 0.1); border-color: hsl(var(--accent) / 0.5); color: hsl(var(--accent)); }
.tile-check { position: absolute; top: 0.25rem; right: 0.25rem; width: 0.65rem; height: 0.65rem; }

.fab {
    position: fixed;
    right: 1.25rem;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 1rem);
    z-index: 40;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px hsl(var(--shadow));
    transition: transform 0.15s;
}
.fab:hover { transform: scale(1.05); }
.fab:active { transform: scale(0.95); }
.fab .icon { width: 1.5rem; height: 1.5rem; }

/* Listas (favoritos, anotações, histórico) */
.group { margin-bottom: 1rem; }
.group-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.4rem; }
.list-card { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.75rem; margin-bottom: 0.4rem; }
.list-card .icon-button { margin: -0.35rem -0.35rem 0 0; color: hsl(var(--muted-foreground)); }
.list-card.card-link { align-items: center; }
.divided { list-style: none; margin: 0; padding: 0; }
.divided > li { border-top: 1px solid hsl(var(--border)); }
.note-item { display: flex; gap: 0.5rem; padding: 0.8rem 1rem; align-items: flex-start; }
.note-item .grow { gap: 0.3rem; }
.note-item .icon-button { color: hsl(var(--muted-foreground)); margin-right: -0.5rem; }
.is-removing { opacity: 0; transform: translateX(12px); transition: all 0.25s; }

/* Progresso */
.accordion {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
    overflow: hidden;
}
.accordion > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary .chevron { width: 1rem; height: 1rem; color: hsl(var(--muted-foreground)); transition: transform 0.2s; }
.accordion[open] > summary .chevron { transform: rotate(180deg); }
.accordion-body { padding: 0 0.5rem 0.5rem; display: flex; flex-direction: column; gap: 0.3rem; }
.accordion.inner { border: 0; background: hsl(var(--secondary) / 0.35); border-radius: 0.5rem; }
.accordion.inner > summary { padding: 0.6rem 0.75rem; }
.progress-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.4rem; }
.progress { flex: 1; height: 0.35rem; border-radius: 99px; background: hsl(var(--secondary)); overflow: hidden; display: block; }
.progress.thin { height: 0.25rem; margin-top: 0.4rem; }
.progress > span { display: block; height: 100%; background: hsl(var(--accent)); border-radius: 99px; transition: width 0.3s; }
.progress-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.35rem; padding: 0 0.75rem 0.75rem; }
.mini-tile {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.35rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    font-size: 0.7rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
}
.mini-tile.is-read { background: hsl(var(--accent) / 0.15); border-color: hsl(var(--accent) / 0.45); color: hsl(var(--accent)); }
[data-marking] .mini-tile { cursor: copy; border-style: dashed; }

/* Ajustes */
.settings-grid { display: grid; gap: 1rem; }

/* Admin */
.row-between.wrap { flex-wrap: wrap; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lexicon-columns { display: grid; gap: 1rem; align-items: start; }
.entry-list { max-height: 60vh; overflow-y: auto; }
.entry-row { display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left; padding: 0.6rem 0.75rem; border-radius: 0.5rem; background: hsl(var(--secondary) / 0.45); }
.entry-row:hover { background: hsl(var(--secondary)); }
.entry-preview { border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 0.85rem 1rem; max-height: 50vh; overflow-y: auto; }
[data-admin-tabs] > * { font-size: 0.8rem; padding: 0 0.3rem; }
@media (max-width: 420px) { [data-admin-tabs] .icon { display: none; } }
.provider-grid { display: grid; gap: 1rem; }
.provider-card { display: flex; flex-direction: column; gap: 1.1rem; }
.provider-card.is-active { border-color: hsl(var(--accent) / 0.6); }
.provider-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.model-row { display: flex; gap: 0.5rem; }
.model-row select, .model-row input { flex: 1; min-width: 0; }
.provider-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.provider-actions .button { flex: 1 1 auto; }
.test-result { font-size: 0.8rem; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.stat-box { border-radius: 0.5rem; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); padding: 0.8rem; }
.stat-box .label { font-size: 0.65rem; letter-spacing: 0.06em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.stat-box .value { font-size: 1.1rem; font-weight: 600; margin-top: 0.15rem; }
.stat-box .sub { font-size: 0.7rem; color: hsl(var(--muted-foreground)); }
.usage-columns { display: grid; gap: 1rem; }
.usage-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 0.75rem; font-size: 0.78rem; padding: 0.5rem 0.65rem; border-radius: 0.4rem; background: hsl(var(--secondary) / 0.45); }
.usage-row .name { font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.usage-row .numbers { color: hsl(var(--muted-foreground)); text-align: right; margin-left: auto; }
.user-list { display: grid; gap: 0.6rem; }
.user-card { display: flex; flex-direction: column; gap: 0.7rem; padding: 0.85rem 1rem; }
.user-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 99px;
    border: 1px solid hsl(var(--border));
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}
.chip .icon { width: 0.8rem; height: 0.8rem; }
.chip:hover { border-color: hsl(var(--accent) / 0.5); color: hsl(var(--foreground)); }
.chip.is-on { border-color: hsl(var(--accent)); color: hsl(var(--accent)); background: hsl(var(--accent) / 0.1); }

/* ==========================================================================
   Leitor
   ========================================================================== */
.reader-body { background: hsl(var(--paper-charcoal-bg)); }
.reader { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.paper-sepia { background: hsl(var(--paper-sepia-bg)); color: hsl(var(--paper-sepia-fg)); }
.paper-cream { background: hsl(var(--paper-cream-bg)); color: hsl(var(--paper-cream-fg)); }
.paper-charcoal { background: hsl(var(--paper-charcoal-bg)); color: hsl(var(--paper-charcoal-fg)); }

.reader-font-inter { font-family: 'Inter', system-ui, sans-serif; }
.reader-font-lora { font-family: 'Lora', Georgia, serif; }
.reader-font-atkinson { font-family: 'Atkinson Hyperlegible', system-ui, sans-serif; }
.lh-compact { line-height: 1.5; }
.lh-normal { line-height: 1.8; }
.lh-wide { line-height: 2.1; }

.reader-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: calc(0.4rem + var(--safe-top)) 0.6rem 0.4rem;
    background: hsl(0 0% 100% / 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.paper-charcoal .reader-header { background: hsl(var(--paper-charcoal-bg) / 0.92); }
.reader-title { flex: 1; font-size: 0.875rem; font-weight: 500; padding: 0 0.4rem; }
.reader-tools { display: flex; align-items: center; }
.reader-tools .icon-button { width: 2.35rem; height: 2.35rem; }
.reader-tools .icon-button.is-active { background: hsl(0 0% 0% / 0.1); }
.paper-charcoal .reader-tools .icon-button.is-active { background: hsl(0 0% 100% / 0.1); }
.when-on { display: none; color: hsl(var(--accent)); }
.is-on .when-on { display: block; }
.is-on .when-off { display: none; }

.chapter-search {
    position: sticky;
    top: calc(3.1rem + var(--safe-top));
    z-index: 20;
    background: hsl(0 0% 100% / 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid hsl(0 0% 0% / 0.1);
}
.paper-charcoal .chapter-search { background: hsl(var(--paper-charcoal-bg) / 0.95); border-color: hsl(0 0% 100% / 0.1); }
.chapter-search-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; }
.chapter-search-bar > .icon { width: 1rem; height: 1rem; }
.chapter-search-bar input { min-height: 2.35rem; background: transparent; border-color: currentColor; border-color: color-mix(in srgb, currentColor 22%, transparent); }
.chapter-search-results { max-height: 40vh; overflow-y: auto; padding: 0 0.5rem 0.5rem; }
.chapter-search-results button { display: flex; gap: 0.6rem; width: 100%; text-align: left; padding: 0.5rem 0.75rem; border-radius: 0.4rem; font-size: 0.875rem; line-height: 1.45; }
.chapter-search-results button:hover { background: color-mix(in srgb, currentColor 6%, transparent); }
.chapter-search-results .num { font-family: ui-monospace, monospace; font-size: 0.72rem; opacity: 0.6; margin-top: 0.15rem; flex-shrink: 0; }
.chapter-search-results .info { padding: 0.5rem 0.75rem; font-size: 0.72rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.06em; }
.reader mark { background: hsl(45 95% 60% / 0.4); }

.reader-article { flex: 1; width: 100%; max-width: 65ch; margin: 0 auto; padding: 1.5rem 1.25rem 7rem; }
.verse { margin: 0 0 0.5rem; border-radius: 0.375rem; transition: background-color 0.5s, box-shadow 0.5s; scroll-margin-top: 6rem; }
.verse-num { font-size: 0.7em; font-weight: 600; vertical-align: super; margin-right: 4px; opacity: 0.55; font-family: 'Inter', sans-serif; }
.w {
    cursor: pointer;
    border-radius: 3px;
    padding: 0 1px;
    transition: background-color 0.12s;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}
.w:active, .w.is-pressing { background: hsl(var(--accent) / 0.25); }
.verse:focus { outline: none; }
.verse:focus-visible { box-shadow: 0 0 0 2px hsl(var(--accent) / 0.6); }
.w:focus { outline: none; }
.w:focus-visible { background: hsl(var(--accent) / 0.3); box-shadow: 0 0 0 1px hsl(var(--accent)); }
.verse.is-selected { background: hsl(var(--accent) / 0.18); }
.verse.is-jump { box-shadow: 0 0 0 2px hsl(45 90% 55% / 0.6); background: hsl(45 90% 60% / 0.1); }
.verse-flag { display: none; width: 0.85rem; height: 0.85rem; margin-left: 0.25rem; opacity: 0.7; vertical-align: -0.05em; }
.verse.has-fav .flag-fav, .verse.has-note .flag-note { display: inline; }

/* Marca-texto: favorito (âmbar) e anotação (azul) */
.verse-mark-fav { background-color: hsl(38 90% 55% / 0.18); box-shadow: inset 0 -0.35em 0 hsl(38 90% 55% / 0.22); border-radius: 3px; padding: 0 2px; }
.verse-mark-note { background-color: hsl(210 80% 60% / 0.16); box-shadow: inset 0 -0.35em 0 hsl(210 80% 60% / 0.22); border-radius: 3px; padding: 0 2px; }
.verse-mark-both { background-color: hsl(38 90% 55% / 0.16); box-shadow: inset 0 -0.35em 0 hsl(38 90% 55% / 0.22), inset 0 0.35em 0 hsl(210 80% 60% / 0.22); border-radius: 3px; padding: 0 2px; }
.paper-sepia .verse-mark-fav, .paper-cream .verse-mark-fav { background-color: hsl(38 85% 50% / 0.22); box-shadow: inset 0 -0.35em 0 hsl(38 85% 45% / 0.28); }
.paper-sepia .verse-mark-note, .paper-cream .verse-mark-note { background-color: hsl(212 75% 50% / 0.18); box-shadow: inset 0 -0.35em 0 hsl(212 75% 45% / 0.28); }
.paper-sepia .verse-mark-both, .paper-cream .verse-mark-both { background-color: hsl(38 85% 50% / 0.18); box-shadow: inset 0 -0.35em 0 hsl(38 85% 45% / 0.28), inset 0 0.35em 0 hsl(212 75% 45% / 0.28); }

.chapter-nav { display: flex; justify-content: space-between; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent); font-family: 'Inter', sans-serif; font-size: 0.875rem; }
.chapter-nav a, .chapter-nav span { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.5rem 0.25rem; }
.chapter-nav .icon { width: 1rem; height: 1rem; }
.chapter-nav .disabled { opacity: 0.3; }

.brightness-overlay { position: fixed; inset: 0; pointer-events: none; background: #000; z-index: 25; }

.ai-fab { bottom: calc(1.25rem + var(--safe-bottom)); animation: fab-pulse 3s ease-in-out infinite; }
@keyframes fab-pulse { 50% { transform: scale(1.05); } }

.verse-actions {
    position: fixed;
    z-index: 50;
    display: flex;
    gap: 0.15rem;
    padding: 0.3rem;
    border-radius: 99px;
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    box-shadow: 0 10px 30px hsl(var(--shadow));
    animation: pop-in 0.15s ease-out;
    font-family: 'Inter', sans-serif;
}
@keyframes pop-in { from { transform: scale(0.92); opacity: 0; } }
.verse-actions button { display: flex; align-items: center; gap: 0.35rem; height: 2.35rem; padding: 0 0.6rem; border-radius: 99px; font-size: 0.7rem; font-weight: 500; white-space: nowrap; }
.verse-actions button .icon { width: 1rem; height: 1rem; }
.verse-actions button:hover { background: hsl(var(--muted)); }
.verse-actions button.is-on { color: hsl(var(--accent)); }
.verse-actions button.is-on .icon { fill: currentColor; }
.verse-actions button[data-action="note"].is-on .icon { fill: none; }

.settings-body { display: flex; flex-direction: column; gap: 1.6rem; }
.settings-body .setting-label { margin-bottom: 0.75rem; }

.lexicon-entry { border: 1px solid hsl(var(--border)); background: hsl(var(--secondary) / 0.3); border-radius: 0.5rem; padding: 0.8rem; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.875rem; }
.lexicon-entry header { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; align-items: baseline; }
.lexicon-entry .original { font-family: 'Lora', 'SBL Hebrew', 'Times New Roman', serif; font-size: 1.15rem; }
.verse-quote-block { margin: 0 0 1.25rem; padding-left: 0.85rem; border-left: 2px solid hsl(var(--accent) / 0.6); font-style: italic; color: hsl(var(--muted-foreground)); font-size: 0.875rem; line-height: 1.6; }

.compare-card { border: 1px solid hsl(var(--border)); border-radius: 0.75rem; padding: 0.9rem; background: hsl(var(--background) / 0.4); margin-bottom: 0.75rem; }
.compare-card.current { border-color: hsl(var(--accent) / 0.35); background: hsl(var(--accent) / 0.08); }
.compare-card header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; min-width: 0; }
.compare-card p { font-size: 0.9rem; line-height: 1.65; }

.places-map { height: 42vh; width: 100%; border-radius: 0.75rem; overflow: hidden; border: 1px solid hsl(var(--border)); z-index: 0; background: hsl(var(--muted)); }
.places-list { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: 0.6rem; }
.place-button { width: 100%; text-align: left; border: 1px solid hsl(var(--border)); border-radius: 0.75rem; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.2rem; }
.place-button.is-active { border-color: hsl(var(--accent)); background: hsl(var(--accent) / 0.1); }
.place-history { padding: 0.5rem 0.75rem 0.25rem; font-size: 0.85rem; line-height: 1.6; }
.place-history h4 { margin: 0 0 0.2rem; font-size: 0.85rem; display: flex; align-items: center; gap: 0.4rem; }
.place-history h4 .icon { width: 1rem; height: 1rem; color: hsl(var(--accent)); }
.place-history a { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; color: hsl(var(--muted-foreground)); margin-top: 0.3rem; text-decoration: underline; }
.place-history a .icon { width: 0.75rem; height: 0.75rem; }
.leaflet-tooltip.place-label { background: hsl(var(--card)); color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); font-size: 11px; padding: 1px 6px; box-shadow: none; font-family: 'Inter', sans-serif; }

/* Chat */
.chat-messages { display: flex; flex-direction: column; gap: 1rem; }
.bubble { max-width: 92%; border-radius: 0.6rem; padding: 0.55rem 0.8rem; font-size: 0.9rem; line-height: 1.6; overflow-wrap: anywhere; }
.bubble.user { margin-left: auto; background: hsl(var(--accent) / 0.15); white-space: pre-wrap; }
.bubble.bot { background: hsl(var(--secondary) / 0.6); }
.bubble.bot.markdown { font-size: 0.9rem; }
.bubble-meta { display: flex; gap: 0.4rem; padding-left: 0.25rem; margin-top: -0.6rem; }
.suggestion { display: block; width: 100%; text-align: left; padding: 0.75rem; border-radius: 0.5rem; border: 1px solid hsl(var(--border)); background: hsl(var(--secondary) / 0.4); font-size: 0.875rem; line-height: 1.45; margin-bottom: 0.6rem; }
.suggestion:hover:not(:disabled) { border-color: hsl(var(--accent) / 0.5); }
.quota { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.65rem; padding: 0.15rem 0.45rem; border-radius: 0.4rem; border: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); white-space: nowrap; }
.quota .icon { width: 0.75rem; height: 0.75rem; }
.quota.is-low { color: hsl(var(--warning)); border-color: hsl(var(--warning) / 0.4); }
.chat-notice { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; font-size: 0.75rem; color: hsl(var(--muted-foreground)); border-top: 1px solid hsl(var(--border)); background: hsl(var(--secondary) / 0.3); }
.chat-notice .icon { width: 0.9rem; height: 0.9rem; color: hsl(var(--warning)); }
.chat-form { display: flex; gap: 0.5rem; padding: 0.75rem; padding-bottom: calc(0.75rem + var(--safe-bottom)); border-top: 1px solid hsl(var(--border)); }
.chat-form input { flex: 1; min-width: 0; }

/* ==========================================================================
   Telas abertas (landing, entrar)
   ========================================================================== */
.auth-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.25rem; }
.auth-box { width: 100%; max-width: 24rem; display: flex; flex-direction: column; gap: 1rem; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; margin-bottom: 0.5rem; text-align: center; }
.auth-logo-icon { width: 3.5rem; height: 3.5rem; border-radius: 50%; background: hsl(var(--secondary)); color: hsl(var(--accent)); display: flex; align-items: center; justify-content: center; margin-bottom: 0.4rem; }
.auth-logo-icon .icon { width: 1.75rem; height: 1.75rem; }
.auth-logo-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.auth-box .segmented { margin-bottom: 0; }
.auth-card { padding: 1.5rem; border-left: 4px solid hsl(var(--primary)); display: flex; flex-direction: column; gap: 1.25rem; }
.auth-card.is-signup { border-left-color: hsl(var(--accent)); }
.auth-card-head { display: flex; align-items: center; gap: 0.75rem; }
.auth-card-head h1 { font-size: 1.125rem; font-weight: 600; line-height: 1.25; }
.auth-card-icon { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: hsl(var(--primary) / 0.15); color: hsl(var(--primary)); flex-shrink: 0; }
.is-signup .auth-card-icon { background: hsl(var(--accent) / 0.15); color: hsl(var(--accent)); }
.auth-switch { border-top: 1px solid hsl(var(--border)); padding-top: 1rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }

.landing-wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.landing-wrap.narrow { max-width: 48rem; }
.landing-header { position: sticky; top: 0; z-index: 40; background: hsl(var(--background) / 0.75); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid hsl(var(--border) / 0.6); padding-top: var(--safe-top); }
.landing-bar { height: 3.5rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.landing-actions { display: flex; align-items: center; gap: 0.5rem; }
.theme-icon-light { display: none; }
.light .theme-icon-dark { display: none; }
.light .theme-icon-light { display: block; }
.hide-mobile { display: none; }
.hero { position: relative; overflow: hidden; padding: 4rem 0 5rem; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0.6; background: radial-gradient(60% 60% at 50% 0%, hsl(var(--accent) / 0.18) 0%, transparent 70%); }
.pill { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.8rem; border-radius: 99px; border: 1px solid hsl(var(--border)); background: hsl(var(--card) / 0.6); font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-bottom: 1.5rem; }
.pill .icon { width: 0.9rem; height: 0.9rem; }
.hero-title { font-size: 2.25rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; }
.hero-text { margin: 1.5rem auto 0; max-width: 40rem; color: hsl(var(--muted-foreground)); font-size: 1rem; }
.hero-buttons { margin-top: 2.25rem; display: flex; flex-direction: column; gap: 0.75rem; justify-content: center; }
.preview-card { margin: 4rem auto 0.75rem; max-width: 48rem; border-radius: 1rem; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); box-shadow: 0 25px 50px hsl(var(--shadow)); overflow: hidden; text-align: left; }
.preview-bar { height: 2.25rem; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--secondary) / 0.4); display: flex; align-items: center; gap: 0.4rem; padding: 0 0.75rem; }
.preview-bar i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: hsl(var(--muted-foreground) / 0.3); }
.preview-bar span { margin-left: 0.6rem; font-size: 0.7rem; color: hsl(var(--muted-foreground)); }
.preview-text { padding: 1.5rem; font-size: 1.2rem; line-height: 1.8; }
.landing-section { padding: 5rem 0; border-top: 1px solid hsl(var(--border) / 0.6); }
.landing-section.tinted { background: hsl(var(--secondary) / 0.2); }
.landing-section h2 { font-size: 1.85rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 1rem; }
.section-intro { text-align: center; max-width: 40rem; margin: 0 auto 3.5rem; }
.feature-grid, .trust-grid { display: grid; gap: 1rem; }
.feature-card { border: 1px solid hsl(var(--border)); background: hsl(var(--card)); border-radius: 0.75rem; padding: 1.5rem; transition: border-color 0.2s; }
.feature-card:hover { border-color: hsl(var(--accent) / 0.4); }
.feature-card h3 { font-size: 1rem; font-weight: 600; margin: 0.9rem 0 0.4rem; }
.feature-card p { font-size: 0.875rem; color: hsl(var(--muted-foreground)); line-height: 1.6; }
.feature-icon { width: 2.5rem; height: 2.5rem; border-radius: 0.5rem; background: hsl(var(--secondary)); color: hsl(var(--accent)); display: flex; align-items: center; justify-content: center; }
.two-columns { display: grid; gap: 3rem; align-items: center; }
.dot-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.9rem; }
.dot-list li { display: flex; gap: 0.75rem; }
.dot-list li::before { content: ''; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: hsl(var(--accent)); margin-top: 0.5rem; flex-shrink: 0; }
.chat-preview { border-radius: 1rem; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); padding: 1.25rem; box-shadow: 0 20px 40px hsl(var(--shadow)); display: flex; flex-direction: column; gap: 1rem; }
.chat-preview-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 500; padding-bottom: 1rem; border-bottom: 1px solid hsl(var(--border)); }
.chat-preview .bubble.user { border-top-right-radius: 0.2rem; max-width: 80%; }
.chat-preview .bubble.bot { border-top-left-radius: 0.2rem; max-width: 88%; }
.quote-icon .icon { width: 2rem; height: 2rem; color: hsl(var(--accent)); margin-bottom: 1.5rem; }
.quote { font-size: 1.35rem; font-weight: 500; line-height: 1.4; margin-bottom: 1rem; }
.cta { padding: 6rem 0; }
.landing-footer { border-top: 1px solid hsl(var(--border) / 0.6); padding: 2rem 0 calc(2rem + var(--safe-bottom)); }
.landing-footer .landing-bar { height: auto; flex-direction: column; gap: 0.75rem; }

/* ==========================================================================
   Telas maiores
   ========================================================================== */
@media (min-width: 640px) {
    .hero-buttons { flex-direction: row; }
    .hide-mobile { display: inline-flex; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .book-grid { grid-template-columns: repeat(3, 1fr); }
    .chapter-grid { grid-template-columns: repeat(8, 1fr); }
    .progress-grid { grid-template-columns: repeat(10, 1fr); }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .form-grid { grid-template-columns: 1fr 1fr auto; align-items: end; }
    .form-grid.two-prices { grid-template-columns: 1fr 1fr; }
    .user-card { flex-direction: row; align-items: center; justify-content: space-between; }
    .verse-actions button { font-size: 0.75rem; }
    dialog.sheet {
        inset: 0;
        margin: auto;
        width: min(92vw, 40rem);
        max-height: 85vh;
        border-radius: 1rem;
        border-bottom: 1px solid hsl(var(--border));
    }
    dialog.sheet.tall { height: min(88vh, 52rem); }
    dialog.sheet[open] { animation: pop-in 0.18s ease-out; }
}

@media (min-width: 768px) {
    .hero { padding: 6rem 0 7rem; }
    .hero-title { font-size: 3.75rem; }
    .hero-text { font-size: 1.125rem; }
    .preview-text { padding: 2.5rem; font-size: 1.5rem; }
    .landing-section { padding: 7rem 0; }
    .landing-section h2 { font-size: 2.35rem; }
    .two-columns { grid-template-columns: 1fr 1fr; }
    .trust-grid { grid-template-columns: repeat(3, 1fr); }
    .landing-footer .landing-bar { flex-direction: row; }
    .settings-grid { grid-template-columns: 1fr 1fr; align-items: start; }
    .settings-grid > form, .settings-grid > .button { grid-column: span 1; }
    .provider-grid { grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
}

/* Duas páginas lado a lado só quando a tela aberta comporta (tablet/dobrável deitado) */
@media (min-width: 768px) and (min-height: 480px) and (orientation: landscape) {
    .reader-article { max-width: 1200px; padding: 2rem 2rem 7rem; }
    .reader-verses { column-count: 2; column-gap: 64px; column-rule: 1px solid color-mix(in srgb, currentColor 18%, transparent); column-fill: balance; overflow-wrap: anywhere; }
    .reader-verses > .verse { break-inside: avoid-column; }
}

/* Computador: menu lateral no lugar da barra inferior */
@media (min-width: 1024px) {
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
    .sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--sidebar-width);
        padding: 1.25rem 0.75rem;
        border-right: 1px solid hsl(var(--border));
        background: hsl(var(--card));
        z-index: 35;
    }
    .sidebar .brand { padding: 0 0.6rem 1.5rem; }
    .side-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; overflow-y: auto; }
    .side-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 0.65rem 0.75rem;
        border-radius: 0.5rem;
        font-size: 0.9rem;
        color: hsl(var(--muted-foreground));
        text-align: left;
        transition: background-color 0.15s, color 0.15s;
    }
    .side-link:hover { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
    .side-link.is-active { background: hsl(var(--accent) / 0.12); color: hsl(var(--accent)); font-weight: 500; }
    .side-footer { border-top: 1px solid hsl(var(--border)); padding-top: 0.75rem; display: flex; flex-direction: column; gap: 0.2rem; }
    .side-email { font-size: 0.72rem; color: hsl(var(--muted-foreground)); padding: 0 0.75rem 0.35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .app-main { margin-left: var(--sidebar-width); padding-bottom: 0; }
    .bottom-nav { display: none; }
    .page-header .help-fab { display: none; }
    .page-content { padding: 1.5rem 2rem 3rem; }
    .fab { bottom: 2rem; right: 2rem; }
    .toast-area { bottom: 1.5rem; left: calc(50% + var(--sidebar-width) / 2); }
    .book-grid { grid-template-columns: repeat(4, 1fr); }
    .chapter-grid { grid-template-columns: repeat(10, 1fr); }
    .stat-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 1440px)
{
    .usage-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
}

@media (min-width: 1100px)
{
    .lexicon-columns { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Leitura sem internet ---------- */
.offline-banner { padding: 0.45rem 1rem; padding-top: calc(0.45rem + var(--safe-top)); text-align: center; font-size: 0.75rem; background: hsl(38 85% 62%); color: hsl(30 30% 12%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.offline-page { min-height: 100vh; background: hsl(var(--background)); }
.offline-page .page-header { position: static; padding-top: 0.75rem; }
.offline-message { margin-bottom: 1rem; font-size: 0.85rem; color: hsl(var(--foreground)); }
.offline-list { display: flex; flex-direction: column; gap: 0.5rem; }
.offline-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.8rem; border-radius: 0.5rem; background: hsl(var(--secondary) / 0.45); }

/* ---------- Índices: ordem histórica, momentos e planos ---------- */
.version-switch { align-items: center; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; position: relative; }
.timeline-dot {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    background: hsl(var(--accent) / 0.12);
    color: hsl(var(--accent));
}
.timeline-dot.is-done { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.era-body { padding: 0 1rem 1rem 3.65rem; display: flex; flex-direction: column; gap: 0.75rem; }
.passage-chip .icon { width: 0.75rem; height: 0.75rem; }
.moment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.moment-tile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 0.8rem;
    border-radius: var(--radius);
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    min-width: 0;
    line-height: 1.3;
}
.moment-tile:hover { border-color: hsl(var(--accent) / 0.45); }
.moment-tile .icon { width: 1.1rem; height: 1.1rem; }
.moment-list { display: grid; gap: 0.75rem; }
.moment-card { display: flex; flex-direction: column; gap: 0.6rem; }
.moment-ref .icon { width: 0.85rem; height: 0.85rem; }
.moment-text { font-size: 1.05rem; line-height: 1.75; }
.alert.care { border-color: hsl(var(--accent) / 0.35); background: hsl(var(--accent) / 0.07); color: hsl(var(--foreground)); }
.alert.care .icon { color: hsl(var(--accent)); }
.plan-list { display: grid; gap: 0.75rem; }
.plan-card { display: flex; flex-direction: column; align-items: stretch; gap: 0.6rem; }
.plan-numbers { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.plan-hero { display: flex; flex-direction: column; gap: 0.9rem; border-color: hsl(var(--accent) / 0.4); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.day-list { display: flex; flex-direction: column; }
.day-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.25rem; border-top: 1px solid hsl(var(--border)); }
.day-row:first-child { border-top: 0; }
.day-row.is-next { background: hsl(var(--accent) / 0.08); border-radius: 0.5rem; padding-inline: 0.5rem; }
.day-row input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: hsl(var(--accent)); flex-shrink: 0; cursor: pointer; }
.day-row .day-number { font-size: 0.75rem; color: hsl(var(--muted-foreground)); width: 3.4rem; flex-shrink: 0; }
.day-row.is-done .day-link { color: hsl(var(--muted-foreground)); text-decoration: line-through; text-decoration-color: hsl(var(--muted-foreground) / 0.5); }
.day-link { font-size: 0.875rem; flex: 1; min-width: 0; }
.day-link:hover { color: hsl(var(--accent)); }
.month-body { padding: 0 0.75rem 0.75rem; }
.plan-strip { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.35rem 1rem; font-size: 0.75rem; font-family: 'Inter', sans-serif; background: hsl(var(--accent) / 0.14); }
.plan-strip a { text-decoration: underline; }
.plan-finish { margin-top: 2rem; padding: 1rem; border-radius: var(--radius); border: 1px solid color-mix(in srgb, currentColor 18%, transparent); font-family: 'Inter', sans-serif; display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }
.plan-finish .button { font-size: 0.9rem; }
@media (min-width: 640px)
{
    .moment-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .plan-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px)
{
    .moment-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .moment-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
