/* ===================================================================
   PsicoLab / PsychLab — design system
   Estética: calma e serena (teal/sage), claro + escuro
   =================================================================== */

:root {
  --bg: #f4f8f7;
  --surface: #ffffff;
  --surface-2: #ecf3f1;
  --surface-3: #e2ede9;
  --ink: #21322f;
  --ink-2: #53645f;
  --ink-3: #7e8e89;
  --brand: #12876f;
  --brand-ink: #0c6b57;
  --brand-soft: #dcefe9;
  --accent: #3a6ea5;
  --accent-soft: #e4edf6;
  --accent-ink: #2c5580;
  --clay: #b8703f;
  --clay-soft: #f3e4d6;
  --clay-ink: #8f5527;
  --plum: #6f5a96;
  --plum-soft: #e9e3f2;
  --plum-ink: #55437a;
  --line: #dde7e4;
  --chart-1: #12876f;
  --chart-2: #3a6ea5;
  --grid: #e3eae7;
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --shadow: 0 1px 2px rgba(33, 50, 47, 0.05), 0 8px 24px rgba(33, 50, 47, 0.07);
  --shadow-lift: 0 2px 4px rgba(33, 50, 47, 0.06), 0 14px 36px rgba(33, 50, 47, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #0e1614;
  --surface: #182321;
  --surface-2: #1e2c29;
  --surface-3: #253632;
  --ink: #e5efec;
  --ink-2: #a9bbb6;
  --ink-3: #7b918b;
  --brand: #1aa47e;
  --brand-ink: #4cc3a2;
  --brand-soft: #16352d;
  --accent: #4a90d9;
  --accent-soft: #182c40;
  --accent-ink: #a9cdf0;
  --clay: #d6935f;
  --clay-soft: #3a2b1d;
  --clay-ink: #eab182;
  --plum: #a68fd0;
  --plum-soft: #2b2239;
  --plum-ink: #c8b3ea;
  --line: #263a36;
  --chart-1: #1aa47e;
  --chart-2: #4a90d9;
  --grid: #223330;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.3), 0 14px 36px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(1100px 480px at 15% -8%, var(--brand-soft), transparent 60%),
                    radial-gradient(900px 420px at 95% -12%, var(--accent-soft), transparent 55%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

::selection { background: var(--brand-soft); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 0.5em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin: 1.6em 0 0.6em; }
h3 { font-size: 1.15rem; margin: 1.2em 0 0.4em; }

p { margin: 0.4em 0 1em; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 720px; }

.muted { color: var(--ink-2); }
.small { font-size: 0.88rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.mt-2 { margin-top: 2rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.whatsnew-banner { background: var(--brand-soft); border-bottom: 1px solid var(--line); }
.whatsnew-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 22px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  text-align: center;
}
.whatsnew-inner span { color: var(--brand-ink); font-weight: 700; font-size: 0.92rem; }
.whatsnew-inner button {
  border: none; background: none; cursor: pointer; flex-shrink: 0;
  color: var(--brand-ink); opacity: 0.65; font-size: 1rem; line-height: 1; padding: 4px;
  transition: opacity 0.2s;
}
.whatsnew-inner button:hover { opacity: 1; }
.site-header .bar {
  display: flex; align-items: center; gap: 14px;
  max-width: 1080px; margin: 0 auto; padding: 10px 22px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  color: var(--ink); text-decoration: none; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo .mark { display: grid; place-items: center; }
.logo .mark img { width: 36px; height: 36px; object-fit: contain; }
.main-nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; }
.main-nav a {
  padding: 8px 13px; border-radius: 999px; white-space: nowrap;
  color: var(--ink-2); font-weight: 700; font-size: 0.94rem;
}
.main-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.main-nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); width: 38px; height: 38px; border-radius: 12px;
  font-size: 1rem; cursor: pointer; display: grid; place-items: center;
  font-family: var(--font-body); font-weight: 800;
  transition: background 0.2s, transform 0.15s;
}
.icon-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.lang-toggle {
  display: flex; align-items: center; gap: 2px; height: 38px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 3px;
}
.lang-opt {
  display: flex; align-items: center; gap: 5px; height: 30px;
  border: none; border-radius: 999px; padding: 0 10px;
  background: transparent; color: var(--ink-3); cursor: pointer;
  font-family: var(--font-body); font-weight: 800; font-size: 0.8rem;
  transition: background 0.2s, color 0.2s;
}
.lang-opt .flag { display: block; border-radius: 3px; opacity: 0.55; filter: grayscale(45%); transition: opacity 0.2s, filter 0.2s; }
.lang-opt:hover { color: var(--ink); }
.lang-opt.active { background: var(--brand-soft); color: var(--brand-ink); }
.lang-opt.active .flag { opacity: 1; filter: none; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 30px; text-align: center; }
.hero-emblem { width: 130px; height: auto; display: block; margin: 0 auto 14px; }
.hero-banner-wrap { max-width: 900px; margin: 0 auto 4px; }
.hero-banner {
  display: block; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 14%, black 86%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 14%, black 86%, transparent 100%);
}
.hero-banner-dark { display: none; }
html[data-theme="dark"] .hero-banner-light { display: none; }
html[data-theme="dark"] .hero-banner-dark { display: block; }
.hero .kicker {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-ink);
  font-weight: 800; font-size: 0.85rem; letter-spacing: 0.04em;
  text-transform: uppercase; margin-bottom: 20px;
}
.hero p.lead { font-size: 1.18rem; color: var(--ink-2); max-width: 620px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 800; font-size: 1rem;
  background: var(--brand); color: #fff;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 8px 18px; font-size: 0.9rem; }
.btn-danger { background: transparent; border: 1px solid var(--line); color: var(--critical); }
.btn-danger:hover { background: color-mix(in srgb, var(--critical) 8%, transparent); }

/* ---------- section headings ---------- */
.section-head { display: flex; align-items: center; gap: 16px; margin: 3rem 0 1.1rem; }
.section-head h2 { margin: 0; }
.section-head .sub { color: var(--ink-2); font-size: 0.95rem; display: block; margin-top: 2px; }
.section-sig { width: 52px; height: 52px; border-radius: 15px; background: var(--tag-accent-soft, var(--brand-soft)); color: var(--tag-accent-ink, var(--brand-ink)); display: grid; place-items: center; flex-shrink: 0; }
.section-sig svg { width: 28px; height: 28px; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 14px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 9px;
  color: var(--ink); text-decoration: none;
  transition: transform 0.18s, box-shadow 0.25s, border-color 0.2s;
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--brand); text-decoration: none; }
.card .icon {
  width: 58px; height: 58px; border-radius: 17px;
  background: var(--tag-accent-soft, var(--brand-soft)); color: var(--tag-accent-ink, var(--brand-ink));
  display: grid; place-items: center; flex-shrink: 0;
}
.card .icon svg { width: 30px; height: 30px; }
.card h3 { margin: 0; font-size: 0.98rem; line-height: 1.3; }
.card .hint { margin: 0; color: var(--ink-2); font-size: 0.85rem; line-height: 1.4; }
.chip {
  font-size: 0.76rem; font-weight: 800; padding: 3px 11px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
}

