@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #F7F1E4;
  --surface: #FFFDF8;
  --surface-alt: #EFE4CD;
  --ink: #241539;
  --ink-soft: #5B4C72;
  --muted: #8B7FA0;
  --primary: #3E1E6B;
  --primary-deep: #241049;
  --primary-strong: #5B2E8C;
  --on-primary: #FBF6EA;
  --gold: #D99A3F;
  --gold-soft: #F0BE6E;
  --wine: #7C2C3B;
  --wine-soft: #C97A88;
  --border: rgba(36,21,57,0.14);
  --border-soft: rgba(36,21,57,0.08);
  --success: #3E7A4E;
  --shadow: 0 1px 2px rgba(36,16,73,0.06), 0 8px 24px -12px rgba(36,16,73,0.22);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: Verdana, Geneva, 'DejaVu Sans', sans-serif;
  --font-body: Verdana, Geneva, 'DejaVu Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Cores de marca (faixa roxa do topo/rodapé/hero/tela de login e botão
     Ouvidoria): ficam FIXAS nos dois temas de propósito — são a
     identidade visual do DAAE, não conteúdo que deva inverter. Nunca são
     redefinidas dentro dos blocos de tema escuro abaixo. */
  --brand-deep: #241049;
  --brand-mid: #3E1E6B;
  --brand-strong: #5B2E8C;
  --on-brand: #FBF6EA;
  --brand-wine: #7C2C3B;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #160B27;
    --surface: #1F1236;
    --surface-alt: #291842;
    --ink: #F3ECE0;
    --ink-soft: #C6B9DC;
    --muted: #9986BC;
    --primary: #B9A0E8;
    --primary-deep: #0E0620;
    --primary-strong: #8B5FBF;
    --on-primary: #1A0E30;
    --gold: #F0BE6E;
    --gold-soft: #F6D496;
    --wine: #E395A3;
    --wine-soft: #C97A88;
    --border: rgba(243,236,224,0.16);
    --border-soft: rgba(243,236,224,0.09);
    --success: #7FCB93;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 30px -14px rgba(0,0,0,0.6);
  }
}
:root[data-theme="dark"] {
  --bg: #160B27;
  --surface: #1F1236;
  --surface-alt: #291842;
  --ink: #F3ECE0;
  --ink-soft: #C6B9DC;
  --muted: #9986BC;
  --primary: #B9A0E8;
  --primary-deep: #0E0620;
  --primary-strong: #8B5FBF;
  --on-primary: #1A0E30;
  --gold: #F0BE6E;
  --gold-soft: #F6D496;
  --wine: #E395A3;
  --wine-soft: #C97A88;
  --border: rgba(243,236,224,0.16);
  --border-soft: rgba(243,236,224,0.09);
  --success: #7FCB93;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 30px -14px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
/* Rede de segurança contra estouro horizontal (ex.: alguém com muitas
   tags empurrando a barra do topo para o lado) — nunca deixa a página
   inteira rolar para os lados por causa de um elemento largo demais. */
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; color: var(--ink); margin: 0 0 .4em; }
a { color: inherit; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); font-weight: 500; }
.fine-print { color: var(--muted); font-size: .85rem; margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-mid) 65%, var(--brand-strong));
  color: var(--on-brand);
  box-shadow: var(--shadow);
}
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--on-brand); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .01em; }
.brand-text small { font-size: .68rem; opacity: .82; letter-spacing: .04em; text-transform: uppercase; }
.nav-desktop { display: flex; gap: 4px; flex: 1; }
.nav-group { position: relative; }
.nav-toggle {
  background: transparent; border: none; color: var(--on-brand); font-family: var(--font-body);
  font-size: .92rem; font-weight: 600; padding: 10px 12px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 5px; opacity: .92;
}
.nav-toggle:hover, .nav-group.open .nav-toggle { background: rgba(255,255,255,0.12); opacity: 1; }
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px;
  background: var(--surface); color: var(--ink); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; display: none; flex-direction: column; border: 1px solid var(--border-soft);
}
.nav-group.open .dropdown, .nav-group:hover .dropdown { display: flex; }
.dropdown-link { padding: 10px 12px; border-radius: 7px; text-decoration: none; font-size: .92rem; font-weight: 500; color: var(--ink); }
.dropdown-link:hover { background: var(--surface-alt); }
.topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.icon-btn { display: none; background: rgba(255,255,255,0.12); border: none; color: var(--on-brand); width: 38px; height: 38px; border-radius: 9px; cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-mobile { display: none; flex-direction: column; padding: 10px 20px 18px; gap: 4px; }
.nav-mobile-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; margin: 12px 0 2px; }
.nav-mobile a { display: block; padding: 8px 4px; color: var(--on-brand); text-decoration: none; font-weight: 500; opacity: .95; }

