/* Sumário — sistema de design da app (2026-11).
   Tipos: Fraunces (títulos) + Hanken Grotesk (interface), alojados em fonts/ (sem Google).
   Cor: petróleo (--pri), papel quente (--paper), amarelo marcador (--accent) usado com parcimónia.
   Computador: barra lateral; 761–1080 px: barra estreita; telemóvel: topo + separadores em baixo. */
@font-face { font-family: "Hanken Grotesk"; src: url(fonts/hanken-grotesk.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Fraunces; src: url(fonts/fraunces.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Fraunces; src: url(fonts/fraunces-italic.woff2) format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  --paper: #f6f4ef; --card: #fff; --fill: #f3f0ea; --hover: #faf8f4;
  --line: #e8e4db; --line-2: #d9d4c8;
  --ink: #14232b; --ink-2: #37464e; --muted: #67737a; --faint: #9aa4a9;
  --pri: #1c5166; --pri-2: #17445a; --pri-900: #102c37; --pri-soft: #e3eef2; --pri-softer: #f0f6f8;
  --pri-glow: #1d4c5c; --pri-line: #cfe0e7; --pri-ring: rgba(28, 81, 102, .16);   /* todos os --pri-* mudam com a cor do centro (brandVars no app.js) */
  --accent: #f3c349; --accent-soft: #fdf3d3;
  --ok: #1d8553; --ok-soft: #e1f3e9; --warn: #a8690f; --warn-soft: #fcf0d9; --bad: #c23b2b; --bad-soft: #fbe7e3;
  --tpc: #6b4a9c; --tpc-soft: #f1ebf9;
  --bg: var(--paper);
  --r: 16px; --r-s: 10px;
  --sh-1: 0 1px 2px rgba(20, 35, 43, .04), 0 1px 1px rgba(20, 35, 43, .02);
  --sh-2: 0 6px 20px rgba(20, 35, 43, .08), 0 1px 3px rgba(20, 35, 43, .05);
  --sh-3: 0 24px 60px rgba(10, 25, 32, .28), 0 4px 14px rgba(10, 25, 32, .12);
  --shadow: var(--sh-1);
  --side: 248px;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Fraunces, Georgia, "Times New Roman", serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.noscroll { overflow: hidden; }
a { color: var(--pri); text-decoration: none; }
a:hover { color: var(--pri-2); }
b, strong { font-weight: 650; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h2 { font-size: 1.03rem; font-weight: 700; letter-spacing: -.005em; }
h3 { font-size: .74rem; color: var(--muted); font-weight: 700; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .07em; display: flex; align-items: center; gap: 6px; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small, small { font-size: .82rem; }
.warn-t { color: var(--warn); }
.bad-t { color: var(--bad); }
.grow { flex: 1; min-width: 0; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex.wrap { flex-wrap: wrap; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.cap { text-transform: capitalize; }
.block { display: block; }
.pad { padding: 16px; }
code { background: var(--fill); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ícones (SVG em linha, ver ICONS no app.js) */
.ic { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.22em; }

/* ---------- estrutura: barra lateral ---------- */
body.has-nav { padding-left: var(--side); }
#top { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--side); display: flex; flex-direction: column; padding: 18px 12px 12px; color: #fff;
  background: radial-gradient(130% 55% at 0% 0%, var(--pri-glow) 0%, transparent 62%), var(--pri-900); }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; padding: 4px 8px 18px; min-width: 0; }
.brand:hover { color: #fff; }
.brand img { width: 36px; height: 36px; flex: none; border-radius: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.brand img.own, .login-logo.own, .logo-prev img.own { background: #fff; object-fit: contain; padding: 3px; }
.brand-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
#centro { font-weight: 650; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.brand-t small { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; opacity: .5; margin-top: 3px; font-weight: 600; }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
#nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: rgba(255, 255, 255, .72); font-weight: 500; transition: background .15s, color .15s; }
#nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
#nav a.on { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 650; }
#nav a.on::before { content: ""; position: absolute; left: -12px; top: 50%; width: 4px; height: 20px; margin-top: -10px; border-radius: 0 4px 4px 0; background: var(--accent); }
#nav a.nv-mais { display: none; }   /* «Mais» só existe no telemóvel */
.ni { display: inline-flex; }
.ni .ic { width: 20px; height: 20px; }
.who { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 8px 10px 8px 8px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .09); background: rgba(255, 255, 255, .06); color: #fff; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.who:hover { background: rgba(255, 255, 255, .12); }
.wn { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.wn b { font-size: .88rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wn small { opacity: .62; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-c { opacity: .45; }
.who .av { background: rgba(255, 255, 255, .16); color: #fff; }

main { max-width: 1200px; margin: 0 auto; padding: 36px 40px 80px; }
body:not(.has-nav) main { max-width: none; padding: 0; }

/* a carregar / vazio */
.loading { padding: 8px 0; display: flex; flex-direction: column; gap: 14px; }
body:not(.has-nav) .loading { max-width: 420px; margin: 18vh auto 0; padding: 0 24px; }
.sk { display: block; border-radius: 10px; background: linear-gradient(90deg, #ebe7de 25%, #f4f1ea 37%, #ebe7de 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; }
.sk-t { height: 34px; width: 260px; max-width: 70%; } .sk-s { height: 14px; width: 180px; } .sk-b { height: 220px; border-radius: var(--r); }
.sk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; } .sk-c { height: 92px; border-radius: var(--r); }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
.empty { text-align: center; color: var(--muted); padding: 56px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty > b { color: var(--ink); font-size: 1.02rem; }
.empty p { margin: 0; max-width: 34em; }
.empty .btn { margin-top: 12px; }
.empty-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--fill); color: var(--muted); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.empty-ic .ic { width: 26px; height: 26px; stroke-width: 1.6; }
.nil { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 0; padding: 14px 2px 6px; }
.nil .ic { width: 20px; height: 20px; color: var(--faint); }

/* ---------- blocos ---------- */
.page-title { font-family: var(--serif); font-weight: 600; font-size: 1.95rem; letter-spacing: -.015em; line-height: 1.15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.page-title .pill { font-family: var(--sans); letter-spacing: 0; }
.page-title .dot { width: 12px; height: 12px; margin: 0; }
.eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.sub { margin: 4px 0 18px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .page-title { flex: 1; }
.page-head .grow .page-title { flex: none; }
.page-head .sub { margin: 4px 0 0; }
.back { display: inline-flex; align-items: center; gap: 2px; margin: -6px 0 12px -4px; padding: 4px 8px 4px 2px; border-radius: 8px; font-weight: 600; font-size: .88rem; color: var(--muted); }
.back:hover { color: var(--pri); background: var(--fill); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); padding: 20px; margin-bottom: 18px; }
.card > h2:first-child { margin-bottom: 12px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-height: 32px; }
.card-h h2 { margin: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.card-h > a { font-size: .86rem; font-weight: 600; }
.h-count { flex-wrap: wrap; row-gap: 0; }
.h-count small { font-size: .8rem; font-weight: 500; color: var(--muted); white-space: nowrap; letter-spacing: 0; }
.h-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--pri-soft); color: var(--pri); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.h-ic .ic { width: 17px; height: 17px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 18px; align-items: start; }
.cols > .card { margin: 0; }
/* Início: cada coluna é uma pilha própria, para um cartão comprido não deixar buracos ao lado */
.cols > .col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.col > .card { margin: 0; }
.cols.masonry { display: block; columns: 2 380px; column-gap: 18px; }
.cols.masonry > .card { break-inside: avoid; margin: 0 0 18px; }
.pr-d { min-width: 96px; font-weight: 600; }
.sum-h { display: flex; align-items: baseline; gap: 2px; margin-bottom: 2px; }
.sum-h small { margin-left: 8px; }
.row.block p { margin: 4px 0 0 17px; color: var(--ink-2); }
.row.block .tpc { margin: 6px 0 0 17px; }
.row.block small.tpc { margin: 4px 0 0; }
.sec { margin: 26px 0 12px; }
details.sec summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.alert, .acct-banner { position: relative; padding: 11px 14px 11px 42px; border-radius: 12px; margin: 0 0 14px; font-weight: 500; border: 1px solid transparent; }
.alert::before, .acct-banner::before { content: ""; position: absolute; left: 13px; top: 12px; width: 19px; height: 19px; background: currentColor;
  -webkit-mask: var(--i-alert) center / contain no-repeat; mask: var(--i-alert) center / contain no-repeat; }
.alert { background: var(--bad-soft); color: #8f2b1f; border-color: #f3cdc6; }
.alert.soft { background: var(--warn-soft); color: #6b4708; border-color: #f1dcb0; }
.alert a, .acct-banner a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.alert .btn { flex: none; }
.acct-banner { background: var(--pri-soft); color: var(--pri-2); border-color: var(--pri-line); font-size: .92rem; }
.acct-banner::before { -webkit-mask-image: var(--i-info); mask-image: var(--i-info); }
.acct-banner.warn { background: var(--warn-soft); color: #6b4708; border-color: #f1dcb0; }
.acct-banner.bad { background: var(--bad-soft); color: #8f2b1f; border-color: #f3cdc6; }
:root {
  --i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.8 19.5h18.4L12 4z'/%3E%3Cpath d='M12 10v4.5M12 17.2v.1'/%3E%3C/svg%3E");
  --i-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5M12 7.8v.1'/%3E%3C/svg%3E");
  --i-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2367737a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --i-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2367737a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* indicadores */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: start; align-content: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); padding: 16px 16px 14px 18px; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
a.tile:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.tile-ic { grid-area: 1 / 2 / 3 / 3; width: 38px; height: 38px; border-radius: 12px; background: var(--pri-soft); color: var(--pri); display: flex; align-items: center; justify-content: center; }
.tile-ic .ic { width: 20px; height: 20px; }
.tile-k { font-size: .82rem; font-weight: 600; color: var(--muted); padding-top: 2px; }
.tile b { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.tile-s { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.tile.warn .tile-ic { background: var(--warn-soft); color: var(--warn); }
.tile.ok .tile-ic { background: var(--ok-soft); color: var(--ok); }
/* Início: colunas pelo número de quadros (data-n), para nunca ficar um sozinho numa linha — 6 = 3 + 3, 5 = 3 + 2 (grelha de 6) */
@media (min-width: 761px) {
  .tiles[data-n="2"], .tiles[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles[data-n="3"], .tiles[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles[data-n="5"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tiles[data-n="5"] > * { grid-column: span 2; }
  .tiles[data-n="5"] > :nth-child(n+4) { grid-column: span 3; }
}
@media (min-width: 1000px) { .tiles[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stats > div { background: var(--fill); border-radius: 12px; padding: 10px 12px; }
.stats > div:first-child { background: var(--pri-soft); }
.stats > div:first-child b { color: var(--pri); }
.stats b { display: block; font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; } .stats span { font-size: .76rem; color: var(--muted); }
.big-num { font-family: var(--serif); font-size: 2.3rem; font-weight: 600; color: var(--pri); letter-spacing: -.02em; line-height: 1.1; }

/* listas */
.list { list-style: none; margin: 0; padding: 0; }
.list.card { padding: 6px 0; overflow: hidden; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 8px; margin: 0 -8px; width: calc(100% + 16px); border-radius: 10px; color: var(--ink); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; transition: background .12s; }
.list.card .row { padding: 12px 20px; margin: 0; width: 100%; border-radius: 0; }
li.row { cursor: default; }
a.row:hover, button.row:hover { background: var(--hover); color: var(--ink); }
.row.block { display: block; }
.row small, .grow small { display: block; color: var(--muted); }
.row.inactive, .inactive { opacity: .55; }
.time { display: flex; flex-direction: column; align-items: flex-end; min-width: 50px; line-height: 1.25; }
.time b { font-weight: 700; }
.lesson .time { padding-right: 12px; border-right: 3px solid var(--c, var(--line-2)); }
/* aulas de hoje: a que está a decorrer destaca-se; as já registadas ficam mais apagadas */
.lesson.now { background: var(--accent-soft); }
.lesson.now:hover { background: var(--accent-soft); filter: brightness(.98); }
.pill.now { background: var(--accent); color: var(--ink); }
.lesson.done .grow b, .lesson.done .time b { color: var(--ink-2); }
.prox-q { margin: -4px 0 4px; }
.por-reg { border-left: 4px solid var(--warn); }
/* Início da direcção: «Para tratar» junta tudo o que pede acção; vazio, é uma linha só com o visto */
.todo { border-left: 4px solid var(--warn); }
.todo-n { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; }
.todo-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); display: inline-flex; align-items: center; justify-content: center; flex: none; align-self: flex-start; }
.todo-ic .ic { width: 18px; height: 18px; }
.todo .row .grow > b { font-weight: 650; }
.todo div.row { cursor: default; padding-bottom: 6px; }
.todo-sub { list-style: none; margin: 0 0 8px 46px; padding: 0; }
.todo-sub a { display: flex; align-items: center; gap: 2px; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; color: var(--ink); }
.todo-sub a:hover { background: var(--hover); color: var(--ink); }
.todo-sub li + li { border-top: 1px dashed var(--line); }
.todo-sub .grow small { display: inline; margin-left: 6px; color: var(--muted); }
.todo-mais { margin: -2px 0 10px 46px; }
.todo.vazio { display: flex; align-items: center; gap: 12px; border-left-color: var(--ok); padding-top: 16px; padding-bottom: 16px; }
.todo.vazio .todo-ic { background: var(--ok-soft); color: var(--ok); align-self: center; }
.todo.vazio small { display: block; color: var(--muted); }
.tile .meter { max-width: none; height: 6px; margin: 7px 0 5px; }
.t-mais { margin-top: 10px; font-size: .86rem; }
.card-h > .linkish { display: inline-flex; align-items: center; gap: 3px; font-size: .86rem; }
.card-h > .linkish .ic { width: 15px; height: 15px; }
.pills { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.faltas-home .row { align-items: flex-start; }
.faltas-home .row > .av { margin-top: 2px; }
.chev { color: var(--faint); display: inline-flex; flex: none; }
.chev .ic { width: 18px; height: 18px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; flex: none; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--pri-soft); color: var(--pri); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; letter-spacing: .01em; flex: none; }
.av.big { width: 56px; height: 56px; font-size: 1.1rem; }
.av-1 { background: #fdf0d2; color: #8a5a00; } .av-2 { background: #e2f3e9; color: #1d6b45; } .av-3 { background: #f0e9f8; color: #5f3f91; }
.av-4 { background: #fde8e2; color: #a33a22; } .av-5 { background: #e6ebfb; color: #2f4aa0; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: var(--fill); color: var(--ink-2); font-size: .75rem; font-weight: 650; line-height: 1.5; white-space: nowrap; }
.pill .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.pill.ok, .pill.st-P { background: var(--ok-soft); color: var(--ok); }
.pill.warn, .pill.st-A, .pill.st-FJ { background: var(--warn-soft); color: var(--warn); }
.pill.bad, .pill.st-F { background: var(--bad-soft); color: var(--bad); }
.tpc { color: var(--tpc); }
.tpc-l { display: inline-block; font-size: .66rem; font-weight: 800; letter-spacing: .06em; background: var(--tpc-soft); color: var(--tpc); border-radius: 5px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.mini { list-style: none; padding: 0; margin: 0; }
.mini li { padding: 8px 0; border-top: 1px solid var(--line); }
.mini li:first-child { border: 0; padding-top: 2px; }
.mini .sm { font-size: .88rem; color: var(--ink-2); margin: 3px 0 0 17px; }
.mini .sm .tpc { margin-top: 4px; }
.mini small { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--card); border: 1px solid var(--line-2); border-radius: 99px; padding: 6px 13px; color: var(--ink); font: inherit; font-size: .87rem; font-weight: 550; cursor: pointer; transition: border-color .12s, background .12s; }
.chip:hover { border-color: var(--pri); color: var(--ink); }
.chip small { color: var(--muted); }
.chip .dot { margin-right: 3px; }
.chip.on { background: var(--pri); border-color: var(--pri); color: #fff; }
.chip b { margin-left: 3px; font-size: .8rem; font-weight: 650; opacity: .6; }
.chip.on b { opacity: .8; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; margin: 0 0 8px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 550; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; font: inherit; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; font-weight: 600; transition: color .12s; }
.tabs a:hover { color: var(--ink); }
.tabs .on { color: var(--ink); border-bottom-color: var(--pri); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .71rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.r, .tbl td.r { text-align: right; }

/* ---------- formulários e botões ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form h3 { margin: 4px 0 0; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: var(--ink-2); font-weight: 600; }
input, select, textarea { font: inherit; font-size: 15px; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 0 12px; height: 42px; width: 100%; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #c5bfb1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-ring); }
select { -webkit-appearance: none; appearance: none; padding-right: 34px; background: #fff var(--i-down) right 10px center / 16px no-repeat; cursor: pointer; }
input[type=search] { padding-left: 38px; background: #fff var(--i-search) 12px center / 17px no-repeat; -webkit-appearance: none; appearance: none; }
input[type=checkbox], input[type=radio] { height: auto; padding: 0; }
input[type=color] { padding: 3px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }
/* palavra-passe: a dica por baixo, mais leve que o rótulo, com o «gerar uma» */
.pw-gerar { border: 0; background: none; padding: 0; font: inherit; font-weight: 650; color: var(--pri); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pw-gerar:hover { color: var(--pri-900); }
/* o olho dentro do campo (mostrar/esconder); o Edge tem um olho próprio, que se esconde para não ficarem dois */
.pw-c { position: relative; display: flex; flex: 1; min-width: 0; } .pw-c input { flex: 1; min-width: 0; padding-right: 46px; }
.pw-c input::-ms-reveal, .pw-c input::-ms-clear { display: none; }
.pw-ver { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.pw-ver:hover { color: var(--ink); background: var(--hover); } .pw-ver:focus-visible { outline: 2px solid var(--pri-ring); outline-offset: 0; }
.pw-ver .ic { width: 19px; height: 19px; }
.pw-dica { font-weight: 450; font-size: .76rem; line-height: 1.35; }
label.check { flex-direction: row; align-items: center; gap: 9px; color: var(--ink); font-weight: 450; font-size: .93rem; cursor: pointer; }
label.check input { width: 18px; height: 18px; flex: none; accent-color: var(--pri); }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 0; }
legend { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 0 6px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 12px; }
.checks.scroll { max-height: 240px; overflow: auto; margin-top: 10px; }
.filter { font-size: 14px !important; height: 36px !important; }
.ee-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.ee-row label { flex: 1; }
.ee-row input[data-par] { width: 130px; flex: none; height: 34px; font-size: 14px; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; margin-bottom: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-s); background: var(--pri); color: #fff; font: inherit; font-size: .92rem; font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .12s, box-shadow .12s, transform .06s; box-shadow: 0 1px 2px rgba(16, 44, 55, .25); }
.btn:hover { background: var(--pri-2); color: #fff; }
.btn:active { transform: scale(.98); }
.btn .ic { width: 17px; height: 17px; stroke-width: 2.1; }
.btn.small { height: 32px; padding: 0 11px; font-size: .84rem; border-radius: 8px; }
.btn.small .ic { width: 15px; height: 15px; }
.btn.big { height: 48px; padding: 0 26px; font-size: 1rem; }
.btn.full { width: 100%; height: 46px; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--hover); box-shadow: inset 0 0 0 1px #bfb9aa; color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger:hover { background: #a93224; }
.btn.ghost.danger { background: #fff; color: var(--bad); box-shadow: inset 0 0 0 1px #efc3bd; }
.btn.ghost.danger:hover { background: var(--bad-soft); }
.btn.busy { opacity: .6; pointer-events: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); cursor: pointer; flex: none; transition: background .12s, border-color .12s; }
.icon-btn:hover { background: var(--hover); border-color: #bfb9aa; color: var(--ink); }
.icon-btn .ic { width: 18px; height: 18px; }
td .icon-btn, .modal-head .icon-btn, .row .icon-btn { border-color: transparent; background: none; }
td .icon-btn:hover, .modal-head .icon-btn:hover { background: var(--fill); }
.icon-btn.disabled { opacity: .35; pointer-events: none; }
.danger-zone { border-color: #efc3bd; }

.toggles { display: flex; flex-direction: column; }
.toggle { flex-direction: row; align-items: center; gap: 12px; color: var(--ink); font-size: .95rem; font-weight: 500; cursor: pointer; padding: 10px 0; border-top: 1px solid var(--line); }
.toggle:first-child { border-top: 0; }
.toggle > span:last-child { order: -1; flex: 1; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw { width: 42px; height: 24px; border-radius: 99px; background: #cdc8bc; position: relative; transition: background .2s; flex: none; }
.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.toggle input:checked + .sw { background: var(--ok); }
.toggle input:checked + .sw::after { left: 21px; }
.toggle input:focus-visible + .sw { outline: 2px solid var(--pri); outline-offset: 2px; }

/* controlos segmentados */
.seg-view { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-view button, .page-head .seg-view a.sv { border: 0; background: none; height: 32px; padding: 0 13px; border-radius: 8px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; }
.seg-view button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 35, 43, .14); }
.seg-choice { display: grid; grid-template-columns: 1fr 1fr; background: var(--fill); border-radius: 12px; padding: 4px; gap: 4px; }
.seg-choice label { display: block; cursor: pointer; }
.seg-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-choice span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 9px; font-size: .95rem; font-weight: 650; color: var(--muted); transition: background .12s, color .12s; }
.seg-choice label:first-child input:checked + span { background: var(--ok); color: #fff; box-shadow: 0 1px 3px rgba(29, 133, 83, .35); }
.seg-choice label:last-child input:checked + span { background: #fff; color: var(--bad); box-shadow: 0 1px 2px rgba(20, 35, 43, .14); }
.seg-choice input:focus-visible + span { outline: 2px solid var(--pri); outline-offset: 2px; }

/* ---------- modal e toast ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(12, 28, 35, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px 24px; overflow: auto; animation: fade .15s ease-out; }
.modal { background: var(--card); border-radius: 18px; width: 100%; max-width: 480px; box-shadow: var(--sh-3); animation: pop .18s cubic-bezier(.2, .8, .3, 1); }
.modal.wide { max-width: 700px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 16px 4px 22px; }
.modal-head h2 { flex: 1; margin: 0; font-size: 1.15rem; letter-spacing: -.01em; }
.modal-body { padding: 10px 22px 22px; }
.modal .actions { margin-top: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes sheet { from { transform: translateY(40px); opacity: .6; } }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); display: flex; align-items: center; gap: 9px; background: var(--ink); color: #fff; padding: 11px 18px 11px 14px; border-radius: 12px; font-weight: 550; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100% - 32px); box-shadow: var(--sh-2); }
body.has-nav #toast { left: calc(50% + var(--side) / 2); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast .ic { color: #7ddba8; width: 19px; height: 19px; }
#toast.bad { background: #8f2b1f; }
#toast.bad .ic { color: #ffd0c8; }

/* ---------- entrada ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login.solo { grid-template-columns: 1fr; }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 44px 56px 56px 96px; display: flex; flex-direction: column;
  background: linear-gradient(90deg, transparent 63px, rgba(243, 195, 73, .55) 63px, rgba(243, 195, 73, .55) 64.5px, transparent 64.5px),
    repeating-linear-gradient(180deg, transparent 0 37px, rgba(255, 255, 255, .055) 37px 38px),
    radial-gradient(90% 60% at 10% 0%, var(--pri-glow) 0%, transparent 70%), var(--pri-900); }
.la-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.15rem; }
.la-brand img { border-radius: 10px; }
.la-quote { font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.12; letter-spacing: -.02em; margin: auto 0 28px; max-width: 12em; }
.la-quote em { font-style: italic; background: linear-gradient(transparent 64%, rgba(243, 195, 73, .42) 64% 92%, transparent 92%); padding: 0 .08em; }
.la-list { list-style: none; margin: 0 0 auto; padding: 0; display: grid; gap: 14px; color: rgba(255, 255, 255, .86); font-size: 1.02rem; }
.la-list li { display: flex; align-items: center; gap: 14px; }
.la-list .ic { width: 20px; height: 20px; padding: 9px; box-sizing: content-box; border-radius: 12px; background: rgba(255, 255, 255, .09); color: var(--accent); }
.login-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-family: var(--serif); font-weight: 600; font-size: 1.8rem; letter-spacing: -.015em; margin: 0 0 6px; }
.login-card .form { margin-top: 22px; }
.login-card .form + p { margin-top: 14px; }
.login-logo { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 18px; box-shadow: var(--sh-2); display: none; }
.login.solo .login-logo, .login-logo.own { display: block; }
.login-logo.own { width: 72px; height: 72px; border-radius: 16px; padding: 6px; border: 1px solid var(--line); box-shadow: var(--sh-1); }
.demo-box { margin-top: 26px; padding: 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.demo-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.demo-h b { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; background: var(--accent-soft); color: #7a5600; padding: 2px 8px; border-radius: 6px; }
.demo-h span { color: var(--muted); font-size: .82rem; }
.demo-list { display: flex; flex-direction: column; gap: 2px; margin: 0 -6px 8px; }
.demo-u { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 12px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: background .12s; }
.demo-u:hover { background: var(--fill); }
.demo-u small { display: block; color: var(--muted); }
.demo-ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--pri-soft); color: var(--pri); flex: none; }
.demo-ic.role-professor { background: #fdf0d2; color: #8a5a00; } .demo-ic.role-ee { background: #e2f3e9; color: #1d6b45; } .demo-ic.role-aluno { background: #f0e9f8; color: #5f3f91; }
.demo-go { color: var(--faint); transition: transform .12s, color .12s; }
.demo-u:hover .demo-go { color: var(--pri); transform: translateX(3px); }
.powered { display: block; text-align: center; margin-top: 26px; color: var(--muted); font-size: .82rem; }

/* conta (janela do utilizador) */
.acct { display: flex; align-items: center; gap: 14px; padding-bottom: 6px; }
.acct small { display: block; color: var(--muted); }

/* ---------- início: educando ---------- */
.card.educando { padding: 0; overflow: hidden; }
.educando .ed-head { display: flex; align-items: center; gap: 14px; color: var(--ink); padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--pri-softer), #fff); }
.educando .ed-head b { font-size: 1.08rem; }
.educando .ed-head small { display: block; color: var(--muted); }
.educando > .alert { margin: 14px 20px 0; }
/* duas colunas (aulas, sumários e materiais | assiduidade, testes e notas); o -1px põe o filete do 1.º bloco por cima do
   do cabeçalho (ou fora do cartão, no aluno, que não tem cabeçalho) */
.ed-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); margin-top: -1px; }
.ed-grid > :only-child { grid-column: 1 / -1; }
.ed-col + .ed-col { border-left: 1px solid var(--line); }
.ed-b { padding: 16px 20px 18px; border-top: 1px solid var(--line); }
.ed-b h3 { margin-top: 0; }
.ed-b h3 .ic { color: var(--faint); width: 15px; height: 15px; }
.ed-b .card-h { min-height: 0; margin: 0 0 8px; }
.ed-b .card-h h3 { margin: 0; flex: 1; }
.ed-b .card-h .linkish { display: inline-flex; align-items: center; gap: 3px; font-size: .84rem; }
.ed-b .card-h .linkish .ic { width: 15px; height: 15px; }
.ed-b .testes .row { padding: 8px 0; margin: 0; width: 100%; border-radius: 0; gap: 2px; align-items: flex-start; }
.ed-b .testes .row > .dot { margin-top: .55em; }
.ed-b .testes li:first-child .row { padding-top: 2px; }
.ed-b .testes .row:hover { background: none; }
.as-row { display: flex; align-items: center; gap: 16px; }
.as-row .meter { margin: 4px 0 6px; }
.as-row p { margin: 0; }
.mini-r { display: flex; align-items: baseline; gap: 2px; }
.mini-r .dot { align-self: flex-start; margin-top: .55em; }
.mini-r > .ic { align-self: flex-start; width: 16px; height: 16px; margin: .25em 8px 0 0; color: var(--muted); }
.mini-r small { display: block; }
.mini-t { flex: none; min-width: 80px; font-weight: 650; }
.ed-aulas .mini-t { min-width: 6.4em; }
/* separadores dos educandos (encarregado com mais de um) */
.ed-tabs { display: flex; gap: 8px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.ed-tabs::-webkit-scrollbar { display: none; }
.ed-tab { display: inline-flex; align-items: center; gap: 9px; flex: none; padding: 5px 16px 5px 5px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--card); color: var(--ink-2); font: inherit; font-weight: 650; cursor: pointer; transition: background .12s, border-color .12s; }
.ed-tab:hover { border-color: var(--pri-line); }
.ed-tab .av { width: 30px; height: 30px; font-size: .7rem; }
.ed-tab[aria-selected="true"] { background: var(--pri); border-color: var(--pri); color: #fff; }
.ed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--card); }
.nota { flex: none; font-weight: 700; background: var(--fill); border-radius: 8px; padding: 2px 9px; align-self: center; }

/* ---------- aula ---------- */
.datebar { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 20px; }
.datebar > b { min-width: 150px; text-align: center; font-size: 1.02rem; }
.date-pick { position: relative; flex-direction: row; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; font-size: .95rem; color: var(--ink); }
.date-pick .ic { color: var(--muted); }
.date-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: 100%; }
.pres li { padding: 10px 0; }
.pres-row { display: flex; align-items: center; gap: 12px; }
.pres-row a { color: var(--ink); font-weight: 600; }
.seg { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 3px; gap: 2px; flex: none; }
.seg button { border: 0; background: none; height: 34px; padding: 0 12px; border-radius: 8px; font: inherit; font-size: .86rem; font-weight: 650; color: var(--muted); cursor: pointer; transition: background .1s, color .1s; }
.seg button:hover { color: var(--ink); background: rgba(255, 255, 255, .7); }
.seg .l { display: none; }
.seg .st-P.on { background: var(--ok); color: #fff; }
.seg .st-A.on, .seg .st-FJ.on { background: #c98a1e; color: #fff; }
.seg .st-F.on { background: var(--bad); color: #fff; }
.obs-t.has { color: var(--pri); background: var(--pri-soft); }
.obs { margin: 8px 0 0 48px; width: calc(100% - 48px); height: 36px; font-size: 14px; }
.obs-ro { display: block; margin: 4px 0 0 48px; }
.legend { display: none; margin: 10px 0 0; }
.actions.sticky { position: sticky; bottom: 16px; justify-content: center; padding: 8px 0 0; pointer-events: none; }
.actions.sticky .btn { pointer-events: auto; box-shadow: var(--sh-2); min-width: 280px; }
.tpc-box { background: var(--tpc-soft); color: #4d3378; border-radius: 12px; padding: 10px 14px; margin-top: 10px; }

/* ---------- alunos ---------- */
.vistas { margin-bottom: 12px; }
.vistas .alert-divida:not(.on) { border-color: #efc3bd; }
.vistas .alert-semee:not(.on), .vistas .alert-assid:not(.on) { border-color: #ecd3a5; }
.card.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { flex: 2 1 240px; }
.filters select { flex: 1 1 150px; width: auto; min-width: 0; }   /* sem min-width o select ficava da largura da opção mais comprida (nomes de grupos) */
.filters .f-q { display: contents; }   /* no computador a pesquisa fica na mesma linha dos filtros; o botão «Filtros» é só do telemóvel */
.filters .f-tog { display: none; }
.f-n { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--pri); color: #fff; font-size: .72rem; font-weight: 700; }
.nav-mais a { display: flex; align-items: center; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.nav-mais a:last-child { border-bottom: 0; }
.nav-mais a > .ic { width: 22px; height: 22px; color: var(--muted); }
.nav-mais a.on, .nav-mais a.on > .ic { color: var(--pri); }
.nav-mais .chev { margin-left: auto; color: var(--muted); }
.card.al-sec { padding: 4px 0 6px; overflow: hidden; }
.al-sec-t { display: flex; align-items: center; gap: 4px; padding: 14px 20px 10px; margin: 0; font-size: 1rem; }
.al-sec-t .muted { font-weight: 600; font-size: .78rem; margin-left: 6px; background: var(--fill); border-radius: 99px; padding: 1px 8px; }
.al-head, .al-row { display: grid; grid-template-columns: var(--al-cols); gap: 16px; align-items: center; padding: 11px 20px; }
.al-head { font-size: .71rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.al-row { color: var(--ink); transition: background .12s; }
.al-row:hover { background: var(--hover); color: var(--ink); }
.al-row small { display: block; color: var(--muted); }
.al-name { display: flex; gap: 12px; align-items: center; min-width: 0; }
.al-grupos { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.al-grupos .gchip { max-width: 100%; }   /* em ecrãs médios a coluna é estreita: o nome corta-se com «…» em vez de passar por cima da coluna ao lado */
.al-grupos .gchip > span { overflow: hidden; text-overflow: ellipsis; }
.gchip { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 550; padding: 2px 9px 2px 7px; border-radius: 99px; background: color-mix(in srgb, var(--c) 10%, white); color: color-mix(in srgb, var(--c) 45%, var(--ink)); white-space: nowrap; }
.gchip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.al-ee { display: flex; flex-direction: column; gap: 3px; font-size: .89rem; min-width: 0; }
.al-ee b { font-weight: 600; }
.al-ee small { display: inline; margin-left: 4px; }
.al-ee small.warn-t { margin: 0; }
.al-assid, .al-pay { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.meter { display: block; width: 100%; max-width: 100px; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.meter.mid i { background: #d39a2a; } .meter.low i { background: var(--bad); }
.meter.big { max-width: none; height: 10px; border-radius: 5px; }
.meter.big i { border-radius: 5px; }
.al-top { position: sticky; top: 0; z-index: 5; padding: 0; margin-bottom: 10px; border-radius: 12px; box-shadow: none; background: var(--fill); border-color: transparent; }
.al-top .al-head { padding: 9px 20px; }
.al-sec .list > li:first-child { border-top: 1px solid var(--line); }

/* ---------- horário ---------- */
.h-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.weeknav { display: flex; align-items: center; gap: 8px; }
.wk-label { min-width: 150px; text-align: center; font-size: 1.02rem; }
.h-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.h-filters select { width: auto; height: 36px; font-size: 14px; }
.h-sum { margin: 0 0 12px; }
.card.h-grid { display: grid; grid-template-columns: 56px repeat(var(--days), minmax(0, 1fr)); padding: 0 10px 14px 0; overflow: hidden; }
.h-corner { border-bottom: 1px solid var(--line); }
.h-dh { padding: 12px 10px 10px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.h-dh b { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.h-dh small { font-size: .95rem; font-weight: 650; color: var(--ink); }
.h-dh.today b { color: var(--pri); }
.h-dh.today small { background: var(--pri); color: #fff; padding: 1px 9px; border-radius: 99px; }
.h-axis { position: relative; margin-top: 12px; }
.h-axis span { position: absolute; right: 10px; transform: translateY(-50%); font-size: .72rem; color: var(--faint); font-weight: 600; }
.h-col { position: relative; border-left: 1px solid var(--line); margin-top: 12px; }
.h-col.today { background: var(--pri-softer); }
.h-line { position: absolute; left: 0; right: 0; border-top: 1px solid #f0ece4; }
.h-now { position: absolute; left: -1px; right: 0; border-top: 2px solid var(--bad); z-index: 3; }
.h-now::before { content: ""; position: absolute; left: -5px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.h-slot { position: absolute; z-index: 2; overflow: hidden; display: flex; flex-direction: column; gap: 1px; padding: 6px 8px 6px 11px; border-radius: 9px; color: var(--ink); word-break: break-word;
  background: color-mix(in srgb, var(--c) 11%, white); border: 1px solid color-mix(in srgb, var(--c) 24%, white); box-shadow: inset 3px 0 0 var(--c); font-size: .8rem; line-height: 1.28; transition: box-shadow .12s, transform .12s; }
.h-slot:hover { color: var(--ink); z-index: 4; overflow: visible; min-height: fit-content; transform: translateY(-1px); box-shadow: inset 3px 0 0 var(--c), var(--sh-2); background: color-mix(in srgb, var(--c) 16%, white); }
.h-slot.conflict { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--c), 0 0 0 1px var(--bad); }
.s-time { font-size: .72rem; color: var(--ink-2); font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; opacity: .85; }
.s-name { font-weight: 700; }
.s-sub, .s-who { font-size: .74rem; color: var(--ink-2); opacity: .8; }
.s-who { color: var(--pri); font-weight: 650; opacity: 1; }
.s-st { display: inline-flex; align-items: center; gap: 3px; font-size: .68rem; font-weight: 700; padding: 0 7px; border-radius: 99px; line-height: 1.65; white-space: nowrap; }
.s-st .ic { width: 10px; height: 10px; stroke-width: 3; }
.s-st.ok { background: var(--ok-soft); color: var(--ok); }
.s-st.todo { background: var(--warn-soft); color: var(--warn); }
.s-st.tpc { background: var(--tpc-soft); color: var(--tpc); }
.s-conf { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; color: var(--bad); font-weight: 700; cursor: help; }
.h-slot.short .s-sub { display: none; }
.h-slot .s-conf { display: none; }
.h-list h2 .muted { font-weight: 500; font-size: .86rem; margin-left: 4px; }
.tbl.hl { table-layout: fixed; }
.tbl.hl th:nth-child(1) { width: 120px; } .tbl.hl th:nth-child(3) { width: 20%; } .tbl.hl th:nth-child(4) { width: 14%; }
.tbl.hl th:nth-child(5) { width: 70px; } .tbl.hl th:nth-child(6) { width: 130px; }
.tbl.hl td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl.hl td a { color: var(--ink); font-weight: 600; }
.h-agenda { display: none; }
.conf-list { margin: 4px 0 0; padding-left: 20px; font-weight: 400; }

/* ---------- mensalidades ---------- */
.m-sum-top { display: flex; flex-wrap: wrap; gap: 16px 36px; justify-content: space-between; align-items: flex-end; margin-bottom: 14px; }
.m-sum-top > div:first-child { display: flex; flex-direction: column; }
.m-sum-top > div:first-child .small { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.m-sum-side { display: flex; gap: 28px; flex-wrap: wrap; }
.m-sum-side div { display: flex; flex-direction: column; }
.m-sum-side b { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.m-sum-side span { font-size: .8rem; color: var(--muted); }
.m-sum-side .bad-t span { color: var(--bad); }
.m-met { margin: 10px 0 0; }
.m-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.m-tools .chips { margin: 0; }
.m-tools input { max-width: 300px; }
.chip.mini { white-space: nowrap; padding: 2px 9px; font-size: .76rem; font-weight: 650; border-color: #efc3bd; color: var(--bad); background: var(--bad-soft); }
.chip.mini:hover { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.tbl .ck { width: 34px; }
.tbl .ck input, #ck-all { width: 18px; height: 18px; accent-color: var(--pri); cursor: pointer; }
.tbl td a b { color: var(--ink); }
.tbl td a:hover b { color: var(--pri); }
.tbl tr.paid td:not(:last-child) { opacity: .78; }
.tbl .acts { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.m-atr small { margin-top: 4px; }
.m-atr a b { color: var(--ink); }
.bulkbar { position: fixed; left: calc(50% + var(--side) / 2); transform: translateX(-50%); bottom: 24px; z-index: 40; display: flex; gap: 10px; align-items: center; background: var(--ink); color: #fff; padding: 10px 10px 10px 20px; border-radius: 14px; box-shadow: var(--sh-3); max-width: calc(100% - 24px); font-weight: 600; animation: pop .18s ease-out; }
.bulkbar .btn { box-shadow: none; }
.bulkbar .btn:not(.ghost) { background: var(--accent); color: var(--ink); }
.bulkbar .btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.actions.share { justify-content: flex-start; }
.card.m-year-wrap { padding: 0; overflow: hidden; }
.m-year-scroll { overflow-x: auto; }
.m-year { border-collapse: collapse; width: 100%; font-size: .88rem; }
.m-year th, .m-year td { padding: 7px 5px; border-bottom: 1px solid var(--line); text-align: center; }
.m-year thead th { font-size: .71rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding-top: 12px; padding-bottom: 10px; background: var(--hover); }
.m-year thead th a { color: inherit; }
.m-year thead th.cur a { background: var(--pri); color: #fff; padding: 2px 8px; border-radius: 99px; }
.m-year .mn { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; padding-left: 20px; min-width: 170px; font-weight: 400; }
.m-year thead .mn { background: var(--hover); }
.m-year .mn a { color: var(--ink); font-weight: 650; }
.m-year .mn small { display: block; color: var(--muted); font-size: .74rem; }
.m-year tfoot th { font-weight: 650; font-size: .8rem; }
.m-year tfoot tr:last-child td, .m-year tfoot tr:last-child th { border-bottom: 0; }
.m-year td.r, .m-year th.r { text-align: right; padding-right: 20px; }
.mc button { border: 0; border-radius: 7px; font: inherit; font-size: .74rem; font-weight: 700; min-width: 42px; height: 26px; padding: 0 3px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .08s; }
.mc button:hover { transform: scale(1.08); }
.mc button .ic { width: 13px; height: 13px; stroke-width: 3; }
.mc.ok button { background: var(--ok-soft); color: var(--ok); }
.mc.bad button { background: var(--bad); color: #fff; }
.mc.warn button { background: var(--warn-soft); color: var(--warn); }
.mc.fut button { background: var(--fill); color: var(--muted); }
.mc.none { color: #cfcac0; }
.m-leg { padding: 12px 20px; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; border-top: 1px solid var(--line); }
.m-leg span { display: inline-flex; align-items: center; gap: 6px; }
.m-leg .mc button { min-width: 24px; height: 20px; cursor: default; }
.m-leg .mc button:hover { transform: none; }

/* ---------- definições: aspecto do centro e pedidos de alteração ---------- */
.logo-edit { display: flex; align-items: center; gap: 16px; margin: 14px 0 18px; }
.logo-prev { width: 72px; height: 72px; flex: none; border-radius: 16px; border: 1px solid var(--line); background: var(--fill); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.logo-prev img { width: 100%; height: 100%; display: block; }
.logo-edit small { display: block; }
.logo-edit .actions { margin: 10px 0 0; }
.lbl { display: block; font-size: .82rem; color: var(--ink-2); font-weight: 600; margin-bottom: 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw-c { position: relative; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: var(--c); cursor: pointer; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .12s; }
.sw-c:hover { transform: scale(1.07); }
.sw-c.on { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--c); }
.sw-c.on::after { content: ""; position: absolute; inset: 0; background: #fff; pointer-events: none; -webkit-mask: var(--i-check) center / 18px no-repeat; mask: var(--i-check) center / 18px no-repeat; }
.sw-c.custom { background: conic-gradient(#d64541, #e6a23c, #3fa56b, #2f8fb3, #6b4a9c, #d64541); }
.sw-c.custom.on { background: var(--c); }
.sw-c.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.ped-list { margin-top: 6px; }
.ped { padding: 14px 0; }
.ped-h { display: flex; align-items: flex-start; gap: 10px; }
.ped-h b { flex: 1; min-width: 0; }
.ped small { display: block; color: var(--muted); margin-top: 1px; }
.ped p { margin: 8px 0 0; color: var(--ink-2); font-size: .93rem; }
.ped-r { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--pri-softer); border-left: 3px solid var(--pri); }
.ped-r b { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--pri-2); }
.ped-r p { margin: 3px 0 0; color: var(--ink); }
.ped .btn { margin-top: 10px; }
.pill.plan { background: var(--pri-soft); color: var(--pri-2); }
.ped-rules { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--fill); font-size: .88rem; color: var(--ink-2); }
.ped-rules b { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; }
.ped-rules ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* ---------- definições › à medida: vocabulário, ficha do aluno, presenças, notas ---------- */
.lead-in { color: var(--ink-2); margin: -4px 0 18px; max-width: 46em; }
#vf fieldset + fieldset { margin-top: 2px; }
#vf .three { grid-template-columns: 1fr 1fr 120px; }
.chips.pre { margin: 2px 0 12px; }
.chips.pre .chip { padding: 4px 11px; font-size: .82rem; }
.est-row { display: grid; grid-template-columns: 132px 1fr 64px; align-items: center; gap: 12px; }
.est-row .pill { justify-self: start; }
.est-row .toggle { border: 0; padding: 0; justify-self: end; }
.est-fix { font-size: .78rem; color: var(--faint); justify-self: end; }
.xf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; align-items: end; }
.xf label.check { align-self: center; }
.suf { display: flex; align-items: center; gap: 8px; }
.suf span { color: var(--muted); font-weight: 500; white-space: nowrap; }
#nin { display: block; }
/* campo próprio marcado «mostrar a quem regista a aula» (ex. alergias) */
.al-info { display: flex; align-items: flex-start; gap: 5px; margin-top: 2px; color: var(--warn); font-size: .8rem; font-weight: 500; line-height: 1.35; }
.al-info .ic { width: 13px; height: 13px; margin-top: 2px; flex: none; stroke-width: 2.2; }
.al-info b { font-weight: 700; }
@media (max-width: 560px) { .xf, #vf .three { grid-template-columns: 1fr 1fr; } .est-row { grid-template-columns: 96px 1fr 56px; gap: 8px; } }

/* ---------- conta Sumário: subscrição, primeiros passos ---------- */
.sub-card { border-color: var(--pri-line); }
.sub-top { display: flex; flex-wrap: wrap; gap: 14px 32px; margin: 6px 0 18px; }
.sub-top > div { display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.sub-top b { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; } .sub-top b small { font-size: .85rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.sub-top .meter { margin-top: 8px; max-width: 340px; }
.sub-e { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.sub-e li { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 11px 16px; border-top: 1px solid var(--line); }
.sub-e li:first-child { border-top: 0; }
.sub-e li span { color: var(--ink-2); }
.sub-e li b { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; white-space: nowrap; }
.sub-e li b small { font-family: var(--sans); font-size: .8rem; font-weight: 500; color: var(--muted); }
.sub-pay { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.sub-pay p { margin: 6px 0; }
.onboarding { border-color: var(--pri-line); background: linear-gradient(180deg, var(--pri-softer), #fff 120px); }
.onboarding .meter { margin: 2px 0 10px; }
.onboarding .meter i { background: var(--pri); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li a { display: flex; gap: 14px; align-items: center; padding: 11px 8px; margin: 0 -8px; border-radius: 10px; color: var(--ink); border-top: 1px solid var(--line); transition: background .12s; }
.steps li a:hover { background: var(--hover); }
.steps li:first-child a { border-top: 0; }
.steps small { display: block; color: var(--muted); }
.st-ic { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; flex: none; color: transparent; }
.st-ic .ic { width: 14px; height: 14px; stroke-width: 3; }
.steps li.done .st-ic { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.done b { color: var(--muted); font-weight: 500; }
#sub { scroll-margin-top: 24px; }

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

/* ---------- 761–1080 px: barra lateral estreita ---------- */
@media (min-width: 761px) and (max-width: 1080px) {
  :root { --side: 78px; }
  #top { padding: 16px 8px 10px; align-items: center; }
  .brand { padding: 0 0 14px; } .brand-t { display: none; }
  #nav { width: 100%; }
  #nav a { flex-direction: column; gap: 3px; padding: 8px 2px 7px; font-size: .64rem; text-align: center; }
  #nav a.on::before { left: -8px; }
  .who { padding: 6px; width: auto; border: 0; background: none; } .wn, .who-c { display: none; }
  main { padding: 28px 24px 80px; }
}

/* lista de alunos até 1080 px: a tabela não cabe (com a barra lateral sobram ~800 px para 6 colunas) e passa a cartão */
@media (max-width: 1080px) {
  .al-top { display: none; }
  .al-row { grid-template-columns: 1fr 1fr 18px; gap: 7px 10px; }
  .al-name { grid-area: 1 / 1 / 2 / 3; }
  .al-row > .chev { grid-area: 1 / 3; }
  .al-grupos { grid-area: 2 / 1 / 3 / 4; padding-left: 48px; }
  .al-ee { grid-area: 3 / 1 / 4 / 4; padding-left: 48px; flex-direction: row; flex-wrap: wrap; gap: 2px 12px; font-size: .85rem; }
  .al-assid { grid-area: 4 / 1; padding-left: 48px; flex-direction: row; align-items: center; gap: 8px; }
  .al-pay { grid-area: 4 / 2 / 5 / 4; align-items: flex-end; }
  .al-pay small { display: none; }
  .al-assid .meter { width: 50px; flex: none; }
  .al-assid small { white-space: nowrap; }
}

/* ---------- telemóvel ---------- */
@media (max-width: 760px) {
  body.has-nav { padding-left: 0; }
  #top { position: sticky; top: 0; inset: 0 0 auto 0; width: auto; flex-direction: row; align-items: center; height: 54px; padding: 0 8px 0 14px; background: var(--pri-900); }
  .brand { padding: 0; flex: 1; gap: 10px; }
  .brand img { width: 30px; height: 30px; border-radius: 8px; }
  #centro { -webkit-line-clamp: 1; font-size: .98rem; }
  .brand-t small { display: none; }
  .who { width: auto; margin: 0; padding: 6px; border: 0; background: none; } .wn, .who-c { display: none; }
  .who .av { width: 34px; height: 34px; }
  #nav { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; flex-direction: row; gap: 0; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  #nav a { flex: 1; flex-direction: column; gap: 2px; padding: 2px 0; font-size: .655rem; font-weight: 600; color: var(--muted); text-align: center; border-radius: 10px; min-width: 0; }
  #nav a:hover { background: none; color: var(--muted); }
  #nav a.on { background: none; color: var(--pri); font-weight: 700; }
  #nav a.on::before { display: none; }
  .ni { width: 46px; height: 28px; border-radius: 14px; align-items: center; justify-content: center; transition: background .15s; }
  .ni .ic { width: 21px; height: 21px; }
  #nav a.on .ni { background: var(--pri-soft); }
  main { padding: 20px 16px 110px; }
  body:not(.has-nav) main { padding: 0; }
  #toast, body.has-nav #toast { left: 50%; bottom: 84px; }
  .bulkbar { left: 50%; bottom: 80px; }
  #nav a.nv-mais { display: flex; }
  #nav a.nv-x { display: none; }
  .page-title { font-size: 1.6rem; }
  /* cabeçalho: o título nunca encolhe por baixo dos botões; a acção principal fica ao lado só se couber, as secundárias vêm depois */
  .page-head { margin-bottom: 18px; gap: 10px; }
  .page-head > .grow, .page-head > .page-title.grow { flex: 1 1 auto; }
  .page-head > .btn { height: 38px; padding: 0 13px; font-size: .9rem; }
  .page-head > .btn.ghost { order: 3; }
  .card { padding: 16px; border-radius: 14px; }
  .list.card .row { padding: 12px 16px; }
  .cols { grid-template-columns: 1fr; gap: 14px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tiles[data-n] > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .cols > .col { gap: 14px; }
  /* Início da direcção numa coluna: para tratar, avisos, aulas de hoje, faltas, testes */
  .ini-dir > .col { display: contents; }
  .ini-dir .todo { order: -2; } .ini-dir .avisos-home { order: -1; }
  .todo-sub, .todo-mais { margin-left: 0; }
  .tile { padding: 12px 12px 12px 14px; } .tile b { font-size: 1.45rem; }
  .tile-ic { width: 32px; height: 32px; border-radius: 10px; } .tile-ic .ic { width: 17px; height: 17px; }
  .two, .three { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px; height: 44px; }
  textarea { height: auto; }
  .hide-s { display: none; }
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; max-height: 92dvh; overflow: auto; animation: sheet .22s cubic-bezier(.2, .8, .3, 1); padding-bottom: env(safe-area-inset-bottom); }
  .modal::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 8px auto 0; }
  .modal-head { padding: 10px 12px 2px 18px; } .modal-body { padding: 10px 18px 20px; }
  .modal .actions:not(.share) .btn:last-child { flex: 1; }
  .ee-row input[data-par] { width: 100px; }
  /* entrada */
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-main { justify-content: flex-start; padding: 7vh 22px 28px; }
  .login-logo { display: block; }
  /* aula */
  .pres-row .av { display: none; }
  .seg .w { display: none; } .seg .l { display: inline; }
  .seg button { width: 37px; padding: 0; height: 38px; }
  .pres-row { gap: 8px; }
  .h-count small { flex-basis: 100%; }
  /* faixa que desliza: esbate-se nas pontas para se perceber que há mais */
  .chips.vistas, .m-tools .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 2px 32px 2px 16px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 28px), transparent); }
  .chips.vistas::-webkit-scrollbar, .m-tools .chips::-webkit-scrollbar { display: none; }
  .chips.vistas .chip, .m-tools .chip { flex: none; }
  .m-tools { display: block; } .m-tools .chips { margin-bottom: 10px; }
  .obs, .obs-ro { margin-left: 0; width: 100%; }
  .legend { display: block; }
  .pr-d { min-width: 84px; }
  .actions.sticky { bottom: 76px; }
  .actions.sticky .btn { width: 100%; min-width: 0; }
  /* educando: uma coluna, pela ordem do que mais interessa no dia-a-dia */
  .ed-grid { display: flex; flex-direction: column; }
  .ed-col { display: contents; }
  .ed-aulas { order: 1; } .ed-sum { order: 2; } .ed-testes { order: 3; } .ed-notas { order: 4; } .ed-assid { order: 5; } .ed-mat { order: 6; }
  .ed-b { padding: 14px 16px 16px; }
  .educando .ed-head { padding: 14px 16px; }
  .educando > .alert { margin: 12px 16px 0; }
  .educando .ed-in { padding: 10px 16px; }
  /* tabelas largas viram cartões */
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody { display: block; }
  .tbl.stack tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .tbl.stack tr:last-child { border-bottom: 0; }
  .tbl.stack td { padding: 0; border: 0; }
  .tbl.notas td:nth-child(2) { grid-area: 1 / 1; font-weight: 650; }
  .tbl.notas td:nth-child(4) { grid-area: 1 / 2; text-align: right; }
  .tbl.notas td:nth-child(3) { grid-area: 2 / 1; font-size: .88rem; }
  .tbl.notas td:nth-child(1) { grid-area: 3 / 1; font-size: .82rem; color: var(--muted); }
  .tbl.notas td:nth-child(5) { grid-area: 2 / 2 / 4 / 3; }
  .tbl.mens2 tr { grid-template-columns: 30px 1fr auto; }
  .tbl.mens2 td.ck { grid-area: 1 / 1 / 3 / 2; }
  .tbl.mens2 td:nth-child(2) { grid-area: 1 / 2; }
  .tbl.mens2 td:nth-child(4) { grid-area: 1 / 3; }
  .tbl.mens2 td:nth-child(5) { grid-area: 2 / 2 / 3 / 4; justify-self: start; }
  .tbl.mens2 td:nth-child(6) { grid-area: 2 / 2 / 3 / 4; justify-self: end; }
  .tbl.mens2 .acts { gap: 4px; }
  .tbl.hl td:nth-child(1) { grid-area: 1 / 1; } .tbl.hl td:nth-child(2) { grid-area: 2 / 1; }
  .tbl.hl td:nth-child(3), .tbl.hl td:nth-child(4), .tbl.hl td:nth-child(5) { display: none; }
  .tbl.hl td:nth-child(6) { grid-area: 1 / 2 / 3 / 3; }
  /* alunos */
  .card.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters .f-q { display: flex; gap: 8px; grid-column: 1 / -1; }
  .filters .f-q input { flex: 1; min-width: 0; }
  .filters .f-tog { display: inline-flex; flex: none; height: 44px; padding: 0 13px; }
  .filters .f-tog[aria-expanded="true"] { background: var(--pri-soft); box-shadow: inset 0 0 0 1px var(--pri-line); }
  .filters:not(.open) > select, .filters:not(.open) > #f-clear { display: none; }
  .filters input[type=search], .filters #f-clear { grid-column: 1 / -1; }
  .filters select { width: 100%; min-width: 0; font-size: 14px; height: 40px; padding-left: 10px; }
  .al-sec-t { padding: 12px 16px 8px; }
  .al-row { padding: 13px 16px; }
  /* horário: agenda por dia */
  .card.h-grid { display: none; }
  .h-agenda { display: block; }
  .h-bar { flex-direction: column; align-items: stretch; }
  .weeknav { justify-content: space-between; }
  .wk-label { flex: 1; min-width: 0; }
  .h-filters select { flex: 1 1 45%; }
  .h-days { display: flex; gap: 6px; margin-bottom: 12px; }
  .h-days button { flex: 1; position: relative; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 7px 0 6px; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: var(--ink); line-height: 1.25; }
  .h-days button b { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
  .h-days button small { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
  .h-days button.today { border-color: var(--pri); }
  .h-days button.on { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: var(--sh-2); }
  .h-days button.on b { color: rgba(255, 255, 255, .75); } .h-days button.on small { color: #fff; }
  .h-days button i { position: absolute; top: -6px; right: -3px; font-style: normal; font-size: .64rem; font-weight: 700; background: var(--accent); color: var(--ink); border-radius: 99px; min-width: 17px; height: 17px; line-height: 17px; padding: 0 4px; }
  .h-dayl { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-1); overflow: hidden; }
  .h-item { display: flex; gap: 12px; align-items: center; padding: 13px 14px; color: var(--ink); border-top: 1px solid var(--line); }
  .h-item:first-child { border-top: 0; }
  .h-item.past { opacity: .6; }
  .h-item.live { background: color-mix(in srgb, var(--c) 9%, white); }
  .h-item.conflict .s-name { color: var(--bad); }
  .h-it-time { display: flex; flex-direction: column; align-items: flex-end; min-width: 52px; padding-right: 11px; border-right: 3px solid var(--c); line-height: 1.3; }
  .h-it-time small { color: var(--muted); font-size: .8rem; }
  .h-it-time em { font-style: normal; font-size: .64rem; font-weight: 700; color: #fff; background: var(--bad); border-radius: 99px; padding: 0 6px; margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
  .h-it-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
  .h-it-body .s-name { font-size: .98rem; }
  .h-it-body .s-sub { font-size: .82rem; }
  /* mensalidades */
  .m-tools input { max-width: none; }
  .m-year .mn { min-width: 126px; padding-left: 14px; }
  .m-atr { flex-wrap: wrap; }
  .m-atr .grow { flex-basis: 100%; }
  .m-atr > b { margin-left: auto; }
  .m-sum-side { gap: 18px; }
  .big-num { font-size: 2rem; }
  .datebar > b { min-width: 0; flex: 1; }
}

/* ---------- funcionalidades de 2026-11: avisos, testes, relatório, entradas, materiais, inscrição pública ---------- */
.ok-t { color: var(--ok); }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--pri); text-align: left; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.seg-choice.neutral label:first-child input:checked + span, .seg-choice.neutral label:last-child input:checked + span { background: #fff; color: var(--pri); box-shadow: 0 1px 2px rgba(20, 35, 43, .14); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.copy-line { display: flex; gap: 8px; align-items: center; margin: 8px 0 12px; }
.copy-line code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--fill); border-radius: 8px; padding: 8px 10px; font-size: .82rem; }
.sel-small { height: 32px; padding: 0 8px; font-size: .85rem; border-radius: 8px; width: auto; }
/* avisos */
.aviso { padding: 2px 0; }
.aviso + .aviso { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 14px; }
.aviso-h { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; }
.aviso p { margin: 8px 0 10px; }
.aviso.novo .aviso-h b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 2px; }
.avisos .card { margin-bottom: 14px; }
.avisos-home { border-left: 4px solid var(--accent); }
.card-h h2 .ic, .ed-b h3 .ic { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; color: var(--pri); }
/* testes */
.testes .row, .row.teste { gap: 10px; }
.t-when { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; }
.t-when small { color: var(--muted); font-size: .75rem; }
.teste.soon .t-when b { color: var(--warn); }
.teste.past { opacity: .62; }
.alert.tst { display: block; }
/* educando: hoje no centro */
.ed-in { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: .92rem; }
.ed-in .ic { width: 18px; height: 18px; color: var(--muted); }
.ed-in.in { background: var(--ok-soft); color: var(--ok); }
.ed-in.in .ic { color: var(--ok); }
/* relatório do mês (também para imprimir) */
.rel-h { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.rel-h img { width: 42px; height: 42px; border-radius: 10px; object-fit: contain; }
.rel-h b { display: block; font-size: 1.05rem; } .rel-h small { color: var(--muted); }
.rel-n { margin: 0; font-family: var(--serif, inherit); font-size: 1.5rem; }
.rel h3 { margin: 22px 0 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.rel-c { margin: 0 0 12px; padding: 12px 16px; border-left: 3px solid var(--pri); background: var(--pri-softer, var(--fill)); border-radius: 0 10px 10px 0; }
.rel-c p { margin: 0 0 6px; } .rel-c cite { font-style: normal; font-size: .85rem; color: var(--muted); }
.rel-aulas td { vertical-align: top; }
/* entradas e saídas */
.ent .ent-r { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ent .ent-r:last-child { border-bottom: 0; }
.ent .ent-r.dentro { background: var(--ok-soft); }
.ent .ent-r.saiu { opacity: .7; }
.ent .ent-r small { display: block; color: var(--muted); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pick .btn small { opacity: .7; margin-left: 4px; }
.pick .btn.on { background: var(--pri); border-color: var(--pri); color: #fff; }
.pick .btn.nao small { color: var(--bad); opacity: 1; }
.pick .btn.nao.on small { color: #fff; }
/* materiais */
.row.mat { gap: 12px; }
.row.mat > .ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
.row.mat small { display: block; color: var(--muted); }
/* mensalidades: outras cobranças no quadro do ano */
.m-year td.outras { white-space: nowrap; }
.m-year td.outras .chip.mini { margin: 1px 2px; }
.chip.mini.ok { background: var(--ok-soft); border-color: #bfe3cf; color: var(--ok); }
.chip.mini.warn { background: var(--warn-soft); border-color: #efd8a8; color: var(--warn); }
.res-tiles .tile { cursor: default; }
/* conta: notificações e calendário */
.acct-x h3 { margin: 18px 0 6px; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.acct-x h3 .ic { width: 18px; height: 18px; color: var(--pri); }
/* inscrição online (página pública, sem menu) */
body.pub main { max-width: none; padding: 0; }
.pub-wrap { max-width: 720px; margin: 0 auto; padding: 28px 16px 48px; }
.pub-h { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pub-h img { width: 52px; height: 52px; border-radius: 14px; object-fit: contain; background: #fff; box-shadow: var(--sh-1); }
.pub-h b { display: block; font-size: 1.15rem; } .pub-h small { color: var(--muted); }
.pub-f fieldset { margin-top: 6px; }
.check.top { align-items: flex-start; } .check.top input { margin-top: 4px; }
fieldset.yn { border: 0; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
fieldset.yn legend { padding: 0; margin-bottom: 6px; font-weight: 500; color: var(--ink-2); font-size: .92rem; text-transform: none; letter-spacing: 0; line-height: 1.45; }
fieldset.yn { margin-top: 14px; }
.center { text-align: center; }
@media (max-width: 760px) {
  #nav a .nl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .copy-line { flex-wrap: wrap; } .copy-line code { flex-basis: 100%; }
  .ent .ent-r { padding: 12px 10px; }
}
@media print {
  #top, .no-print, .acct-banner, #toast, .back { display: none !important; }
  body.has-nav { padding: 0 !important; }
  main { max-width: none !important; padding: 0 !important; }
  .card.rel { border: 0; box-shadow: none; padding: 0; }
  .rel .pill { border: 1px solid #ccc; }
}
/* faturação e pagamentos */
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cf; }
.mbref { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 22px; justify-content: start; background: var(--fill); border-radius: 12px; padding: 14px 16px; margin: 6px 0 10px; }
.mbref span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mbref b { font-size: 1.15rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.pay-tot b { font-size: 1.4rem; }
.pay-mb { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.acts .btn.small .ic { width: 15px; height: 15px; }

/* ---------- definições: lista das secções (com o estado de cada uma) + a secção aberta ---------- */
.set { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 30px; align-items: start; }
.set-nav { position: sticky; top: 24px; min-width: 0; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: thin; }
.set-gr + .set-gr { margin-top: 16px; }
.set-g { display: block; margin: 0 10px 6px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.set-l { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.set-i { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; color: var(--ink); transition: background .12s; }
@media (hover: hover) { .set-i:hover { background: var(--fill); } }
@media (hover: hover) and (min-width: 960px) { .set-i.on:hover { background: var(--card); } }
.set-i .h-ic { width: 30px; height: 30px; border-radius: 9px; }
@media (min-width: 960px) {
  .set-i.on { background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--sh-1); }
  .set-i.on .h-ic { background: var(--pri); color: #fff; }
}
.set-tx { flex: 1; min-width: 0; }
.set-tx b { display: block; font-size: .92rem; font-weight: 600; line-height: 1.3; }
.set-tx small { display: block; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-chev { display: none; width: 18px; height: 18px; color: var(--faint); flex: none; }
.set-main { min-width: 0; max-width: 760px; }
.set-back { display: none; }
.set-h { display: flex; align-items: flex-start; gap: 16px; margin: 2px 0 18px; }
.set-h h2 { margin: 0; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.set-h p { margin: 6px 0 0; color: var(--muted); max-width: 44em; }
.set-main .card { margin: 0 0 16px; }
.set-main .temas { margin-bottom: 0; }
.set-main .swatches + p { margin: 14px 0 0; }
.toggle > span:last-child b { display: block; font-weight: 600; }
.toggle > span:last-child small { display: block; margin-top: 2px; font-size: .84rem; font-weight: 400; color: var(--muted); line-height: 1.4; }
.est-on { justify-self: end; font-size: .88rem; }
.cob-ok, .cob-need { list-style: none; margin: 2px 0 16px; padding: 0; display: grid; gap: 8px; }
.cob-ok li, .cob-need li { display: flex; gap: 10px; align-items: flex-start; font-size: .94rem; }
.cob-ok .ic { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--ok); stroke-width: 2.4; }
.cob-ok .ic.no { color: var(--faint); }
.cob-need li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 9px; border-radius: 50%; background: var(--pri); }
.cob .card-h .pill .ic { width: 13px; height: 13px; }
.cob details.sec { margin: 0 0 14px; }
@media (max-width: 959px) {
  .set { display: block; }
  .set-nav { position: static; max-height: none; overflow: visible; }
  .def-index .set-main, .def-sec .set-nav, .def-sec .def-top { display: none; }
  .set-back { display: inline-flex; }
  .set-gr + .set-gr { margin-top: 20px; }
  .set-g { margin: 0 4px 8px; }
  .set-l { gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-1); }
  .set-i { border-radius: 0; padding: 13px 14px; }
  .set-i + .set-i { border-top: 1px solid var(--line); }
  .set-i:active { background: var(--fill); }
  .set-chev { display: block; }
  .set-h h2 { font-size: 1.6rem; }
}

/* ficha do aluno › mensalidades: acções da direcção em cada linha (no telemóvel passam para baixo) */
.row-acts { display: flex; align-items: center; gap: 6px; flex: none; }
@media (max-width: 760px) {
  .list li.row:has(.row-acts .btn) { flex-wrap: wrap; }
  .list li.row .row-acts:has(.btn) { flex-basis: 100%; justify-content: flex-end; }
  /* ficha (aluno): o nome fica com a linha toda e «Relatório» / «Editar» passam para baixo */
  .page-head.profile > .grow { flex: 1 1 calc(100% - 90px); min-width: 0; }
}

/* ---------- cartões QR: leitor da recepção ---------- */
.lq { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 18px; align-items: start; margin-bottom: 14px; }
.lq-v { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: #0c171c; display: flex; align-items: center; justify-content: center; }
.lq-v video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lq-v video.espelho { transform: scaleX(-1); }
.lq-mira { position: absolute; width: 52%; aspect-ratio: 1; border: 3px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .28); pointer-events: none; }
.lq-start { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; background: var(--pri-900); color: #fff; }
.lq-start[hidden] { display: none; }
.lq-start > .ic { width: 52px; height: 52px; opacity: .9; }
.lq-start p { max-width: 32em; margin: 0; color: rgba(255, 255, 255, .86); }
.lq-err { color: #ffd2c8 !important; font-size: .9rem; }
.lq-err:empty { display: none; }
.lq-msg { position: absolute; z-index: 3; left: 14px; right: 14px; bottom: 14px; padding: 14px 18px; border-radius: 14px; color: #fff; background: var(--ok); box-shadow: var(--sh-3); }
.lq-msg[hidden] { display: none; }
.lq-msg b { display: block; font-size: 1.4rem; line-height: 1.2; }
.lq-msg span { display: block; margin-top: 2px; font-size: 1rem; opacity: .95; }
.lq-msg.out { background: var(--pri); } .lq-msg.warn { background: var(--warn); } .lq-msg.bad { background: var(--bad); }
.lq-log .list { max-height: 62vh; overflow: auto; }
.lq-c { min-width: 0; }
.lq-usb { display: flex; align-items: center; gap: 7px; margin: 10px 2px 0; font-size: .86rem; font-weight: 600; color: var(--ok); }
.lq-usb .ic { width: 16px; height: 16px; flex: none; }
.lq-usb.off { color: var(--warn); }
.lq-h { width: 3.1em; flex: none; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.lq-r.in small { color: var(--ok); } .lq-r.out small { color: var(--pri); }
@media (max-width: 860px) { .lq { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .lq-v { aspect-ratio: 3 / 4; } .lq-mira { width: 70%; } }

/* ---------- cartões para imprimir (85,6 × 54 mm, como um cartão bancário) ---------- */
.cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.cartao { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: #111; }
.ct-qr { width: 118px; flex: none; }
.ct-qr svg { display: block; width: 100%; height: auto; }
.ct-t { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-right: 4px; }
.ct-c { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: #555; }
.ct-c img { width: 18px; height: 18px; border-radius: 4px; object-fit: contain; }
.ct-n { font-size: 1.12rem; line-height: 1.2; }
.ct-a { color: #555; font-size: .84rem; }
.ct-i { margin-top: 4px; font-size: .72rem; color: #666; }
.ct-r { position: absolute; top: 8px; right: 8px; }
/* o cartão no telemóvel (#cartao) */
.cartoes-tel { display: grid; gap: 16px; justify-items: center; }
.cartao-tel { width: min(100%, 360px); box-sizing: border-box; padding: 16px 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: #111; text-align: center; box-shadow: var(--sh-2); }
.cartao-tel .ct-c { justify-content: center; margin-bottom: 6px; font-size: .84rem; }
.cartao-tel .ct-qr { width: 100%; max-width: 300px; margin: 0 auto 8px; }
.cartao-tel b { display: block; font-size: 1.2rem; }
.cartao-nota { text-align: center; max-width: 30em; margin: 16px auto 0; }
@media print {
  .cartoes { grid-template-columns: repeat(2, 85.6mm); gap: 0 4mm; justify-content: center; }   /* filas juntas: 10 por A4 com qualquer margem normal */
  .cartao { width: 85.6mm; height: 54mm; box-sizing: border-box; padding: 3mm 4mm 3mm 2mm; gap: 3mm; border: .25mm dashed #999; border-radius: 3mm; break-inside: avoid; }
  .ct-qr { width: 36mm; }
  .ct-n { font-size: 12pt; } .ct-c { font-size: 7.5pt; } .ct-a { font-size: 9pt; } .ct-i { font-size: 7pt; }
}


/* ---------- Estudo (o Sumário no centro): o código e o QR com que o aluno liga a conta ---------- */
.est-cod { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 12px 0; }
.est-cod small { display: block; margin-top: 2px; }
.est-qr { width: 132px; height: 132px; flex: none; }
.est-qr svg { width: 100%; height: 100%; display: block; border-radius: 10px; }
.est-pe button { margin-left: 6px; background: none; border: 0; padding: 0; font: inherit; color: var(--pri); text-decoration: underline; cursor: pointer; }