/* ---------- panel (generic content box) ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  margin: 1.2rem 0;
}
.panel-soft { background: var(--surface-2); border: none; box-shadow: none; }

/* ---------- forms ---------- */
label.field-label { display: block; font-weight: 800; font-size: 0.92rem; margin: 1rem 0 0.4rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
textarea, select {
  width: 100%; padding: 13px 16px; border-radius: 13px;
  border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink);
  font-family: var(--font-body); font-size: 0.98rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):hover,
textarea:hover, select:hover { border-color: var(--ink-3); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand); background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"] { accent-color: var(--brand); width: 18px; height: 18px; }
input[type="range"] { width: 100%; accent-color: var(--brand); padding: 0; border: none; background: none; }

/* ---------- quiz ---------- */
.progress-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: 22px; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width 0.35s ease; }
.quiz-q { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; margin: 0.4em 0 1em; min-height: 2.4em; }
.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.likert button, .opt-btn {
  padding: 13px 8px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); font-family: var(--font-body); font-weight: 700; font-size: 0.86rem;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.likert button:hover, .opt-btn:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.likert button.sel, .opt-btn.sel { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.opt-list { display: grid; gap: 10px; }
.opt-btn { text-align: left; font-size: 0.97rem; padding: 14px 18px; }
.opt-btn.correct { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.opt-btn.wrong { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 10%, var(--surface)); }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 22px; gap: 10px; }
.scale-hints { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--ink-3); margin-top: 6px; }