/* No celular, o menu-desktop some e o botão de "≡" abre o .nav-mobile no
   lugar dele — mas antes disso o botão de "≡" simplesmente não cabia na
   barra: com o chip do usuário (foto+nome), o sino de notificação e o
   botão "Ouvidoria" (texto que não pode quebrar) todos na mesma linha,
   a soma passava da largura da tela, o "≡" ficava empurrado pra fora da
   área visível (a página inteira trava a rolagem lateral por design,
   então não dava nem pra arrastar até ele) e "o menu não aparecia" de
   verdade — o botão existia, só que fora da tela. As regras abaixo
   liberam espaço pra ele sempre caber: o botão "Ouvidoria" sai da barra
   (já tem o mesmo botão dentro do próprio menu "≡", então nada se perde),
   o nome da pessoa logada trunca mais cedo, e a marca/textos encolhem um
   pouco.
*/
@media (max-width: 880px) {
  .nav-desktop { display: none; }
  .icon-btn { display: flex; }
  .nav-mobile[hidden] { display: none; }
  .nav-mobile { display: flex; }
  .topbar-inner { padding: 8px 14px; gap: 10px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions > .btn-ouvidoria { display: none; }
  .brand-text small { display: none; }
  .user-chip span { max-width: 64px; }
  .btn-google { padding: 8px 12px 8px 8px; font-size: .8rem; }
  .notif-btn { flex-shrink: 0; }
}
@media (max-width: 360px) {
  .btn-google span { display: none; }
}

/* ---------- Buttons / badges ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-weight: 700; font-size: .92rem; padding: 11px 20px; border-radius: 999px; text-decoration: none; border: none; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--gold-soft); color: #2A1607; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn-ouvidoria { background: var(--brand-wine); color: #FCEEF0; }
.hero .btn-ghost { color: var(--on-brand); border-color: rgba(255,255,255,.4); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }
.tag-ob { background: rgba(62,30,107,0.13); color: var(--primary); }
.tag-o { background: rgba(217,154,63,0.18); color: var(--gold); }
.tag-ac { background: rgba(124,44,59,0.13); color: var(--wine); }
.tag-locked { background: rgba(124,44,59,0.13); color: var(--wine); }
.tag-destaque { background: var(--gold-soft); color: #2A1607; }
.badge-exemplo { font-size: .68rem; font-weight: 700; background: var(--surface-alt); color: var(--muted); border: 1px dashed var(--border); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, var(--brand-deep), var(--brand-mid) 70%); color: var(--on-brand); padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.eyebrow { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; color: var(--gold-soft); margin: 0 0 10px; }
.hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); color: var(--on-brand); }
.hero-lede { font-size: 1.05rem; max-width: 46ch; opacity: .92; }
.hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat span { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--gold-soft); }
.stat small { font-size: .74rem; opacity: .85; }
.hero-mini { background: linear-gradient(160deg, var(--brand-deep), var(--brand-strong)); color: var(--on-brand); padding: 46px 0; }
.hero-mini h1 { color: var(--on-brand); font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.hero-mini p { opacity: .9; max-width: 62ch; margin: 0; }

@media (max-width: 780px) { .hero-grid { grid-template-columns: 1fr; } .hero-stats { grid-template-columns: 1fr 1fr; } }

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section-alt { background: var(--surface-alt); }
.section-title { font-size: 1.3rem; margin-bottom: 16px; display: flex; align-items: baseline; gap: 8px; }
.prose { max-width: 74ch; }
.prose p { margin: 0 0 16px; color: var(--ink-soft); }
.prose h2 { margin-top: 32px; font-size: 1.25rem; }
.prose ul { color: var(--ink-soft); padding-left: 20px; }
.prose li { margin-bottom: 6px; }
/* :not(.btn) evita que esta regra vença o .btn-primary por especificidade
   (ex.: o botão "Criar ou atualizar meu Lattes" na aba Lattes) — sem isso,
   no tema escuro o texto do botão ficava com a mesma cor do fundo dele
   (--gold-soft nos dois), completamente invisível. */
.prose a:not(.btn) { color: var(--primary); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .prose a:not(.btn) { color: var(--gold-soft); } }
:root[data-theme="dark"] .prose a:not(.btn) { color: var(--gold-soft); }

/* Texto rico (HTML/CSS limitado) de Páginas e Notícias — ver textoRicoHtml
   no app.js. Fora de .prose (usado também dentro de .detail-card em
   Notícias), então o link recebe cor própria aqui em vez de herdar
   .prose a. */
.rico p { margin: 0 0 12px; }
.rico p:last-child { margin-bottom: 0; }
.rico ul, .rico ol { padding-left: 20px; margin: 0 0 12px; }
.rico a:not(.btn) { color: var(--primary); text-decoration: underline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rico a:not(.btn) { color: var(--gold-soft); } }
:root[data-theme="dark"] .rico a:not(.btn) { color: var(--gold-soft); }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.quick-card { text-decoration: none; display: block; position: relative; transition: transform .15s ease; }
.quick-card:hover { transform: translateY(-2px); }
.quick-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.quick-card p { color: var(--ink-soft); font-size: .9rem; margin: 0; }
.card-arrow { position: absolute; top: 20px; right: 20px; color: var(--gold); font-size: 1.1rem; }

.avisos-list { display: grid; gap: 12px; }
.aviso { background: var(--surface); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); padding: 14px 18px; box-shadow: var(--shadow); }
.aviso p { margin: 4px 0 0; color: var(--ink-soft); }
.aviso-warning { border-left-color: var(--wine); }

/* ---------- Disciplinas ---------- */
.input { width: 100%; padding: 12px 16px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: .95rem; }
.input-search { margin-bottom: 20px; }
.periodo-block { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow); overflow: hidden; }
.periodo-block summary { cursor: pointer; list-style: none; padding: 14px 20px; font-weight: 700; font-family: var(--font-display); font-size: 1.05rem; display: flex; align-items: baseline; gap: 8px; }
.periodo-block summary::-webkit-details-marker { display: none; }
.periodo-block summary::before { content: '▸'; margin-right: 8px; color: var(--gold); transition: transform .15s; display: inline-block; }
.periodo-block[open] summary::before { transform: rotate(90deg); }
/* Cabeçalho colapsável reaproveitando o visual de .detail-card h2 — usado
   no Painel (Tags, Contas aguardando aprovação, Contas aprovadas) pra dar
   a opção de minimizar seções que podem crescer bastante. */
