/* Acervo — componentes do aplicativo. Cores, raios e sombras vêm de tokens.css. */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 400 15px/22px var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.ac-canvas {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60% 45% at 100% 0%, var(--canvas-glow-1), transparent 70%),
    radial-gradient(55% 40% at 0% 100%, var(--canvas-glow-2), transparent 70%),
    var(--canvas);
  background-attachment: fixed;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--brand-text); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- Tipografia ---------- */
.ov { font: 700 11px/14px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.ov-brand { color: var(--brand-text); }
.ov-bad { color: var(--danger); }
.bs { font: 400 13px/19px var(--font-body); color: var(--ink-muted); }
.lbl { font: 600 14px/20px var(--font-body); color: var(--ink); }
.cap { font: 600 12px/16px var(--font-body); letter-spacing: .01em; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.display-lg { font: 700 40px/44px var(--font-display); letter-spacing: -0.02em; }
.title-1 { font: 650 28px/34px var(--font-display); letter-spacing: -0.015em; }
.title-2 { font: 650 21px/28px var(--font-display); letter-spacing: -0.01em; }
.title-3 { font: 600 17px/24px var(--font-display); letter-spacing: -0.005em; }
.body-lg { font-size: 17px; line-height: 27px; }
.marca { font: 700 24px/1 var(--font-display); letter-spacing: -0.035em; color: var(--ink); text-decoration: none; }
h1:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Superfícies ---------- */
.glass {
  background: linear-gradient(160deg, var(--glass-sheen), transparent 55%), var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(160%);
  backdrop-filter: blur(var(--blur-glass)) saturate(160%);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--shadow-glass);
  border-radius: var(--radius-lg);
}
.glass.feat { box-shadow: var(--shadow-glass), var(--glow-soft); }
.pad { padding: var(--space-6); }
.pad-5 { padding: var(--space-5); }
.solido { border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }

/* ---------- Estrutura da página ---------- */
.topo {
  position: relative;
  z-index: 45;
  margin: 16px 32px 0;
  padding: 8px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}
.topo-esq { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; }
.topo-dir { position: relative; display: flex; align-items: center; gap: 12px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav-a { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm); font: 600 14px/20px var(--font-body); color: var(--ink-muted); text-decoration: none; }
.nav-a:hover { color: var(--ink); }
.nav-a.active { color: var(--brand-text); }
.nav-a.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 3px; border-radius: 3px; background: var(--brand); }

.pagina { width: 100%; max-width: 1280px; margin: 0 auto; padding: 48px 32px 64px; flex: 1; }
.cabecalho { display: flex; flex-direction: column; gap: 12px; }
.cabecalho .body-lg { max-width: 700px; color: var(--ink-muted); }
.secao { display: flex; flex-direction: column; gap: 16px; margin-top: 40px; }

.barra-movel { display: none; }

/* ---------- Conta (menu) ---------- */
.avatar-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 2px 10px 2px 2px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); }
.avatar-btn:hover { box-shadow: var(--shadow-md); }
.av { width: 40px; height: 40px; border-radius: var(--radius-pill); background: var(--brand-soft); color: var(--brand-text); display: inline-flex; align-items: center; justify-content: center; font: 700 14px/20px var(--font-body); flex: none; }
.av-lg { width: 88px; height: 88px; font: 700 30px/1 var(--font-display); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 280px; padding: 8px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 2px; }
.menu-cab { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-wrap: anywhere; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--ink); font: 500 15px/22px var(--font-body); text-decoration: none; cursor: pointer; text-align: left; }
.mi:hover { background: var(--surface-sunken); }
.mi svg { color: var(--ink-subtle); }
.menu-sep { height: 1px; margin: 4px 0; background: var(--line); }
.menu-scrim { position: fixed; inset: 0; z-index: 40; padding: 0; border: 0; background: transparent; cursor: default; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font: 600 12px/16px var(--font-body); letter-spacing: .01em; white-space: nowrap; }
.badge svg { flex: none; }
.b-neutral { background: var(--surface-sunken); border: 1px solid var(--line); color: var(--ink-muted); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-ok { background: var(--success-soft); color: var(--success); }
.b-warn { background: var(--warning-soft); color: var(--warning); }
.b-bad { background: var(--danger-soft); color: var(--danger); }
.b-brand { background: var(--brand-soft); border: 1px solid var(--canvas-glow-1); color: var(--brand-text); }
.fmt { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px 0 8px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line); font: 600 12px/16px var(--font-body); letter-spacing: .01em; color: var(--ink); }
.fmt svg { color: var(--brand-text); }