/* ---------- result bars ---------- */
.rbar { margin: 14px 0; }
.rbar .rbar-head { display: flex; justify-content: space-between; font-weight: 800; font-size: 0.95rem; margin-bottom: 5px; }
.rbar .rbar-head .val { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rbar .track { height: 14px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.rbar .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--chart-1); transition: width 0.8s cubic-bezier(0.2, 0.7, 0.3, 1); }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 1rem 0; }
.tile {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 16px 18px; text-align: center;
}
.tile .num { font-size: 1.9rem; font-weight: 800; color: var(--brand-ink); line-height: 1.15; }
.tile .lbl { font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }

/* ---------- interpretation blocks ---------- */
.interp { border-left: 4px solid var(--brand); padding: 4px 0 4px 18px; margin: 18px 0; }
.interp h3 { margin: 0 0 2px; }
.interp p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

.notice {
  border-radius: var(--radius-sm); padding: 14px 18px; font-size: 0.9rem;
  background: var(--accent-soft); color: var(--ink-2); margin: 1.2rem 0;
}
.notice strong { color: var(--ink); }

/* ---------- status badge (gauge zones) ---------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; padding: 7px 16px; border-radius: 999px; font-size: 0.95rem;
  background: var(--surface-2);
}

/* ---------- charts ---------- */
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-wrap text { font-family: var(--font-body); }
.viz-tooltip {
  position: absolute; pointer-events: none; z-index: 10;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: 0.84rem; box-shadow: var(--shadow-lift);
  opacity: 0; transition: opacity 0.12s; white-space: nowrap;
}
.viz-tooltip.show { opacity: 1; }
.viz-tooltip .tt-title { font-weight: 800; }
.viz-tooltip .tt-val { color: var(--ink-2); }

/* ---------- contentores com scroll horizontal (tabelas largas em ecrãs pequenos) ---------- */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll.has-more::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 30px;
  background: linear-gradient(to right, transparent, var(--surface));
  pointer-events: none;
}
/* ---------- data table ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th { text-align: left; color: var(--ink-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }

/* ---------- mood picker ---------- */
.mood-row { display: flex; gap: 10px; justify-content: center; margin: 14px 0; }
.mood-btn {
  font-size: 2rem; width: 62px; height: 62px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--surface); cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  display: grid; place-items: center; filter: grayscale(0.55);
}
.mood-btn:hover { transform: scale(1.12); filter: none; }
.mood-btn.sel { border-color: var(--brand); background: var(--brand-soft); filter: none; transform: scale(1.12); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-btn {
  padding: 7px 15px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: 0.88rem;
  transition: all 0.15s;
}
.tag-btn.sel {
  border-color: var(--tag-accent, var(--brand)); background: var(--tag-accent-soft, var(--brand-soft));
  color: var(--tag-accent-ink, var(--brand-ink));
}

/* ---------- hub: search, subgroups, continue strip (homepage) ---------- */
.hub-search { display: block; position: relative; max-width: 460px; margin: 1.6rem auto 0; }
.hub-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.hub-search input#hub-search { padding-left: 40px; width: 100%; }
.hub-count { text-align: center; color: var(--ink-3); font-size: 0.85rem; margin: 8px 0 0; }

.hub-continue { margin: 2.6rem 0 0; }
.hub-continue-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hub-continue-head h2 { margin: 0; font-size: 1.25rem; }
.hub-continue-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.hub-continue-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; display: block;
}
a.hub-continue-card:hover { border-color: var(--brand); text-decoration: none; }
.hub-continue-card .cline { font-size: 0.76rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--brand-ink); margin-bottom: 6px; }
.hub-continue-card h3 { margin: 0; font-size: 1.02rem; font-family: var(--font-body); }
.hub-continue-card p { margin: 4px 0 0; font-size: 0.88rem; color: var(--ink-2); }