.painel-collapse > summary { cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--ink); margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.painel-collapse > summary::-webkit-details-marker { display: none; }
.painel-collapse > summary::before { content: '▸'; color: var(--gold); transition: transform .15s; display: inline-block; font-size: .85em; }
.painel-collapse[open] > summary::before { transform: rotate(90deg); }
.painel-collapse:not([open]) > summary { margin-bottom: 0; }
.disc-list { display: flex; flex-direction: column; }
.disc-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--border-soft); font-size: .92rem; }
.disc-row:hover { background: var(--surface-alt); }
.disc-codigo { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); width: 78px; flex-shrink: 0; }
.disc-nome { flex: 1; font-weight: 500; }
.disc-horas { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); width: 44px; text-align: right; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--border); }
.status-done { background: var(--success); }
.status-locked { background: var(--wine-soft); }

/* ---------- Discipline detail ---------- */
.disc-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.disc-detail-grid > * { min-width: 0; }
.detail-card { overflow-wrap: anywhere; }
@media (max-width: 880px) { .disc-detail-grid { grid-template-columns: minmax(0, 1fr); } }
/* Montar minha semana (Simulador): busca em cima, semana embaixo — a
   semana usa a largura toda pra caber os 7 dias sem cortar/precisar
   rolar o tempo todo. */
.montar-semana-layout { display: flex; flex-direction: column; gap: 24px; }
.detail-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; overflow-wrap: anywhere; }
.detail-card h2 { font-size: 1.05rem; margin-bottom: 12px; }
.ch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; }
.ch-grid strong { display: block; font-family: var(--font-mono); font-size: 1.2rem; }
.ch-grid small { color: var(--muted); font-size: .72rem; }
.prereq-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.prereq-list a { text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--primary); }
:root[data-theme="dark"] .prereq-list a { color: var(--gold-soft); }
.prereq-list li.prereq-ok a { color: var(--success); }
.empty-state { border: 1.5px dashed var(--border); border-radius: var(--radius-sm); padding: 16px; color: var(--muted); font-size: .88rem; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.checkbox-row.big { font-size: 1rem; font-weight: 600; }
.checkbox-row input { width: 18px; height: 18px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.form input[type=text], .form textarea, .form input[type=search] {
  font-family: var(--font-body); padding: 11px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--bg); color: var(--ink); font-size: .95rem; resize: vertical;
}
.form input[type=text]:focus, .form textarea:focus, .input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.stars { display: flex; gap: 4px; font-size: 1.6rem; }
.star { background: none; border: none; cursor: pointer; color: var(--border); padding: 0; line-height: 1; }
.star.filled { color: var(--gold); }
/* meias estrelas: cada "slot" tem a estrela de fundo e a da frente, cortada em 0/50/100% */
.stars-input { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.star-slot { position: relative; display: inline-block; background: none; border: none; padding: 0; cursor: pointer; font-size: 1.6rem; line-height: 1.2; touch-action: manipulation; }
.star-slot .star-bg { color: var(--border); }
.star-slot .star-fg { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; width: var(--pct, 0%); color: var(--gold); }
.star-slot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.stars-valor { font-family: var(--font-mono); font-weight: 800; margin-left: 6px; }
.stars-dica { flex-basis: 100%; margin: 0; }
/* estrelas pequenas com meia estrela (listas, painel, denúncias) */
.estrelas-mini { position: relative; display: inline-block; line-height: 1; white-space: nowrap; vertical-align: baseline; }
.estrelas-mini .em-bg { color: var(--border); }
.estrelas-mini .em-fg { position: absolute; left: 0; top: 0; overflow: hidden; width: var(--pct, 0%); color: var(--gold); }
.estrelas-mini-num { font-family: var(--font-mono); font-weight: 700; margin-left: 4px; }
.editar-nota-picker { font-size: 1.15rem; margin-top: 8px; }

/* Média de avaliações (disciplina/professor) em destaque: a barra dourada
   cobre (media/5) da largura das 5 estrelas de fundo — então uma média de
   4.3 preenche quase a quinta estrela, em vez de arredondar pro inteiro
   mais próximo. Fica ao lado do número exato (ex: "4,3") e da quantidade
   de avaliações que formam essa média. */
.media-avaliacoes { text-align: center; }
.media-estrelas { position: relative; display: inline-block; font-size: 1.9rem; line-height: 1; letter-spacing: 3px; }
.media-estrelas-bg { color: var(--border); }
.media-estrelas-fg { position: absolute; inset: 0; overflow: hidden; width: var(--pct, 0%); white-space: nowrap; color: var(--gold); }
.media-numero { font-family: var(--font-mono); font-weight: 800; font-size: 1.7rem; margin-top: 4px; }
.media-qtd { font-size: .78rem; margin-top: 2px; }

/* ---------- Simulador ---------- */
.simulador-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .simulador-grid { grid-template-columns: 1fr; } }
.progresso-card { position: sticky; top: 88px; }
.progresso-item { margin-bottom: 14px; }
.progresso-label { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 600; margin-bottom: 5px; }
.progresso-bar { height: 9px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.progresso-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--wine)); border-radius: 999px; }
.progresso-total { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; margin: 14px 0; text-align: center; }
.sim-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border-soft); background: var(--surface); font-size: .9rem; cursor: pointer; }
.sim-row:first-child { border-top: none; border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.sim-row input { width: 17px; height: 17px; flex-shrink: 0; }
.sim-locked { opacity: .55; cursor: not-allowed; }
.sim-locked .disc-nome { text-decoration: line-through; text-decoration-color: var(--border); }
.sim-ac-manual { padding: 14px 16px; }
.sim-ac-manual label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; }
.sim-ac-manual input[type="number"] { max-width: 160px; font-weight: 400; }
.sim-ac-manual .fine-print { margin: 10px 0 0; }