/* ---------- Campos ---------- */
.field { width: 100%; min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--control-border); background: var(--surface); color: var(--ink); font: 400 15px/22px var(--font-body); box-shadow: var(--shadow-sm); }
.field::placeholder { color: var(--ink-subtle); }
.field:focus { outline: none; border-color: var(--brand-text); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.field { min-height: 88px; padding: 12px 14px; resize: vertical; }
select.field { padding-right: 36px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23857c75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field.invalid, .field-bad { border-color: var(--danger); }
.campo { display: flex; flex-direction: column; gap: 8px; }
.campo-linha { display: flex; flex-wrap: wrap; gap: 16px; }
.campo-linha > .campo { flex: 1 1 180px; }
.err { display: flex; align-items: center; gap: 6px; font: 500 13px/19px var(--font-body); color: var(--danger); }
.busca { position: relative; flex: 1 1 260px; max-width: 420px; }
.busca svg { position: absolute; left: 14px; top: 12px; color: var(--ink-subtle); pointer-events: none; }
.busca .field { padding-left: 44px; }
.sufixo { position: relative; }
.sufixo .field { padding-right: 64px; }
.sufixo span { position: absolute; right: 14px; top: 12px; }
.chk { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; font: 500 15px/22px var(--font-body); color: var(--ink); cursor: pointer; }
.chk input { width: 20px; height: 20px; margin: 11px 0 0; accent-color: var(--brand-text); flex: 0 0 auto; }
.opcional { font-weight: 400; color: var(--ink-muted); }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--control-border); background: var(--surface); color: var(--ink); font: 600 14px/20px var(--font-body); text-decoration: none; cursor: pointer; box-shadow: var(--shadow-sm); white-space: nowrap; transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease; }
.btn:hover { box-shadow: var(--shadow-md); }
.btn-primary { border-color: transparent; background: linear-gradient(180deg, var(--action-from), var(--action-to)); color: var(--on-action); box-shadow: var(--glow-brand); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--glow-brand); }
.btn-primary:active { transform: none; background: var(--action-to); }
.btn-lg { min-height: 48px; padding: 0 24px; }
.btn-danger { border-color: var(--danger); color: var(--danger); box-shadow: none; }
.btn-danger:hover { background: var(--danger-soft); box-shadow: none; }
.btn-danger-solid { border-color: transparent; background: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: var(--danger); }
.btn[disabled], .btn.is-busy { opacity: .55; cursor: not-allowed; transform: none; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--ink-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-sunken); color: var(--ink); }
.icon-del:hover { background: var(--danger-soft); color: var(--danger); }
.icon-outl { width: 44px; height: 44px; border: 1px solid var(--control-border); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.lnk { color: var(--brand-text); font: 600 14px/20px var(--font-body); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.lnk:hover { text-decoration: underline; }

/* Chips e segmentos */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid var(--control-border); background: var(--surface); color: var(--ink); font: 600 14px/20px var(--font-body); cursor: pointer; box-shadow: var(--shadow-sm); white-space: nowrap; }
.chip:hover { box-shadow: var(--shadow-md); }
.chip .n { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.chip.on { background: var(--brand-soft); border-color: var(--brand-text); color: var(--brand-text); }
.chip.on .n { color: var(--brand-text); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-md); background: var(--surface-sunken); border: 1px solid var(--line); }
.seg-b { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--ink-muted); font: 600 14px/20px var(--font-body); cursor: pointer; white-space: nowrap; }
.seg-b:hover { color: var(--ink); }
.seg-b.on { background: var(--surface); color: var(--brand-text); box-shadow: var(--shadow-sm); }
.seg-b[disabled] { cursor: not-allowed; opacity: .5; }