.subgroup { margin-top: 26px; }
.subgroup-title {
  display: flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--tag-accent-ink, var(--brand-ink)); margin-bottom: 14px;
}
.subgroup-title svg { flex-shrink: 0; }

.subgroup-acc {
  margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); overflow: hidden;
}
.subgroup-acc.hidden { display: none; }
.subgroup-acc summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--tag-accent-ink, var(--brand-ink)); user-select: none;
}
.subgroup-acc summary::-webkit-details-marker { display: none; }
.subgroup-acc summary .chev { transition: transform 0.2s; flex-shrink: 0; color: var(--ink-3); }
.subgroup-acc[open] summary .chev { transform: rotate(90deg); }
.subgroup-acc summary .count {
  margin-left: auto; font-size: 0.74rem; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: var(--surface); color: var(--ink-2); text-transform: none; letter-spacing: 0;
}
.subgroup-acc summary:hover { background: color-mix(in srgb, var(--tag-accent-ink, var(--brand-ink)) 6%, transparent); }
.subgroup-acc .cards { padding: 4px 16px 18px; background: var(--surface); }

.hub-empty { display: none; text-align: center; color: var(--ink-2); padding: 26px; border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 20px; }
.hub-empty.show { display: block; }

/* ---------- entry list ---------- */
.entry {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 20px; margin: 10px 0;
}
.entry .entry-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.entry .entry-date { font-weight: 800; font-size: 0.88rem; color: var(--ink-2); }
.entry .del {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--ink-3); font-size: 1rem; padding: 4px; border-radius: 6px;
}
.entry .del:hover { color: var(--critical); background: var(--surface-2); }

/* ---------- breathing ---------- */
.breath-stage { display: grid; place-items: center; padding: 40px 0 20px; }
.breath-circle {
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--brand) 55%, var(--surface)), var(--brand));
  box-shadow: 0 0 0 22px var(--brand-soft), 0 0 70px color-mix(in srgb, var(--brand) 35%, transparent);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.15rem;
  transform: scale(0.72);
}
.breath-phase-label { text-align: center; font-family: var(--font-display); font-size: 1.5rem; margin-top: 34px; min-height: 1.5em; }

/* ---------- meditation ring ---------- */
.ring-wrap { display: grid; place-items: center; padding: 24px 0; position: relative; }
.ring-wrap .ring-center {
  position: absolute; text-align: center;
}
.ring-wrap .ring-center .time { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- habit grid ---------- */
.habit-table { width: 100%; border-collapse: collapse; }
.habit-table th { font-size: 0.75rem; color: var(--ink-3); font-weight: 700; padding: 6px 4px; text-align: center; }
.habit-table td { padding: 8px 4px; text-align: center; border-top: 1px solid var(--line); }
.habit-table td.habit-name { text-align: left; font-weight: 700; font-size: 0.93rem; }
.check-cell {
  width: 30px; height: 30px; border-radius: 9px; border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 0.95rem;
  transition: all 0.15s;
}
.check-cell.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.check-cell:disabled { opacity: 0.35; cursor: default; }
.streak-flame { font-size: 0.85rem; font-weight: 800; color: var(--brand-ink); white-space: nowrap; }

/* ---------- games ---------- */
.game-stage {
  min-height: 300px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; text-align: center;
  border-radius: var(--radius); padding: 30px;
}
.stroop-word { font-size: clamp(3rem, 10vw, 4.6rem); font-weight: 800; font-family: var(--font-body); letter-spacing: 0.02em; }
.color-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 560px; }
.color-btns .opt-btn { text-align: center; font-weight: 800; }
.reaction-zone {
  width: 100%; min-height: 300px; border-radius: var(--radius); cursor: pointer;
  display: grid; place-items: center; color: #fff; font-size: 1.35rem; font-weight: 800;
  user-select: none; -webkit-user-select: none; transition: background 0.1s;
  padding: 24px; text-align: center;
}
.big-emoji { font-size: 5rem; line-height: 1; }
.scenario-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 18px 22px; font-size: 1.05rem; max-width: 560px; }

