/* ==========================================================================
   Aigenip — tema escuro
   Cores inspiradas no logo: vermelho da pimenta + verde do cabo.
   ========================================================================== */

:root {
    --bg: #110d0e;
    --bg-2: #161112;
    --surface: #1c1617;
    --surface-2: #241c1d;
    --surface-3: #2e2425;
    --line: #342a2b;
    --line-2: #463a3b;
    --text: #f4eeeb;
    --text-2: #d9cfcc;
    --muted: #a89995;
    --red: #d7301d;
    --red-2: #ff5b3d;
    --red-soft: rgba(255, 91, 61, .12);
    --green: #3f8a22;
    --green-2: #7cc242;
    --green-soft: rgba(124, 194, 66, .13);
    --amber: #f2b134;
    --s0: #ff5b3d;
    --s1: #f2b134;
    --s2: #4fb3d9;
    --s3: #9ad26d;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-head: 'Sora', 'Inter', system-ui, sans-serif;
    --font-native: 'Inter', 'Noto Sans', 'Segoe UI', 'Nirmala UI', 'Ebrima', 'Leelawadee UI', 'Microsoft YaHei', 'Yu Gothic', 'Malgun Gothic', system-ui, sans-serif;
    --wrap: 1200px;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--red-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red-2); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
[lang] { font-family: var(--font-native); }
h1[lang], h2[lang] { font-family: var(--font-head); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.section { margin-top: 64px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; justify-content: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--red); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--red-2); margin-bottom: .7em; }
.lead { font-size: 1.12rem; color: var(--text-2); max-width: 760px; }
.hl { color: var(--red-2); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- Botões, chips, tags ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border-radius: 999px; border: 1px solid transparent;
    font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none !important;
    transition: transform .15s, background .15s, border-color .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--red-2), var(--red)); color: #fff; box-shadow: 0 6px 18px rgba(215, 48, 29, .35); }