/* ---------- Montar minha semana (grade horária) ---------- */
.grade-semana-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.grade-semana-header .btn { flex-shrink: 0; }
.grade-semana { display: flex; gap: 4px; overflow-x: auto; margin-top: 8px; padding-bottom: 4px; }
.grade-horas { width: 34px; flex-shrink: 0; position: relative; margin-top: 26px; }
.grade-col { flex: 1; min-width: 84px; }
.grade-col-head { text-align: center; font-weight: 700; font-size: .78rem; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border); color: var(--ink-soft); }
.grade-col-body { position: relative; background: var(--surface-alt); border-radius: 8px; }
.grade-bloco {
  position: absolute; left: 2px; right: 2px; background: var(--primary); color: var(--on-primary);
  border-radius: 6px; padding: 3px 5px; font-size: .66rem; line-height: 1.2; overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column; gap: 1px;
}
.grade-bloco span { font-size: .62rem; opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Turma (ex.: "R"/"S") de cada bloco da semana montada — fica ao lado do
   código da disciplina, sempre visível (não só no title/tooltip), pra dar
   pra diferenciar de relance qual turma foi escolhida direto no calendário. */
.grade-turma-tag {
  display: inline-block; padding: 0 4px; border-radius: 4px; background: rgba(255,255,255,.3);
  font-size: .6rem !important; font-weight: 700; opacity: 1 !important; line-height: 1.4;
  vertical-align: middle; white-space: nowrap;
}
/* O fundo de cada bloco vem inline (cor por disciplina — ver corDisciplina
   no app.js), então conflito/bloqueio precisam de um sinal que não seja
   background, senão escondiam a cor da disciplina. */
.grade-bloco.grade-conflito { box-shadow: 0 0 0 2px var(--wine) inset; }
.grade-bloco.grade-bloqueada { outline: 2px dashed var(--gold); outline-offset: -2px; }

/* Busca de disciplinas do montador de semana (Simulador) */
.sim-busca-row { padding: 10px 2px; border-top: 1px solid var(--border-soft); }
.sim-busca-row:first-child { border-top: none; }
.sim-busca-row select { width: 100%; }
/* Disciplina já incluída na semana: resumo compacto por padrão (sem o
   <select> inteiro sempre visível), com ✎ pra trocar de turma e ✕ pra
   remover — menos poluído do que repetir o seletor completo pra cada
   disciplina já escolhida. */
.sim-selecionada-row { padding: 10px 2px; border-top: 1px solid var(--border-soft); }
.sim-selecionada-row:first-child { border-top: none; }
.sim-selecionada-row select { width: 100%; }

/* ---------- People / campus / guia cards ---------- */
.pessoa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.pessoa-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.avatar-placeholder { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-soft), var(--wine-soft)); color: #2A1607; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; flex-shrink: 0; }
/* Card vertical da aba Coordenação/Direção — foto grande e centralizada
   em vez do layout horizontal compacto, para não ficar desproporcional
   com fotos de tamanhos/proporções variados. */
.pessoa-card-coord { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 24px 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; box-shadow: var(--shadow); }
.pessoa-card-coord strong { font-size: 1rem; margin-top: 4px; }
.pessoa-card-coord p { margin: 0; }
.pessoa-foto-coord { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; flex-shrink: 0; margin-bottom: 4px; font-size: 1.7rem; }
.campus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.campus-card p { color: var(--ink-soft); }
.campus-ru { margin-top: 12px; padding: 10px 12px; background: var(--surface-alt); border: 1px solid var(--gold-soft); border-radius: var(--radius-sm); }
.campus-ru strong { color: var(--gold); }
.campus-ru p { margin: 4px 0 0; font-size: .86rem; }
.campus-ru a { color: var(--primary); font-weight: 600; }
:root[data-theme="dark"] .campus-ru a { color: var(--gold-soft); }
.guia-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 12px; }
.guia-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); position: relative; overflow-wrap: anywhere; }
.guia-card h3 { font-size: 1rem; margin-bottom: 6px; overflow-wrap: anywhere; }
.guia-card p { color: var(--ink-soft); font-size: .9rem; margin: 4px 0; }
.guia-card a { color: var(--primary); font-weight: 600; font-size: .88rem; text-decoration: none; }
:root[data-theme="dark"] .guia-card a { color: var(--gold-soft); }
.guia-card.destaque { border: 1.5px solid var(--gold); max-width: 420px; }
/* Cartão clicável de Entidade/Liga/Extensão — abre o "perfil" completo em
   vez de mostrar a descrição inteira e a lista de membros ali mesmo
   (isso é o que fazia o texto/membros extravasar a caixa em ligas
   grandes). O resumo é cortado em 3 linhas; o resto só aparece no perfil. */