.payoff { border-collapse: collapse; margin: 0 auto; font-size: 0.88rem; }
.payoff th, .payoff td { border: 1px solid var(--line); padding: 10px 14px; text-align: center; }
.payoff th { background: var(--surface-2); font-size: 0.8rem; }
.payoff td strong { color: var(--brand-ink); }

.story-text { font-size: 1.08rem; max-width: 640px; margin: 0 auto; }
.meter { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; font-weight: 800; color: var(--ink-2); }
.meter .track { flex: 1; height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter .fill { height: 100%; border-radius: 999px; transition: width 0.5s; }

/* ---------- feedback flash ---------- */
.flash-ok { animation: flashok 0.45s; }
.flash-bad { animation: flashbad 0.45s; }
@keyframes flashok { 0% { background: color-mix(in srgb, var(--good) 22%, var(--surface)); } 100% { background: var(--surface); } }
@keyframes flashbad { 0% { background: color-mix(in srgb, var(--critical) 18%, var(--surface)); } 100% { background: var(--surface); } }
.btn.tapped { animation: taptap 0.3s ease; }
@keyframes taptap { 0% { transform: scale(0.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* ---------- glossary ---------- */
.search-bar { position: relative; margin: 1rem 0 1.4rem; }
.search-bar input { padding-left: 44px; font-size: 1.05rem; padding-top: 13px; padding-bottom: 13px; }
.search-bar::before { content: "🔍"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: 0.6; }
.term { padding: 16px 0; border-bottom: 1px solid var(--line); }
.term h3 { margin: 0 0 4px; font-size: 1.05rem; }
.term .alt-lang { font-weight: 400; color: var(--ink-3); font-size: 0.9rem; font-style: italic; }
.term p { margin: 0; color: var(--ink-2); font-size: 0.94rem; }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px;
  background: linear-gradient(var(--brand), var(--accent));
}
.tl-item { position: relative; margin-bottom: 26px; }
.tl-item::before {
  content: ""; position: absolute; left: -30px; top: 7px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--brand); border: 3px solid var(--bg);
}
.tl-item .year { font-weight: 800; color: var(--brand-ink); font-size: 0.95rem; }
.tl-item h3 { margin: 2px 0 4px; font-size: 1.08rem; }
.tl-item p { margin: 0; color: var(--ink-2); font-size: 0.93rem; }

/* ---------- articles ---------- */
.article-card .article-head { cursor: pointer; }
.article-body { display: none; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.article-card.open .article-body { display: block; }
.article-body p { color: var(--ink-2); font-size: 0.97rem; }
.article-body h3 { font-size: 1.02rem; }

/* ---------- conta / autenticação ---------- */
.auth-card {
  display: grid; grid-template-columns: 0.85fr 1.15fr;
  padding: 0; overflow: hidden;
}
.auth-side {
  background: linear-gradient(155deg, var(--brand), var(--accent));
  color: #fff; padding: 36px 30px;
  display: flex; flex-direction: column; gap: 14px;
}
.auth-side h2 { color: #fff; margin: 0; font-size: 1.5rem; }
.auth-side .sub { margin: 0; opacity: 0.92; font-size: 0.95rem; }
.auth-side ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; font-size: 0.92rem; }
.auth-side li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.auth-main { padding: 32px 30px; }
.seg { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 22px; }
.seg button {
  flex: 1; border: none; background: transparent; padding: 10px 8px; border-radius: 999px;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 800; color: var(--ink-2);
  cursor: pointer; transition: all 0.2s;
}
.seg button.active { background: var(--surface); color: var(--brand-ink); box-shadow: var(--shadow); }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 48px; }
.pass-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; font-size: 1.05rem;
  padding: 7px 9px; border-radius: 9px; color: var(--ink-3);
}
.pass-eye:hover { background: var(--surface-2); }
.privacy-steps { display: grid; gap: 16px; }
.privacy-step { display: flex; gap: 14px; align-items: flex-start; }
.privacy-step .ico {
  width: 44px; height: 44px; border-radius: 13px; background: var(--brand-soft);
  display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0;
}
.privacy-step h4 { margin: 0 0 3px; font-size: 0.98rem; font-family: var(--font-body); font-weight: 800; }
.privacy-step p { margin: 0; font-size: 0.92rem; color: var(--ink-2); }
.acct-head { display: flex; gap: 16px; align-items: center; }
.share-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.conn-card { margin-top: 14px; }
.recovery-code-box {
  font-family: monospace; font-size: 1.25rem; font-weight: 700; letter-spacing: 0.06em;
  background: var(--surface-2); border: 1.5px dashed var(--brand); border-radius: var(--radius-sm);
  padding: 18px 20px; text-align: center; word-break: break-all; color: var(--brand-ink);
  user-select: all;
}
.avatar {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.35rem;
  text-transform: uppercase;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 96px; height: 96px; font-size: 2.2rem; }

/* ---------- carregar e recortar foto de perfil ---------- */
dialog.crop-dialog {
  border: none; border-radius: var(--radius); padding: 28px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift);
  max-width: 380px; width: calc(100% - 40px);
}
dialog.crop-dialog::backdrop { background: rgba(15, 23, 21, 0.55); backdrop-filter: blur(2px); }
.crop-stage {
  position: relative; width: 260px; height: 260px; margin: 16px auto;
  border-radius: 50%; overflow: hidden; background: var(--surface-2);
  cursor: grab; touch-action: none; box-shadow: 0 0 0 4px var(--surface-2), 0 0 0 5px var(--line);
}
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; -webkit-user-drag: none; }
.crop-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@media (max-width: 760px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-side { padding: 26px 22px; }
  .auth-main { padding: 24px 20px; }
}