.btn-primary:hover { background: linear-gradient(180deg, #ff6d52, #e2381f); }
.btn-ghost { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--red-2); }
.btn-sm { padding: 8px 14px; font-size: .86rem; }
.btn.full { width: 100%; margin-top: 12px; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; text-decoration: underline; font-size: .88rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2);
    font-size: .86rem; text-decoration: none !important; transition: border-color .15s, background .15s;
}
.chip[style*="--c"] { border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
a.chip:hover, .chip.active { border-color: var(--red-2); color: var(--text); }
.chip.active { background: var(--red-soft); }
.chip.small { padding: 3px 10px; font-size: .8rem; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: .78rem; font-weight: 600; }
.tag.warn { background: rgba(242, 177, 52, .15); color: var(--amber); }
.more { font-weight: 600; font-size: .92rem; }

/* ---------- Glyph e pontos ---------- */
.glyph {
    --c: var(--red-2);
    display: inline-grid; place-items: center; flex: none;
    width: 56px; height: 56px; border-radius: 16px;
    font-size: 1.7rem; font-weight: 700; line-height: 1;
    background: color-mix(in srgb, var(--c) 18%, var(--surface-2));
    color: color-mix(in srgb, var(--c) 60%, #fff);
    border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}
.glyph.small { width: 40px; height: 40px; font-size: 1.2rem; border-radius: 12px; }
.glyph.tiny { width: 26px; height: 26px; font-size: .85rem; border-radius: 8px; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.dots i.on { background: var(--red-2); }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(17, 13, 14, .85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo img { height: 32px; width: auto; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.main-nav > a, .dropdown-toggle {
    padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: .95rem;
    background: none; border: 0; cursor: pointer; text-decoration: none;
}
.main-nav > a:hover, .dropdown-toggle:hover, .main-nav > a.active { color: var(--text); background: var(--surface-2); }
.main-nav > a.active { box-shadow: inset 0 -2px 0 var(--red-2); }
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px); width: 270px; padding: 8px;
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .15s;
}
.dropdown.open .dropdown-menu, .dropdown:focus-within .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.dropdown-menu a:hover { background: var(--surface-2); }
.dropdown-menu small { display: block; color: var(--muted); font-size: .8rem; }
.header-actions { display: flex; gap: 6px; }
.icon-btn {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--red-2); }
.menu-btn { display: none; gap: 4px; align-content: center; }
.menu-btn span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: .2s; }

/* ---------- Busca ---------- */
.search-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); padding: 10vh 16px 16px; }
.search-box { max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-field input { flex: 1; background: none; border: 0; outline: none; font-size: 1.1rem; color: var(--text); min-width: 0; }
kbd { font: 600 .72rem var(--font); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); }
.search-results { max-height: 55vh; overflow-y: auto; padding: 8px; }
.search-results:empty { display: none; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none !important; }
.search-item:hover, .search-item.active { background: var(--surface-2); }
.search-item small { display: block; color: var(--muted); }
.search-group { padding: 8px 12px 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.search-hint { padding: 10px 18px; margin: 0; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- Breadcrumbs e cabeçalhos ---------- */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 18px; font-size: .85rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs [aria-current] { color: var(--text-2); }
.page-head { padding: 36px 20px 8px; }
.page-head.compact { padding-top: 24px; }
.page-head.center { text-align: center; padding: 80px 20px; }
.page-head.center .lead { margin: 0 auto 24px; }
.page-head[style*="--c"] h1 { color: color-mix(in srgb, var(--c) 55%, #fff); }
.big-glyph { font: 800 6rem/1 var(--font-head); color: var(--red-2); margin: 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); width: 100%; }

/* ---------- Hero da home ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; border-bottom: 1px solid var(--line); background: radial-gradient(1000px 500px at 80% -10%, rgba(215, 48, 29, .22), transparent 60%), radial-gradient(700px 400px at 0% 110%, rgba(63, 138, 34, .12), transparent 60%); }
.hero-inner { position: relative; }
.hero h1 { max-width: 880px; }
.quick-compare { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 28px 0 32px; padding: 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; max-width: 840px; box-shadow: var(--shadow); }
.quick-compare select { flex: 1 1 180px; }
.vs { font: 800 .9rem var(--font-head); color: var(--muted); text-transform: uppercase; }
select, input[type="search"], input[type="text"], input[type="email"], textarea {
    background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 14px; color: var(--text); width: 100%;
}
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a89995' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; cursor: pointer; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--red-2); box-shadow: 0 0 0 3px var(--red-soft); }
select option { background: var(--surface); }
.hero-stats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 840px; }
.hero-stats li { padding: 14px 16px; border-radius: var(--radius); background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.hero-stats strong { display: block; font: 800 1.6rem var(--font-head); color: var(--text); }
.hero-stats span { font-size: .85rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- Grades de cards ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tool { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; transition: border-color .15s, transform .15s; }
.tool:hover { border-color: var(--red-2); transform: translateY(-2px); }
.tool span:last-child { color: var(--muted); font-size: .9rem; }
.tool-icon { font-size: 1.6rem; }
.tool-main { grid-row: span 2; background: linear-gradient(160deg, rgba(215, 48, 29, .25), var(--surface) 60%); border-color: rgba(255, 91, 61, .35); justify-content: flex-end; }
.tool-main strong { font: 800 1.6rem var(--font-head); }
.tool-main .tool-icon { font-size: 2.6rem; margin-bottom: auto; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.lang-card {
    --c: var(--red-2);
    position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .15s, transform .15s;
}
.lang-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: var(--radius) var(--radius) 0 0; background: var(--c); opacity: .8; }
.lang-card:hover { border-color: color-mix(in srgb, var(--c) 60%, var(--line)); transform: translateY(-2px); }
.lang-card-link { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none !important; }
.lang-card-head strong { display: block; font: 700 1.15rem var(--font-head); }
.native { color: var(--muted); font-size: .92rem; font-weight: 500; }
.lang-card-summary { font-size: .9rem; color: var(--text-2); margin: 0; flex: 1; }
.lang-card-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.lang-card-stats dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lang-card-stats dd { margin: 0; font-size: .85rem; font-weight: 600; }
.compare-toggle { background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); border-radius: 999px; padding: 7px 12px; font-size: .85rem; font-weight: 600; cursor: pointer; }
.compare-toggle:hover { border-color: var(--red-2); color: var(--text); }
.compare-toggle .when-on, .compare-toggle[aria-pressed="true"] .when-off { display: none; }
.compare-toggle[aria-pressed="true"] .when-on { display: inline; }
.compare-toggle[aria-pressed="true"] { background: var(--green-soft); border-color: var(--green-2); color: var(--green-2); }

.pairs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pair-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
.pair-card:hover { border-color: var(--red-2); }
.pair-glyphs { display: flex; gap: 6px; margin-bottom: 4px; }
.pair-aff { font-size: .82rem; color: var(--muted); }

.day-card { --c: var(--red-2); display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: center; padding: 32px; border-radius: 24px; background: linear-gradient(120deg, color-mix(in srgb, var(--c) 20%, var(--surface)), var(--surface) 55%); border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); }
.day-glyph { display: grid; place-items: center; aspect-ratio: 1; border-radius: 28px; font-size: 6rem; font-weight: 800; color: color-mix(in srgb, var(--c) 55%, #fff); background: rgba(0, 0, 0, .25); }
.day-fact { color: var(--text-2); }
.day-phrase { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 1.4rem; font-weight: 700; }
.day-phrase small { font-size: .88rem; font-weight: 400; color: var(--muted); }

.family-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.family-pill { --c: var(--red-2); display: flex; flex-direction: column; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); color: var(--text); text-decoration: none !important; min-width: 150px; }
.family-pill:hover { border-color: var(--c); }
.family-pill span { font-size: .8rem; color: var(--muted); }
.continent-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.continent-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
.continent-card span { font-size: 1.6rem; }
.continent-card small { color: var(--muted); }
.continent-card:hover { border-color: var(--red-2); }

.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.discover-cta, .quiz-cta { padding: 32px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.discover-cta { background: linear-gradient(150deg, rgba(63, 138, 34, .22), var(--surface) 60%); border-color: rgba(124, 194, 66, .3); }
.discover-cta .eyebrow { color: var(--green-2); }
.quiz-sample { font-size: 2.4rem; font-weight: 700; margin: 0 0 8px; color: var(--amber); }

.guides-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.guide-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
.guide-card:hover { border-color: var(--red-2); }
.guide-card strong { font: 700 1.1rem/1.3 var(--font-head); }
.guide-card span:not(.tag) { color: var(--muted); font-size: .92rem; }
.guide-card small { color: var(--muted); margin-top: auto; }
.about-strip { padding: 32px; border-radius: 24px; border: 1px solid var(--line); background: var(--bg-2); }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; color: var(--text-2); }

/* ---------- Comparador ---------- */
.picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; margin-bottom: 28px; }
.picker-slot { position: relative; padding: 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); border-top: 3px solid var(--slot, var(--line-2)); }
.picker-slot.s0 { --slot: var(--s0); } .picker-slot.s1 { --slot: var(--s1); } .picker-slot.s2 { --slot: var(--s2); } .picker-slot.s3 { --slot: var(--s3); }
.picker-slot:not(.filled) { border-top-color: var(--line-2); opacity: .8; }
.picker-slot label { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.picker-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.compare-result { transition: opacity .2s; }
.compare-result.loading, #compare-output.loading { opacity: .45; pointer-events: none; }
.compare-heads { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.compare-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--slot); color: var(--text); text-decoration: none !important; text-align: center; }
.compare-head strong { font: 700 1.15rem var(--font-head); }
.compare-head .glyph { --c: var(--slot); }
.s0 { --slot: var(--s0); } .s1 { --slot: var(--s1); } .s2 { --slot: var(--s2); } .s3 { --slot: var(--s3); }
.compare-insights, .panel { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 20px; }
.insights { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.insights li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); }
.insight-icon { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); }
.insights strong { color: var(--text); }
.compare-visuals { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.compare-visuals .panel { margin-bottom: 20px; }
.radar svg { width: 100%; max-width: 440px; margin: 0 auto; overflow: visible; }
.radar-grid { fill: none; stroke: var(--line-2); stroke-width: 1; }
.radar-axis { stroke: var(--line-2); stroke-dasharray: 3 4; }
.radar-label { fill: var(--muted); font: 600 11px var(--font); }
.radar-series polygon { fill: var(--slot); fill-opacity: .14; stroke: var(--slot); stroke-width: 2.2; stroke-linejoin: round; transition: fill-opacity .2s; }
.radar-series circle { fill: var(--slot); }
.radar-series:hover polygon { fill-opacity: .32; }
.radar-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 8px; font-size: .88rem; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item i { width: 12px; height: 12px; border-radius: 3px; background: var(--slot); }
.affinity-list { display: grid; gap: 14px; }
.affinity-list.compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.affinity { display: block; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
a.affinity:hover { border-color: var(--red-2); }
.affinity-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.affinity-top strong { font: 800 1.2rem var(--font-head); color: var(--green-2); }
.affinity p { margin: 6px 0 0; }
.affinity-label { color: var(--text-2); font-size: .9rem; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; width: calc(var(--score) * 1%); border-radius: inherit; background: linear-gradient(90deg, var(--red-2), var(--amber) 55%, var(--green-2)); background-size: calc(10000% / max(var(--score), 1)) 100%; transition: width .6s; }

.compare-table-wrap { margin-bottom: 24px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.table-toolbar h2 { margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; color: var(--text-2); user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked { background: var(--red); border-color: var(--red); }
.switch input:checked::after { left: 18px; background: #fff; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--line); }
.compare-table { width: 100%; border-collapse: collapse; min-width: calc(180px + var(--cols) * 190px); background: var(--surface); }
.compare-table th, .compare-table td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.compare-table thead th { background: var(--surface-2); font: 700 .95rem var(--font-head); border-bottom: 2px solid var(--line-2); position: sticky; top: 0; }
.compare-table thead th[class^="s"] { box-shadow: inset 0 3px 0 var(--slot); }
.compare-table tbody th[scope="row"] { width: 180px; font-weight: 600; color: var(--text-2); font-size: .92rem; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.compare-table .group-row th { background: var(--bg-2); color: var(--red-2); font: 700 .75rem var(--font); text-transform: uppercase; letter-spacing: .12em; padding: 10px 16px; position: static; }
.compare-table td strong { display: block; }
.compare-table td small { display: block; color: var(--muted); font-size: .84rem; margin-top: 4px; line-height: 1.45; }
.compare-table td small.text { color: var(--text-2); font-size: .88rem; }
.compare-table td.best { background: linear-gradient(90deg, var(--green-soft), transparent); box-shadow: inset 3px 0 0 var(--green-2); }
.compare-table td .chip { margin: 0 4px 4px 0; }
.diff-only .compare-table tr.is-same { display: none; }
.bar { display: block; height: 6px; background: var(--surface-3); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--red-2); border-radius: inherit; }
.script-sample { display: block; font-size: 1.05rem; letter-spacing: .02em; color: var(--text); word-break: break-word; }
.phrase { font-size: 1.1rem; font-weight: 600; }
.speak { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 2px 7px; cursor: pointer; font-size: .85rem; margin-left: 6px; vertical-align: middle; line-height: 1.5; }
.speak:hover { border-color: var(--red-2); }
.speak.playing { background: var(--red); border-color: var(--red); }
.hint { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 6px; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: .7rem; cursor: help; position: relative; vertical-align: middle; }
.hint:hover::after, .hint:focus::after { content: attr(data-tip); position: absolute; left: 22px; top: -6px; width: 230px; padding: 10px 12px; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); font-size: .8rem; font-weight: 400; line-height: 1.45; z-index: 5; box-shadow: var(--shadow); }
.compare-more { margin-top: 32px; }
.deep-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 24px; }
.deep-link { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; margin-bottom: 8px; }
.deep-link .glyph { --c: inherit; }
.deep-link:hover { border-color: var(--red-2); }
.deep-link small { display: block; color: var(--muted); font-size: .82rem; }
.prose-block { max-width: 860px; color: var(--text-2); }
.prose-block h2 { color: var(--text); }
.prose-block li { margin-bottom: 8px; }

/* ---------- Explorar ---------- */
.filters { position: sticky; top: 68px; z-index: 10; padding: 16px; margin-bottom: 20px; background: rgba(28, 22, 23, .95); backdrop-filter: blur(8px); border: 1px solid var(--line-2); border-radius: 18px; }
.filter-search input { font-size: 1.05rem; }
.filter-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 10px; margin-top: 10px; align-items: end; }
.filter-row label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.filter-row select { text-transform: none; letter-spacing: 0; font-size: .92rem; font-weight: 400; padding: 9px 32px 9px 12px; }
.filter-row .check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 10px; text-transform: none; font-size: .9rem; letter-spacing: 0; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.check input { accent-color: var(--red-2); width: 16px; height: 16px; }
.filter-foot { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.result-count { margin: 0; font-size: .9rem; color: var(--muted); }
.result-count strong { color: var(--text); }

/* ---------- Rankings ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 18px; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); cursor: pointer; font-weight: 600; font-size: .88rem; }
.tabs button[aria-selected="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.tab-panel { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.tab-panel > p { color: var(--text-2); max-width: 760px; }
.rank-list { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 8px; }
.rank-list li { display: grid; grid-template-columns: 34px 190px 1fr 170px; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; transition: background .15s; }
.rank-list li:hover { background: var(--surface-2); }
.rank-list li.extra { display: none; }
.rank-list.show-all li.extra { display: grid; }
.rank-pos { font: 800 1rem var(--font-head); color: var(--muted); text-align: center; }
.rank-list li:nth-child(-n+3) .rank-pos { color: var(--amber); }
.rank-name { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.rank-name .glyph { --c: inherit; }
.rank-bar { height: 12px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; width: 0; background: var(--c); border-radius: inherit; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.tab-panel:not([hidden]) .rank-bar span { width: var(--w); }
.rank-value { font-size: .88rem; color: var(--text-2); text-align: right; }

/* ---------- Descobrir ---------- */
.discover { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.discover-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px; margin: 0 0 14px; min-width: 0; }
.discover-form legend, .discover-form .two-col legend { font: 700 1rem var(--font-head); padding: 0; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; float: left; width: 100%; }
.discover-form legend + * { clear: both; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-size: .8rem; }
.interest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.interest { cursor: pointer; }
.interest input { position: absolute; opacity: 0; pointer-events: none; }
.interest > span { display: flex; flex-direction: column; height: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); transition: .15s; }
.interest b { font-size: 1.3rem; }
.interest strong { font-size: .9rem; }
.interest small { font-size: .75rem; color: var(--muted); line-height: 1.35; }
.interest input:checked + span { border-color: var(--red-2); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red-2); }
.interest input:focus-visible + span { outline: 2px solid var(--red-2); }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented label { cursor: pointer; flex: 1 1 auto; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: .9rem; font-weight: 500; }
.segmented input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--red-2); }
.segmented.small span { padding: 6px 12px; font-size: .85rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; accent-color: var(--red-2); }
.range output { font-weight: 700; min-width: 44px; }
.discover-results { position: sticky; top: 84px; }
.reco-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.reco { --c: var(--red-2); display: grid; grid-template-columns: 30px 56px 1fr; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); animation: pop .35s ease both; }
.reco:nth-child(2) { animation-delay: .04s; } .reco:nth-child(3) { animation-delay: .08s; } .reco:nth-child(4) { animation-delay: .12s; } .reco:nth-child(5) { animation-delay: .16s; } .reco:nth-child(6) { animation-delay: .2s; }
.reco-top { border-color: var(--red-2); background: linear-gradient(140deg, var(--red-soft), var(--surface) 60%); }
.reco-rank { font: 800 1.3rem var(--font-head); color: var(--muted); }
.reco-top .reco-rank { color: var(--red-2); }
.reco h3 { margin: 0; }
.reco h3 a { color: var(--text); }
.reco-score { margin: 8px 0 6px; font-size: .88rem; color: var(--text-2); }
.reco-reasons { margin: 0 0 8px; padding-left: 18px; font-size: .88rem; color: var(--text-2); }
.reco-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Quiz ---------- */
.quiz { max-width: 760px; }
.page-quiz .page-head { text-align: center; }
.page-quiz .page-head .lead { margin: 0 auto; }
.page-quiz .prose-block { margin-left: auto; margin-right: auto; max-width: 760px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.quiz-score { display: flex; gap: 16px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.quiz-score strong { color: var(--text); }
.quiz-progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
.quiz-progress span { display: block; height: 100%; width: 0; background: var(--red-2); transition: width .4s; }
.quiz-card, .quiz-end { padding: 32px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line-2); text-align: center; }
.quiz-type { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--muted); font-weight: 700; }
.quiz-text { font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 700; line-height: 1.3; margin: 10px 0 18px; word-break: break-word; }
.quiz-translation { color: var(--muted); }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.quiz-option { padding: 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line-2); font-weight: 600; font-size: 1rem; cursor: pointer; transition: .15s; }
.quiz-option:hover:not(:disabled) { border-color: var(--red-2); transform: translateY(-1px); }
.quiz-option.correct { background: var(--green-soft); border-color: var(--green-2); color: var(--green-2); }
.quiz-option.wrong { background: var(--red-soft); border-color: var(--red-2); color: var(--red-2); animation: shake .35s; }
.quiz-option:disabled { cursor: default; }
.quiz-feedback { text-align: left; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 16px; font-size: .92rem; color: var(--text-2); }
.quiz-final { font-size: 1.3rem; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- Frases ---------- */
.phrase-picker { display: grid; gap: 10px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.phrase-cat { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.phrase-cat-label { width: 110px; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.phrase-tools { display: grid; grid-template-columns: 1fr auto 220px; gap: 12px; align-items: center; margin: 16px 0; }
.phrase-current { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 24px 0 16px; }
.phrase-current span { color: var(--red-2); }
.phrase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.phrase-card { --c: var(--red-2); position: relative; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--c); }
.phrase-card.flash { animation: pop .3s ease; }
.phrase-lang { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.phrase-lang .glyph { --c: inherit; }
.phrase-text { font-size: 1.35rem; font-weight: 700; margin: 10px 0 4px; line-height: 1.35; word-break: break-word; }
.phrase-roman { font-size: .88rem; color: var(--text-2); margin: 0; }
.hide-roman .phrase-roman { display: none; }
.phrase-card .speak { position: absolute; top: 12px; right: 12px; }
.family-heading { grid-column: 1 / -1; margin: 16px 0 0; font-size: 1rem; color: var(--muted); }

/* ---------- Mapa ---------- */
.world-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.world-controls label { font-weight: 600; }
.world-controls select { max-width: 360px; }
.world-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.world-map-wrap { padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.world-map { height: 480px; }
.mini-map { height: 320px; margin: 12px 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.world-panel { padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); max-height: 560px; overflow-y: auto; }
.world-panel h2 { font-size: 1.3rem; }
.world-panel ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.world-panel li a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); }
.world-panel li small { color: var(--muted); }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .82rem; color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--lg); }
.lg.oficial, .lg.c3 { --lg: #ff5b3d; } .lg.cooficial, .lg.c2 { --lg: #f2b134; } .lg.regional { --lg: #4fb3d9; } .lg.minoritario { --lg: #8c7a77; } .lg.c1 { --lg: #7a3b2f; }
.jvm-tooltip { background: var(--surface-3) !important; border: 1px solid var(--line-2) !important; color: var(--text) !important; font: 500 .85rem var(--font) !important; border-radius: 8px !important; padding: 6px 10px !important; box-shadow: var(--shadow) !important; }
.jvm-zoom-btn { background: var(--surface-3) !important; color: var(--text) !important; border-radius: 6px !important; }
.country-table { display: grid; gap: 8px; }
.country-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.country-row small { color: var(--muted); }

/* ---------- Famílias ---------- */
.family-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.family-card { --c: var(--red-2); padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); }
.family-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.family-card h2 a { color: var(--text); }
.family-card > p { color: var(--text-2); }
.family-actions { display: flex; gap: 20px; margin-top: 16px; }
.matrix { min-width: 500px; }
.matrix td { text-align: center; background: color-mix(in srgb, var(--green-2) calc(var(--score, 0) * .35%), var(--surface)); }
.matrix td a { color: var(--text); font-weight: 600; }
.matrix td.self { color: var(--muted); }

/* ---------- Página de idioma ---------- */
.lang-hero { padding: 36px 0 28px; background: radial-gradient(900px 400px at 10% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); border-bottom: 1px solid var(--line); }
.lang-hero-inner { display: grid; grid-template-columns: 180px 1fr; gap: 32px; align-items: center; }
.lang-hero-glyph { display: grid; place-items: center; aspect-ratio: 1; border-radius: 32px; font-size: 5.5rem; font-weight: 800; color: color-mix(in srgb, var(--c) 55%, #fff); background: color-mix(in srgb, var(--c) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); box-shadow: var(--shadow); }
.lang-hero h1 { margin: 14px 0 4px; }
.lang-native { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 1.4rem; font-weight: 600; color: var(--text-2); }
.lang-native small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.facts-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 24px 0 0; }
.facts-grid div { padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.facts-grid dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts-grid dd { margin: 4px 0 0; font-weight: 700; font-size: 1rem; }
.lang-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; margin-top: 36px; }
.toc-inner { position: sticky; top: 90px; }
.toc-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.toc nav { display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc nav a { padding: 6px 14px; color: var(--muted); font-size: .9rem; border-left: 2px solid transparent; margin-left: -1px; text-decoration: none; }
.toc nav a:hover { color: var(--text); }
.toc nav a.active { color: var(--text); border-left-color: var(--red-2); }
.prose { max-width: 780px; color: var(--text-2); font-size: 1.03rem; line-height: 1.75; }
.prose.narrow { margin-bottom: 40px; }
.prose h2, .prose h3 { color: var(--text); }
.prose h2 { margin-top: 1.6em; }
.prose section { scroll-margin-top: 90px; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.prose section:last-child { border-bottom: 0; }
.prose section > h2:first-child { margin-top: 0; }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.prose table th, .prose table td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.prose table th { background: var(--surface-2); color: var(--text); }
.prose blockquote { margin: 1em 0; padding: 12px 20px; border-left: 3px solid var(--red-2); background: var(--surface); border-radius: 0 10px 10px 0; }
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 28px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green-2); font-weight: 700; }
.timeline { list-style: none; padding: 0; margin: 16px 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 104px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: 26px; padding: 6px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 99px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--red-2)); border: 2px solid var(--bg); }
.t-year { font-weight: 700; color: var(--text); text-align: right; font-size: .9rem; }
.script-showcase { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 1.6rem; line-height: 1.8; color: var(--text); word-break: break-word; margin-bottom: 16px; }
.inline-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.inline-facts div { padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.inline-facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.inline-facts dd { margin: 0; font-weight: 600; color: var(--text); font-size: .92rem; }
.callout { padding: 14px 18px; border-radius: 12px; background: rgba(242, 177, 52, .08); border: 1px solid rgba(242, 177, 52, .3); }
.difficulty-box { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; }
.difficulty-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.difficulty-scale span { padding: 8px 4px; text-align: center; font-size: .75rem; border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.difficulty-scale span.on { background: linear-gradient(90deg, var(--green), var(--red)); background-size: 500% 100%; color: #fff; font-weight: 600; }
.difficulty-scale span.on:nth-child(1) { background-position: 0 0; } .difficulty-scale span.on:nth-child(2) { background-position: 25% 0; } .difficulty-scale span.on:nth-child(3) { background-position: 50% 0; } .difficulty-scale span.on:nth-child(4) { background-position: 75% 0; } .difficulty-scale span.on:nth-child(5) { background-position: 100% 0; }
.difficulty-verdict { margin: 12px 0 0; font-weight: 600; color: var(--text); }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .95rem; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--surface-2); color: var(--text); font-size: .85rem; }
.data-table tr:last-child td { border-bottom: 0; }
.native-cell { font-size: 1.15rem; font-weight: 600; color: var(--text); }
.numbers-row { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.numbers-row li { padding: 12px 6px; text-align: center; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.numbers-row small { display: block; color: var(--muted); font-size: .75rem; }
.numbers-row span { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.sample-sentence { margin: 24px 0; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.sample-sentence blockquote { margin: 0 0 8px; padding: 0; border: 0; background: none; font-size: 1.25rem; color: var(--text); }
.sample-sentence figcaption { font-size: .85rem; color: var(--muted); }
.curiosities { padding-left: 0; list-style: none; counter-reset: c; display: grid; gap: 12px; }
.curiosities li { counter-increment: c; position: relative; padding: 14px 16px 14px 56px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.curiosities li::before { content: counter(c); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red-2); font-weight: 800; font-size: .9rem; }
.country-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.country-groups h3 { font-size: .95rem; margin-bottom: 4px; }
.prev-next { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; margin-bottom: 40px; }
.prev-next a { display: flex; flex-direction: column; padding: 14px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); min-width: 180px; text-decoration: none !important; }
.prev-next a:hover { border-color: var(--red-2); }
.prev-next .next { text-align: right; }
.prev-next small { color: var(--muted); }

/* ---------- Guia ---------- */
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; margin-top: 16px; }
.guide-aside .panel { position: sticky; top: 90px; }
.guide-aside h2 { font-size: 1.05rem; }

/* ---------- Contato ---------- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; margin-bottom: 48px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
.contact-form label input, .contact-form label select, .contact-form label textarea { font-weight: 400; }
.hp { position: absolute; left: -9999px; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.alert p { margin: 0; }
.alert.success { background: var(--green-soft); border: 1px solid var(--green-2); color: var(--green-2); }
.alert.error { background: var(--red-soft); border: 1px solid var(--red-2); color: #ffb3a5; }

/* ---------- Anúncios ---------- */
.ad { margin: 32px auto; text-align: center; max-width: var(--wrap); padding: 0 20px; }
.ad-label { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.toc .ad { padding: 0; margin-top: 24px; }

/* ---------- Bandeja de comparação, cookies, toast ---------- */
.compare-tray { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(28, 22, 23, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line-2); padding: 10px 0; animation: slideup .25s ease; }
.tray-inner { display: flex; align-items: center; gap: 10px; }
.tray-label { font-weight: 600; font-size: .9rem; color: var(--muted); }
.tray-items { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.tray-item { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--surface-3); font-size: .88rem; white-space: nowrap; border: 1px solid var(--line-2); }
.tray-item button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: .9rem; }
.tray-clear { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 6px; }
body.has-tray { padding-bottom: 64px; }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.cookie-banner { position: fixed; left: 16px; bottom: 16px; z-index: 60; max-width: 420px; padding: 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: .9rem; color: var(--text-2); }
.cookie-actions { display: flex; gap: 8px; justify-content: flex-end; }
body.has-tray .cookie-banner { bottom: 80px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); z-index: 90; padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Rodapé ---------- */
.site-footer { margin-top: 80px; border-top: 1px solid var(--line); background: var(--bg-2); padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.footer-grid a { display: block; color: var(--text-2); padding: 3px 0; font-size: .92rem; }
.footer-brand img { height: 28px; width: auto; margin-bottom: 14px; }
.footer-brand p { color: var(--muted); font-size: .9rem; max-width: 360px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.footer-bottom p { margin: 0; }

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1080px) {
    .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pairs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facts-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .filter-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .world-layout { grid-template-columns: 1fr; }
    .discover { grid-template-columns: 1fr; }
    .discover-results { position: static; }
    .rank-list li { grid-template-columns: 30px 150px 1fr 130px; }
}

@media (max-width: 860px) {
    .menu-btn { display: grid; }
    .main-nav {
        position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
        padding: 12px 16px 20px; background: var(--bg); border-bottom: 1px solid var(--line);
        transform: translateY(-110%); transition: transform .25s; max-height: calc(100vh - 68px); overflow-y: auto; margin: 0;
    }
    body.nav-open .main-nav { transform: none; box-shadow: var(--shadow); }
    body.nav-open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    body.nav-open .menu-btn span:nth-child(2) { opacity: 0; }
    body.nav-open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
    .main-nav > a, .dropdown-toggle { padding: 13px 8px; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; width: 100%; }
    .main-nav > a.active { box-shadow: inset 3px 0 0 var(--red-2); }
    .dropdown-toggle { display: none; }
    .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; width: auto; padding: 0; background: none; border: 0; box-shadow: none; }
    .dropdown-menu a { padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
    .header-actions { margin-left: auto; }
    .hero { padding: 44px 0 36px; }
    .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool-main { grid-column: 1 / -1; grid-row: auto; }
    .continent-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .split, .about-cols, .compare-visuals, .insights, .contact-layout, .guide-layout, .family-list { grid-template-columns: 1fr; }
    .guides-grid { grid-template-columns: 1fr; }
    .day-card { grid-template-columns: 1fr; padding: 24px; gap: 18px; }
    .day-glyph { width: 120px; font-size: 4rem; }
    .lang-layout { grid-template-columns: 1fr; gap: 0; }
    .toc { display: none; }
    .lang-hero-inner { grid-template-columns: 1fr; gap: 16px; }
    .lang-hero-glyph { width: 110px; font-size: 3.4rem; border-radius: 24px; }
    .facts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filters { position: static; }
    .phrase-tools { grid-template-columns: 1fr; }
    .phrase-cat-label { width: 100%; }
    .world-map { height: 340px; }
    .country-row { grid-template-columns: 1fr; gap: 4px; }
    .two-col { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    .wrap { padding: 0 16px; }
    .section { margin-top: 48px; }
    .quick-compare { border-radius: 16px; }
    .quick-compare select, .quick-compare .btn { flex: 1 1 100%; }
    .vs { width: 100%; text-align: center; }
    .tools-grid, .pairs-grid { grid-template-columns: 1fr; }
    .continent-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cards-grid { grid-template-columns: 1fr; }
    .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-row { grid-template-columns: 1fr 1fr; }
    .picker { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
    .picker-slot { padding: 8px; }
    .picker-slot label { font-size: .65rem; letter-spacing: .04em; }
    .picker-slot select { padding: 9px 26px 9px 10px; font-size: .88rem; background-position: right 9px center; }
    .picker-actions .btn { flex: 1 1 calc(50% - 8px); }
    .compare-heads { gap: 6px; }
    .compare-head { padding: 12px 4px; }
    .compare-head .glyph { width: 40px; height: 40px; font-size: 1.2rem; }
    .compare-head strong { font-size: .9rem; }
    .compare-head .native { display: none; }
    .compare-table tbody th[scope="row"] { width: 104px; font-size: .8rem; padding: 12px 8px; }
    .compare-table th, .compare-table td { padding: 12px 8px; }
    .compare-table td { font-size: .9rem; }
    .compare-table { min-width: calc(104px + var(--cols) * 116px); }
    .hint:hover::after, .hint:focus::after { left: -10px; top: 24px; width: 200px; }
    .compare-insights, .panel, .tab-panel { padding: 18px; }
    .rank-list li { grid-template-columns: 26px 1fr auto; gap: 8px; }
    .rank-bar { grid-column: 2 / -1; grid-row: 2; height: 8px; }
    .rank-value { font-size: .8rem; }
    .quiz-card, .quiz-end { padding: 22px 16px; }
    .quiz-options { grid-template-columns: 1fr; }
    .timeline::before { left: 8px; }
    .timeline li { grid-template-columns: 1fr; gap: 0; padding-left: 30px; }
    .timeline li::before { left: 3px; }
    .t-year { text-align: left; }
    .numbers-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .reco { grid-template-columns: 24px 1fr; }
    .reco .glyph { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .cookie-banner { left: 8px; right: 8px; bottom: 8px; max-width: none; }
    .prev-next a { min-width: 0; flex: 1; }
    .tray-label { display: none; }
    .script-showcase { font-size: 1.25rem; padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