.perfil-card { display: block; text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.perfil-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px -4px rgba(36,16,73,0.28), 0 14px 30px -14px rgba(36,16,73,0.32); }
.perfil-card-foto { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; display: block; }
.perfil-card-foto-vazia { background: var(--surface-alt); display: flex; align-items: center; justify-content: center; }
.perfil-card-foto-vazia svg { transform: scale(1.3); opacity: .5; }
.perfil-card-resumo { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.perfil-card-cta { display: inline-block; margin-top: 4px; font-weight: 700; font-size: .86rem; color: var(--primary); }
:root[data-theme="dark"] .perfil-card-cta { color: var(--gold-soft); }
/* Página de perfil (detalhe) de Entidade/Liga/Extensão. */
.perfil-detalhe-foto { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 14px; }
.perfil-detalhe-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.preco { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700; color: var(--gold); margin: 6px 0 0; }

/* ---------- Eventos (agenda de ligas, extensão, atlética etc.) ---------- */
.eventos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin-bottom: 12px; }
.evento-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.evento-img, .evento-img-placeholder { width: 100%; height: 150px; object-fit: cover; display: block; background: var(--surface-alt); }
.evento-img-placeholder { display: flex; align-items: center; justify-content: center; }
.evento-img-placeholder svg { transform: scale(1.3); opacity: .55; }
.evento-body { padding: 16px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.evento-data { font-family: var(--font-mono); font-size: .76rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .04em; }
.evento-card h3 { font-size: 1.02rem; margin: 0; }
.evento-card p { color: var(--ink-soft); font-size: .86rem; margin: 0; }
.evento-card .btn { margin-top: 10px; align-self: flex-start; padding: 7px 14px; font-size: .85rem; }
.evento-passado { opacity: .62; }

/* ---------- Footer ---------- */
.footer { background: var(--brand-deep); color: var(--on-brand); padding: 40px 0 20px; margin-top: 40px; }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 24px; align-items: start; }
.footer-inner svg { margin-bottom: 8px; }
.footer-inner p { opacity: .8; font-size: .85rem; margin: 0; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--on-brand); text-decoration: none; font-size: .9rem; opacity: .88; }
.footer-theme { display: flex; flex-direction: column; gap: 8px; font-size: .85rem; }
.theme-switch { display: flex; gap: 4px; background: rgba(255,255,255,0.08); border-radius: 999px; padding: 3px; width: fit-content; }
.theme-switch button { background: none; border: none; color: var(--on-brand); font-size: .78rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; opacity: .75; }
.theme-switch button.active { background: rgba(255,255,255,0.18); opacity: 1; }
.footer-fine { max-width: 1120px; margin: 24px auto 0; padding: 0 24px; font-size: .76rem; opacity: .6; }
@media (max-width: 780px) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 22px;
  font-size: .88rem; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s ease;
  box-shadow: var(--shadow); max-width: 90vw; text-align: center; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Auth ---------- */