/* ---------- Alertas ---------- */
.alert { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: var(--radius-md); background: var(--success-soft); color: var(--success); font: 600 14px/20px var(--font-body); }
.alert span { flex: 1; }
.alert .icon-btn { color: inherit; }
.alert-warn { background: var(--warning-soft); color: var(--warning); }
.alert-bad { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--info-soft); color: var(--info); }
.aviso { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--info-soft); color: var(--info); font: 500 14px/20px var(--font-body); }

/* ---------- Barra de filtros ---------- */
.filtros { padding: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.filtros .f { flex: 0 1 200px; }
.filtros .acoes { flex: 1 1 0; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; }

/* ---------- DataGrid ---------- */
.dg-scroll { overflow-x: auto; }
.dg { width: 100%; border-collapse: collapse; min-width: 860px; }
.dg th { padding: 0; background: var(--surface-sunken); border-bottom: 1px solid var(--line); text-align: left; }
.dg th.num .th-btn { justify-content: flex-end; }
.th-btn { display: inline-flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 0 16px; border: 0; background: transparent; font: 700 11px/14px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); cursor: pointer; text-align: left; }
.th-btn:hover { color: var(--ink); }
.th-btn.on { color: var(--brand-text); }
.th-txt { display: block; padding: 15px 16px; font: 700 11px/14px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.dg td { padding: 10px 16px; border-bottom: 1px solid var(--line); font: 400 15px/22px var(--font-body); color: var(--ink); vertical-align: middle; background: var(--surface); }
.dg td.num { text-align: right; white-space: nowrap; }
.dg td.nowrap { white-space: nowrap; }
.dg td.forte { font-weight: 600; }
.dg td.acoes { white-space: nowrap; text-align: right; }
.dg td.toggle { padding: 10px 8px 10px 16px; width: 56px; }
.dg tr.row:hover td { background: var(--surface-sunken); }
.dg tr.row-open td, .dg tr.row-open:hover td { background: var(--brand-soft); }
.dg tr.detail td { background: var(--surface-sunken); padding: 20px 16px 24px; }
.dg .vazio td { padding: 48px 16px; text-align: center; }
.detalhe { display: flex; flex-wrap: wrap; gap: 24px; padding-left: 40px; }
.detalhe .col { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.detalhe .col-estreita { flex: 0 1 260px; display: flex; flex-direction: column; gap: 6px; }
.detalhe .col-acoes { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.detalhe .kv span:first-child { color: var(--ink-muted); }
.lista-pontos { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.lista-pontos li { display: flex; align-items: center; gap: 8px; }
.lista-pontos li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 999px; background: var(--brand); }
.tipo-cel { display: inline-flex; align-items: center; gap: 6px; }
.tipo-cel svg { color: var(--brand-text); }

.rodape-dg { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-sunken); }
.rodape-dg .esq { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.rodape-dg .tam { display: flex; align-items: center; gap: 8px; }
.rodape-dg .tam select { width: 84px; }
.pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg-b { min-width: 44px; min-height: 44px; padding: 0 8px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--ink); font: 600 14px/20px var(--font-body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pg-b:hover { background: var(--surface); }
.pg-b.on { background: var(--brand-soft); border-color: var(--brand-text); color: var(--brand-text); }
.pg-b[disabled] { color: var(--ink-subtle); cursor: default; background: transparent; }

.diff { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.diff th { background: var(--surface); text-align: left; padding: 8px 12px; font: 700 11px/14px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); border-bottom: 1px solid var(--line); }
.diff td { background: var(--surface); padding: 8px 12px; font: 400 14px/20px var(--font-body); border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.diff tr:last-child td { border-bottom: 0; }

/* ---------- Diálogos ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; padding: 72px 16px; display: flex; justify-content: center; align-items: flex-start; overflow: auto; background: rgba(28,25,23,0.42); -webkit-backdrop-filter: blur(var(--blur-overlay)); backdrop-filter: blur(var(--blur-overlay)); }
.dialog { width: 100%; max-width: 560px; padding: 32px; border-radius: var(--radius-xl); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 20px; }
.dialog.estreito { max-width: 480px; }
.dialog-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-cab > div { display: flex; flex-direction: column; gap: 4px; }
.dialog-acoes { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding-top: 4px; }

/* Upload */
.upload { border: 2px dashed var(--control-border); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; background: var(--surface-sunken); position: relative; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.upload.is-over, .upload:focus-within { border-color: var(--brand); background: var(--brand-soft); box-shadow: var(--glow-soft); }
.upload .orb { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); display: inline-flex; align-items: center; justify-content: center; }
.upload .txt { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.upload input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.progresso { height: 6px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.progresso > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--action-from), var(--brand)); box-shadow: 0 0 10px var(--brand-glow); }

/* ---------- Feed ---------- */
.feed-grade { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px; margin-top: 40px; }
.feed-lado { flex: 1 1 260px; max-width: 320px; display: flex; flex-direction: column; gap: 24px; }
.feed-lado > section { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.disc-lista { display: flex; flex-direction: column; gap: 4px; }
.mais-itens { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 24px; }
.feed-lista .busca { flex: none; }
.feed-lista { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.disc { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--ink); font: 500 15px/22px var(--font-body); text-align: left; cursor: pointer; }
.disc:hover { background: var(--surface-sunken); }
.disc .n { font: 600 12px/16px var(--font-body); color: var(--ink-muted); }
.disc.on, .disc.on:hover { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.disc.on .n { color: var(--brand-text); }
.eventos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.eventos li { display: flex; gap: 12px; align-items: flex-start; }
.dia { flex: 0 0 48px; padding: 6px 0; border-radius: var(--radius-sm); background: var(--brand-soft); text-align: center; }
.dia .m { font: 700 11px/14px var(--font-body); letter-spacing: .08em; color: var(--brand-text); text-transform: uppercase; }
.dia .d { font: 650 20px/24px var(--font-display); color: var(--ink); }
.ev-titulo { font: 600 15px/22px var(--font-body); }

.card { padding: 12px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.card-corpo { flex: 1 1 280px; min-width: 0; padding: 8px 8px 8px 0; display: flex; flex-direction: column; gap: 8px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.card-desc { color: var(--ink-muted); }
.card-pe { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.card-autor { font: 500 14px/20px var(--font-body); }
.vazio-feed { border-radius: var(--radius-xl); padding: 48px 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.orb-soft { width: 56px; height: 56px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); display: inline-flex; align-items: center; justify-content: center; }

/* Miniaturas (ilustrações feitas só com tokens quando não há imagem) */
.thumb { flex: 0 1 240px; min-width: 200px; aspect-ratio: 4 / 3; position: relative; overflow: hidden; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-sunken); }
.thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .fmt { position: absolute; top: 10px; left: 10px; }
.art { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.art-arquivo { background: linear-gradient(160deg, var(--brand-soft), var(--surface-sunken)); }
.art-arquivo .folha { width: 44%; height: 72%; padding: 12px; margin-top: 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 7px; }
.art-arquivo .folha i { display: block; height: 4px; border-radius: 2px; background: var(--line); }
.art-arquivo .folha i:first-child { height: 7px; width: 58%; border-radius: 4px; background: var(--brand); }
.art-arquivo .folha i:nth-child(4) { width: 80%; }
.art-arquivo .folha i:last-child { width: 46%; }
.art-arquivo .ext { position: absolute; bottom: 12px; right: 12px; font: 700 11px/14px var(--font-body); letter-spacing: .08em; color: var(--brand-text); }
.art-link { background: linear-gradient(160deg, var(--surface-sunken), var(--brand-soft)); }
.art-link .janela { width: 70%; height: 62%; margin-top: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; }
.art-link .barra { height: 22%; display: flex; align-items: center; gap: 4px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.art-link .barra span { width: 6px; height: 6px; border-radius: 999px; background: var(--line); }
.art-link .barra b { flex: 1; height: 7px; margin-left: 6px; border-radius: 4px; background: var(--surface-sunken); }
.art-link .meio { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--brand-text); }

/* ---------- Disciplinas do estudante ---------- */
.grade-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.disc-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.disc-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.disc-card dt { color: var(--ink-muted); }
.disc-card dd { margin: 0; }

/* ---------- Calendário ---------- */
.cal-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-nav h2 { min-width: 240px; text-align: center; }
.legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cal-box { padding: 10px; overflow-x: auto; }
.cal { width: 100%; min-width: 720px; table-layout: fixed; border-collapse: separate; border-spacing: 6px; }
.cal th { padding: 6px 0 6px 8px; text-align: left; font: 700 11px/14px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.cal td { height: 112px; vertical-align: top; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.cal td.out { background: transparent; border-color: transparent; }
.cal td.out .d { color: var(--ink-muted); }
.cal td.hoje { border-color: var(--brand-text); box-shadow: 0 0 0 1px var(--brand-text) inset; }
.cal .d { display: block; font: 600 14px/20px var(--font-body); color: var(--ink); }
.ev { display: flex; align-items: flex-start; gap: 4px; width: 100%; margin-top: 4px; padding: 3px 6px; border-radius: 6px; border: 1px solid transparent; text-align: left; font: 600 12px/16px var(--font-body); }
button.ev { cursor: pointer; }
.ev svg { flex: 0 0 auto; margin-top: 2px; }
.ev-prova { background: var(--brand-soft); border-color: var(--canvas-glow-1); color: var(--brand-text); }
.ev-entrega { background: var(--info-soft); color: var(--info); }
.ev-feriado { background: var(--surface-sunken); border-color: var(--line); color: var(--ink-muted); }
.ev-evento { background: var(--success-soft); color: var(--success); }
.agenda { display: flex; flex-direction: column; gap: 24px; }
.agenda-mes { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.agenda-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.agenda-lista li { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.agenda-lista li:last-child { border-bottom: 0; }
.agenda-lista .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Perfil e configurações ---------- */
.perfil-grade { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.perfil-lado { flex: 1 1 260px; max-width: 340px; border-radius: var(--radius-xl); padding: 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; overflow-wrap: anywhere; }
.perfil-dados { flex: 999 1 480px; min-width: 0; padding: 8px 24px; }
.linha-perfil { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.linha-perfil:last-child { border-bottom: 0; }
.row-ico { flex: 0 0 40px; width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--brand-text); display: inline-flex; align-items: center; justify-content: center; }
.row-txt { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.row-txt .valor { font: 500 15px/22px var(--font-body); }
.config-sec { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.canais { display: flex; flex-wrap: wrap; gap: 12px; }
.canal { flex: 1 1 260px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface-sunken); border: 1px solid var(--line); overflow-wrap: anywhere; }
.mx-scroll { overflow-x: auto; }
.mx { width: 100%; border-collapse: collapse; min-width: 480px; }
.mx th { padding: 12px 8px; text-align: center; font: 700 11px/14px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); border-bottom: 1px solid var(--line); }
.mx th.first { text-align: left; padding-left: 0; }
.mx td { padding: 14px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: center; }
.mx td.first { text-align: left; padding-left: 0; }
.mx tr:last-child td { border-bottom: 0; }
.pref { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.pref:last-child { border-bottom: 0; }
.pref > div:first-child { flex: 1 1 280px; min-width: 0; }
.sw-hit { flex: 0 0 auto; width: 56px; height: 44px; padding: 0; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sw-track { position: relative; display: block; width: 48px; height: 28px; border-radius: 999px; border: 1px solid var(--control-border); background: var(--surface-sunken); }
.sw-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: var(--control-border); transition: transform .15s ease; }
.sw-on .sw-track { background: var(--brand-text); border-color: var(--brand-text); }
.sw-on .sw-track::after { transform: translateX(20px); background: #fff; }

/* ---------- Entrar ---------- */
.entrar { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.entrar-card { width: 100%; max-width: 440px; padding: 32px; border-radius: var(--radius-xl); display: flex; flex-direction: column; gap: 20px; }
.contas-demo { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface-sunken); border: 1px solid var(--line); }
.contas-demo code { font: 500 13px/19px ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Erros do Blazor ---------- */
#blazor-error-ui { display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1000; padding: 12px 16px; border-radius: var(--radius-md); background: var(--danger-soft); color: var(--danger); font-weight: 600; box-shadow: var(--shadow-md); }
#blazor-error-ui .reload { margin-left: 12px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; border: 0; background: none; color: inherit; }

/* ---------- Celular ---------- */
@media (max-width: 760px) {
  .topo { margin: 12px 12px 0; padding: 8px 12px; }
  .topo .nav { display: none; }
  .topo-dir .badge { display: none; }
  .pagina { padding: 32px 16px 120px; }
  .display-lg { font: 650 28px/34px var(--font-display); letter-spacing: -0.015em; }
  .secao, .feed-grade { margin-top: 24px; }
  /* No celular a ordem é: disciplinas, módulos, lista de conteúdos e, por último, próximos eventos. */
  .feed-grade { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 16px; }
  .feed-lado { display: contents; }
  .feed-lado > section { flex: none; padding: 16px; gap: 8px; }
  .feed-disc { order: 1; }
  .feed-mod { order: 2; }
  .feed-lista { order: 3; flex: 0 0 auto; width: 100%; }
  .feed-eventos { order: 4; }
  .disc-lista { flex-direction: row; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .disc-lista .disc { width: auto; flex: none; white-space: nowrap; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--control-border); border-radius: var(--radius-pill); background: var(--surface); }
  .disc-lista .disc.on { background: var(--brand-soft); border-color: var(--brand-text); color: var(--brand-text); }
  .card { flex-wrap: nowrap; gap: 12px; }
  .thumb { flex: 0 0 112px; min-width: 0; }
  .thumb .fmt { display: none; }
  .card-corpo { padding: 0; gap: 4px; }
  .card-desc { display: none; }
  .card-pe { padding-top: 4px; }
  .card-pe .btn { min-height: 40px; padding: 0 12px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filtros .f, .busca { flex: 1 1 100%; max-width: none; }
  .filtros .acoes { justify-content: stretch; }
  .filtros .acoes > .btn { flex: 1; }
  .detalhe { padding-left: 0; }
  .dialog { padding: 24px; }
  .scrim { padding: 24px 12px; }
  .cal-nav h2 { min-width: 0; }
  .barra-movel { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; padding: 6px; gap: 4px; border-radius: var(--radius-lg); }
  .barra-movel a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: var(--radius-md); color: var(--ink-muted); font: 600 12px/16px var(--font-body); text-decoration: none; }
  .barra-movel a.active { color: var(--brand-text); background: var(--brand-soft); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Favoritos, etiquetas, módulos e pré-visualização ---------- */
.acoes-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.icon-btn[aria-pressed="true"] { color: var(--brand-text); background: var(--brand-soft); }
.icon-btn[aria-pressed="true"] svg { fill: currentColor; }
.etiquetas { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface-sunken); color: var(--ink-muted); font: 600 12px/16px var(--font-body); cursor: pointer; }
.tag:hover { color: var(--ink); border-color: var(--control-border); }
.tag .n { font-weight: 600; opacity: .8; }
.tag.on { background: var(--brand-soft); border-color: var(--brand-text); color: var(--brand-text); }
.dialog.largo { max-width: 1040px; }
.previa { display: flex; justify-content: center; align-items: center; min-height: 240px; border-radius: var(--radius-md); background: var(--surface-sunken); overflow: hidden; }
.previa iframe { width: 100%; height: min(72vh, 780px); border: 0; background: #fff; }
.previa img { max-width: 100%; max-height: min(72vh, 780px); object-fit: contain; }
.lista-linhas { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.linha-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 8px 8px 16px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface); }
.linha-item .nome { flex: 1 1 220px; min-width: 0; font: 600 15px/22px var(--font-body); }
.linha-item .acoes { display: flex; align-items: center; gap: 4px; }
.estado-canal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.grade-estado { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.grade-estado > .glass { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.num-grande { font: 700 32px/36px var(--font-display); }
.cola { word-break: break-all; font: 500 13px/20px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-sunken); border: 1px solid var(--line); user-select: all; }
.erros-lista { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 640px) {
  .acoes-card { justify-content: flex-start; }
  .previa iframe { height: 64vh; }
}

/* ---------- Seletor de tema (claro/escuro) ---------- */
.seletor-tema { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-md); background: var(--surface-sunken); border: 1px solid var(--line); }
.seletor-tema button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--ink-muted); font: 600 14px/20px var(--font-body); cursor: pointer; }
.seletor-tema button:hover { color: var(--ink); }
:root[data-theme="light"] .seletor-tema button[data-tema="light"],
:root[data-theme="dark"] .seletor-tema button[data-tema="dark"] { background: var(--surface); color: var(--brand-text); box-shadow: var(--shadow-sm); }
.menu-tema { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px; }
.tema-canto { position: fixed; top: 16px; right: 16px; z-index: 20; width: 220px; }