/* ---------- feed de artigos ---------- */
.feed-item { padding: 20px 22px; }
.feed-head { display: flex; gap: 16px; align-items: flex-start; }
.feed-thumb { width: 132px; height: 96px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.article-content { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 6px; font-size: 0.97rem; color: var(--ink-2); }
.article-content img { max-width: 100%; height: auto; border-radius: 12px; }
.article-content figcaption { font-size: 0.8rem; color: var(--ink-3); margin-top: 4px; }
.article-content h2, .article-content h3, .article-content h4 { color: var(--ink); }
.attribution {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 0.84rem; color: var(--ink-2); margin-top: 18px;
}
@media (max-width: 600px) {
  .feed-head { flex-direction: column; }
  .feed-thumb { width: 100%; height: 150px; }
}

/* ---------- footer ---------- */
.site-footer { margin-top: 5rem; border-top: 1px solid var(--line); padding: 2.4rem 0 3rem; }
.site-footer .disclaimer {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 16px 20px; font-size: 0.86rem; color: var(--ink-2); margin-bottom: 1.4rem;
}
.site-footer .foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.86rem; color: var(--ink-3); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 12px 24px; border-radius: 999px;
  font-weight: 700; font-size: 0.92rem; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; z-index: 100; box-shadow: var(--shadow-lift);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- page hero (interior pages) ---------- */
.page-hero { padding: 46px 0 8px; }
.page-hero .crumb { font-size: 0.85rem; font-weight: 800; color: var(--brand-ink); text-transform: uppercase; letter-spacing: 0.05em; }
.page-hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0.25em 0 0.3em; }
.page-hero h1 img { height: 0.85em; width: auto; vertical-align: -0.1em; margin-right: 0.12em; }
.page-hero p { color: var(--ink-2); max-width: 640px; margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .site-header .bar { flex-wrap: wrap; padding: 10px 14px; }
  .main-nav { order: 3; width: 100%; margin-left: 0; }
  .hero { padding: 44px 0 20px; }
  .likert { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .likert button { padding: 11px 2px; font-size: 0.72rem; }
  .color-btns { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 20px; }
  .section-sig { width: 44px; height: 44px; }
  .section-sig svg { width: 24px; height: 24px; }
}

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