.auth-box { display: flex; align-items: center; gap: 8px; }
.btn-google {
  display: inline-flex; align-items: center; gap: 8px; background: var(--on-brand); color: #3c4043;
  font-weight: 700; font-size: .86rem; padding: 9px 16px 9px 10px; border-radius: 999px; border: none; cursor: pointer;
}
.btn-google svg { flex-shrink: 0; }
.user-chip { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.12); padding: 5px 8px 5px 5px; border-radius: 999px; cursor: pointer; border: none; color: var(--on-brand); font-family: var(--font-body); flex-shrink: 1; min-width: 0; max-width: 100%; }
.user-chip img { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; }
.user-chip .avatar-fallback { width: 26px; height: 26px; border-radius: 50%; background: var(--gold-soft); color: #2A1607; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .75rem; flex-shrink: 0; }
.user-chip span { font-size: .84rem; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Nome + foto clicáveis para abrir o perfil de quem fez uma ação (avaliação,
   anúncio na Loja, edição no histórico, recado…) — ver pessoaLinkHtml no JS. */
.pessoa-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); text-decoration: none; }
.pessoa-link:hover { text-decoration: underline; }
.pessoa-link-foto { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pessoa-link-foto.avatar-fallback { background: var(--brand, #5B2E8C); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .7rem; }
/* Lista densa (colegas de turma, amigos): só a foto, nome vira dica ao
   passar o mouse (atributo title) — ver pessoaAvatarLinkHtml no JS. */
.pessoa-avatar-link { display: block; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; transition: transform .12s ease; }
.pessoa-avatar-link:hover { transform: scale(1.08); }
.pessoa-avatar-link img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pessoa-avatar-link .avatar-fallback { width: 100%; height: 100%; font-size: .95rem; }
/* Base genérica do "avatar sem foto" (iniciais) — usada em qualquer
   tamanho (perfil, busca de pessoas, chip do topo sobrescreve o tamanho). */
.avatar-fallback { display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; background: var(--brand, #5B2E8C); color: #fff; flex-shrink: 0; }
/* Selo "+N" para as tags que não couberam no chip (ver tagPillsResumoHtml
   no JS) — cor neutra, diferente das pills de tag (que usam a cor real
   de cada tag), pra não parecer uma tag de verdade. */
.user-tag-pill-mais { background: rgba(255,255,255,.25) !important; color: var(--on-brand) !important; }
.auth-menu-tags { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 12px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; }
.role-pill { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--gold-soft); color: #2A1607; padding: 1px 6px; border-radius: 999px; flex-shrink: 0; }
.auth-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); box-shadow: var(--shadow); border: 1px solid var(--border-soft); min-width: 200px; max-width: min(280px, calc(100vw - 32px)); padding: 6px; display: none; flex-direction: column; z-index: 50; }
.auth-menu.open { display: flex; }
.auth-menu a, .auth-menu button { text-align: left; background: none; border: none; padding: 10px 12px; border-radius: 7px; font-size: .88rem; font-weight: 500; cursor: pointer; color: var(--ink); text-decoration: none; font-family: var(--font-body); }
.auth-menu a:hover, .auth-menu button:hover { background: var(--surface-alt); }
.auth-wrap { position: relative; min-width: 0; }

/* ---------- Notificações (sininho: pedidos de amizade + recados) ---------- */
.notif-wrap { position: relative; flex-shrink: 0; }
.notif-btn { position: relative; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.12); border: none; color: var(--on-brand); width: 38px; height: 38px; border-radius: 9px; cursor: pointer; }
.notif-btn:hover { background: rgba(255,255,255,0.2); }
.notif-badge { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #D64545; color: #fff; font-size: .64rem; font-weight: 800; display: flex; align-items: center; justify-content: center; line-height: 1; border: 2px solid var(--brand-mid); }
.notif-badge[hidden] { display: none; }
.notif-dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); box-shadow: var(--shadow); border: 1px solid var(--border-soft); width: min(340px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; padding: 6px; display: none; flex-direction: column; z-index: 50; }
.notif-dropdown.open { display: flex; }
.notif-dropdown-title { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px 6px; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 8px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.notif-item:hover { background: var(--surface-alt); }
.notif-item-link { cursor: pointer; }
.notif-item .pessoa-avatar-link { width: 34px; height: 34px; }
.notif-item-corpo { flex: 1; min-width: 0; }
.notif-item-corpo p { margin: 0; font-size: .85rem; line-height: 1.35; }
.notif-item-corpo strong { font-weight: 700; }
.notif-item-texto { color: var(--muted); margin-top: 2px !important; overflow-wrap: break-word; }
.notif-item-acoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.notif-item { min-width: 0; }
.notif-item-corpo p { overflow-wrap: anywhere; }
@media (max-width: 880px) {
  /* celular: o menu ocupa a largura da tela (com margem) logo abaixo da barra, sem cortar nada */
  .notif-dropdown { position: fixed; left: 10px; right: 10px; width: auto; top: var(--notif-top, 62px); max-height: calc(100vh - var(--notif-top, 62px) - 12px); max-height: calc(100dvh - var(--notif-top, 62px) - 12px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .notif-item { padding: 10px 8px; }
  .notif-item-acoes .btn { padding: 8px 14px; }
}
.notif-item-acoes .btn { padding: 6px 12px; font-size: .78rem; width: auto; }
.login-gate { border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; }
.login-gate p { color: var(--ink-soft); margin: 0 0 14px; }
.banner-local { background: var(--brand-wine); color: #FCEEF0; text-align: center; padding: 8px 16px; font-size: .84rem; font-weight: 600; }
.banner-local a, .banner-local strong { color: #fff; }

/* ---------- Admin panel ---------- */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-tab { background: var(--surface); border: 1.5px solid var(--border-soft); padding: 8px 14px; border-radius: 999px; font-size: .84rem; font-weight: 700; cursor: pointer; color: var(--ink-soft); }
.admin-tab.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.editor-item { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; box-shadow: var(--shadow); }
.editor-item-body strong { display: block; }
.editor-item-body p { margin: 2px 0; font-size: .85rem; color: var(--ink-soft); }
.editor-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-action { background: var(--surface-alt); border: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: .85rem; }
.icon-action.danger { color: var(--wine); }
.icon-action:disabled { opacity: .35; cursor: not-allowed; }
.editor-form { background: var(--surface-alt); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.editor-form .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .editor-form { grid-template-columns: 1fr; padding: 14px; } }
.editor-form input, .editor-form textarea, .editor-form select { font-family: var(--font-body); padding: 9px 12px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); font-size: .9rem; }
.editor-form label { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; display: flex; flex-direction: column; gap: 4px; }
.pill-status { display: inline-block; font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; }
.pill-pendente { background: rgba(217,154,63,0.2); color: var(--gold); }
.pill-aprovada, .pill-aprovado, .pill-lido { background: rgba(62,122,78,0.16); color: var(--success); }
.pill-rejeitada, .pill-rejeitado, .pill-novo { background: rgba(124,44,59,0.16); color: var(--wine); }
.spinner-inline { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Editor de texto rico (barra + textarea + prévia) ---------------- */
.editor-rico-wrap { display: flex; flex-direction: column; gap: 6px; }
.editor-rico-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 8px 8px 0 0; border-bottom: none; padding: 6px; }
.editor-rico-toolbar button { background: var(--surface-alt); border: 1px solid var(--border-soft); color: var(--ink); font-size: .82rem; padding: 6px 9px; border-radius: 6px; cursor: pointer; line-height: 1; }
.editor-rico-toolbar button:hover { background: var(--border-soft); }
.editor-rico-toolbar button.ativo { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.editor-rico-toolbar select, .editor-rico-toolbar input[type="color"] { font-family: var(--font-body); font-size: .78rem; padding: 5px 6px; border-radius: 6px; border: 1px solid var(--border-soft); background: var(--surface-alt); color: var(--ink); }
.editor-rico-toolbar input[type="color"] { width: 32px; padding: 2px; cursor: pointer; }
.editor-rico-wrap textarea { width: 100%; box-sizing: border-box; padding: 10px 14px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: .95rem; border-radius: 0 0 8px 8px !important; resize: vertical; }
.editor-rico-preview { border: 1.5px dashed var(--border); border-radius: 8px; padding: 12px 14px; background: var(--surface-alt); }
.editor-rico-preview[hidden] { display: none; }
.editor-rico-preview img { max-width: 100%; border-radius: 6px; }
@media (max-width: 560px) {
  .editor-rico-toolbar { gap: 3px; padding: 5px; }
  .editor-rico-toolbar button, .editor-rico-toolbar select { font-size: .74rem; padding: 5px 7px; }
}

/* ---------------- Tela de acesso (login obrigatório) ---------------- */
.gate-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; background: linear-gradient(160deg, var(--brand-deep), var(--brand-mid) 70%); color: var(--on-brand); }
.gate-title { font-size: 1.6rem; margin: 6px 0 10px; color: var(--on-brand); }
.gate-sub { max-width: 52ch; opacity: .92; margin: 0; }
.gate-sub a { text-decoration: underline; }

/* ---------------- Popup de aviso urgente ---------------- */
.popup-overlay { position: fixed; inset: 0; background: rgba(20,10,35,.6); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 24px; }
.popup-card { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 28px; max-width: 420px; box-shadow: var(--shadow); text-align: center; }
.popup-card h2 { font-size: 1.15rem; overflow-wrap: anywhere; }
/* aviso/popup longo no celular: rola dentro do cartão em vez de ser cortado em cima/embaixo da tela */
.popup-card { box-sizing: border-box; width: 100%; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.popup-card img, .popup-card video, .popup-card iframe { max-width: 100%; height: auto; }
@media (max-width: 560px) { .popup-overlay { padding: 14px; } .popup-card { padding: 22px 18px; max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); } }

/* ---------------- Tag de usuário ---------------- */
.user-tag-pill { display: inline-block; font-size: .62rem; font-weight: 800; color: #fff; padding: 1px 7px; border-radius: 999px; text-shadow: 0 1px 1px rgba(0,0,0,.25); vertical-align: middle; margin-right: 3px; }

/* ---------------- Anúncios / parcerias ----------------
   Imagem sempre no mesmo tamanho padronizado (via object-fit: cover),
   não importa a proporção do link colado pela gestão. */
.anuncios-destaque { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 900px; margin: 28px auto 0; }
.anuncios-destaque .anuncio-card { display: flex; flex-direction: column; width: 220px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); border-radius: var(--radius); overflow: hidden; text-align: left; text-decoration: none; color: var(--on-brand); transition: transform .15s ease, background .15s ease; }
a.anuncio-card:hover { background: rgba(255,255,255,0.14); transform: translateY(-2px); }
.anuncio-img-destaque { width: 220px; height: 120px; object-fit: cover; display: block; }
.anuncios-destaque .anuncio-texto { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.anuncios-destaque .anuncio-texto strong { font-size: .88rem; }
.anuncios-destaque .anuncio-texto small { font-size: .74rem; opacity: .82; line-height: 1.4; }

.anuncios-singelos { max-width: 1120px; margin: 22px auto 0; padding: 14px 24px 0; border-top: 1px solid rgba(255,255,255,0.12); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.anuncios-rotulo { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; opacity: .55; margin-right: 4px; }
.anuncios-singelos .anuncio-card { display: inline-flex; align-items: center; gap: 7px; color: var(--on-brand); text-decoration: none; opacity: .85; font-size: .78rem; }
.anuncios-singelos a.anuncio-card:hover { opacity: 1; }
.anuncio-img-mini { width: 26px; height: 26px; object-fit: cover; border-radius: 6px; }
.anuncios-singelos .anuncio-texto { display: flex; flex-direction: column; line-height: 1.2; }
.anuncios-singelos .anuncio-texto small { display: none; }
@media (max-width: 780px) { .anuncios-destaque .anuncio-card, .anuncio-img-destaque { width: 100%; } }

/* ---------------- Membros de uma tag (em entidades/ligas) ---------------- */
.membros-tag { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-soft); }
.membro-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-alt); border: 1px solid var(--border-soft); color: var(--ink); font-size: .74rem; font-weight: 600; padding: 3px 10px 3px 3px; border-radius: 999px; margin: 0 6px 6px 0; }
.membro-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

/* ---------- Coeficiente de Rendimento (calculadora privada) ---------- */
.cr-card-resultado { text-align: center; }
.cr-numero { font-family: var(--font-display); font-weight: 700; font-size: 3.4rem; line-height: 1.1; color: var(--primary); font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cr-numero { color: var(--gold-soft); } }
:root[data-theme="dark"] .cr-numero { color: var(--gold-soft); }
.cr-detalhe { margin: 4px 0 0; }
.cr-res, .cr-item { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.cr-res:last-child, .cr-item:last-child { border-bottom: none; }
.cr-res-info, .cr-item-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 110px; }
.cr-res-info small, .cr-item-info small { margin-top: 2px; }
.cr-res-acao, .cr-item-acao { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.cr-nota-input { width: 84px; margin: 0; text-align: center; font-variant-numeric: tabular-nums; }
.cr-nota-input[aria-invalid="true"] { border-color: #D64545; }
.cr-lista-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cr-manual { margin-top: 14px; }
.cr-manual > summary { cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--ink-soft); }
.cr-manual-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; margin-top: 10px; align-items: center; }
.cr-manual-form .input { margin: 0; }
@media (max-width: 640px) { .cr-manual-form { grid-template-columns: 1fr 1fr; } .cr-manual-form .input:first-child { grid-column: 1 / -1; } .cr-manual-form .btn { grid-column: 1 / -1; justify-content: center; } }
.cr-formula { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-family: var(--font-display); }
.cr-formula > span:first-child { flex-shrink: 0; white-space: nowrap; font-weight: 700; }
.cr-frac { display: flex; flex-direction: column; align-items: stretch; text-align: center; font-size: .88rem; flex: 1 1 0; min-width: 0; }
.cr-num { padding: 0 4px 6px; border-bottom: 2px solid var(--ink); }
.cr-den { padding: 5px 4px 0; }
.cr-excecoes { color: var(--ink-soft); padding-left: 22px; margin: 6px 0 0; }
.cr-excecoes li { margin-bottom: 4px; }
.cr-situacao { flex-basis: 100%; margin: 0; padding: 7px 10px; font-size: .8rem; }
.cr-caso { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border-soft); }
.cr-caso:first-of-type { border-top: none; padding-top: 0; }
.cr-caso strong { display: block; margin-bottom: 2px; }
.cr-caso p { margin: 0; font-size: .88rem; color: var(--ink-soft); line-height: 1.5; }
.cr-caso-ico { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; background: var(--surface-alt); color: var(--ink); }
.cr-caso-ruim { background: rgba(214,69,69,.14); color: #C23B3B; }
.cr-caso-medio { background: rgba(240,190,110,.25); color: #A8741A; }
.cr-caso-bom { background: rgba(60,160,110,.16); color: #2E8A5C; }
.cr-caso-fora { background: var(--surface-alt); color: var(--muted); }
.cr-fora-linha .cr-item-info { opacity: .55; text-decoration: line-through; }

/* Classificação na turma (perfil) */
.cr-rank { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line, rgba(128,128,128,.25)); }
.cr-rank-titulo { margin: 0 0 6px; font-size: 1.05rem; }
.cr-rank-pos { margin: 4px 0 2px; font-size: 1.7rem; font-weight: 800; color: #d11a2a; line-height: 1.15; }
.cr-rank-turma { margin: 0 0 6px; font-weight: 700; color: #d11a2a; }
.cr-rank-priv { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: rgba(209,26,42,.08); font-size: .9rem; }
.cr-rank-priv strong { color: #d11a2a; font-weight: 800; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cr-rank-pos, :root:not([data-theme="light"]) .cr-rank-turma, :root:not([data-theme="light"]) .cr-rank-priv strong { color: #ff5c6a; } }
:root[data-theme="dark"] .cr-rank-pos, :root[data-theme="dark"] .cr-rank-turma, :root[data-theme="dark"] .cr-rank-priv strong { color: #ff5c6a; }

/* Campo de foto com envio de arquivo */
.editor-form .campo-foto { display: flex; flex-direction: column; gap: 6px; }
.campo-foto-rotulo { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.campo-foto-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.campo-foto-btn { width: auto; padding: 8px 12px; font-size: .85rem; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 600; }
.editor-form label.campo-foto-btn, .editor-form button.campo-foto-btn { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 600; flex-direction: row; display: inline-flex; }

/* Lista de PDFs do material (página da disciplina) */
.material-arquivos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.material-arquivos li { padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); overflow-wrap: anywhere; }
.material-arquivos li + .material-texto, .material-arquivos + .material-texto { margin-top: 12px; }

/* Ranking de avaliações */
.sem-dados { text-decoration: none; cursor: help; border-bottom: 1px dotted currentColor; }
.media-sd { color: var(--muted); }
.rank-abas { display: flex; gap: 6px; margin: 10px 0 12px; }
.rank-aba { font: inherit; font-weight: 700; font-size: .85rem; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.rank-aba.ativa { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.rank-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-item { display: grid; grid-template-columns: 4.2rem 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); }
.rank-pos { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank-nome { font-weight: 600; overflow-wrap: anywhere; }
.rank-nota { white-space: nowrap; font-size: .85rem; }
@media (max-width: 520px) { .rank-item { grid-template-columns: 3.6rem 1fr; } .rank-nota { grid-column: 2; } }
.rank-detalhe { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); text-align: center; }
.rank-detalhe-rotulo { display: block; font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.rank-detalhe-pos { font-size: 1.5rem; }

/* Fotos de anúncios da Loja */
.loja-galeria { margin: 8px 0 12px; }
.loja-foto-link { display: block; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-alt); }
.loja-foto-principal { display: block; width: 100%; max-height: 340px; object-fit: contain; background: var(--surface-alt); }
.loja-miniaturas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.loja-mini { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; width: 64px; height: 64px; cursor: pointer; background: var(--surface-alt); }
.loja-mini img { display: block; width: 100%; height: 100%; object-fit: cover; }
.loja-mini.ativa { border-color: var(--gold, #d99a2b); }
.loja-fotos-campo { display: flex; flex-direction: column; gap: 6px; }
.loja-mini-prev { position: relative; width: 72px; height: 72px; }
.loja-mini-prev img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.loja-mini-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--ink); color: var(--bg); font-size: .7rem; line-height: 1; cursor: pointer; }
.form label.campo-foto-btn { width: auto; flex-direction: row; display: inline-flex; text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 600; cursor: pointer; }

/* Pessoas por turma */
.turma-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.turma-chip { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .82rem; cursor: pointer; }
.turma-chip:hover { border-color: var(--primary-strong); }
.turma-chip.ativa { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.turma-chip.minha:not(.ativa) { border-color: var(--primary-strong); font-weight: 700; }

/* Emblemas / conquistas */
.emblemas-linha { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.emblema { position: relative; display: inline-flex; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-alt); align-items: center; justify-content: center; cursor: help; }
.emblema img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.emblema-sem-foto { font-size: 1.3rem; }
.emblema:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 2px; }
.emblema::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 240px; white-space: pre-line; background: var(--primary-deep); color: #fff; padding: 7px 11px; border-radius: 8px; font-size: .78rem; line-height: 1.35; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 30; box-shadow: var(--shadow); }
.emblema:hover::after, .emblema:focus::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .emblema::after { transition: none; } }
