/* Maré — identidade: mar do RN (verde-petróleo), areia, sol e coral. */
:root {
  --brand: #0d4a4f;
  --brand-2: #13696f;
  --brand-soft: #dceeed;
  --sun: #ffc857;
  --sun-soft: #fff3d6;
  --coral: #b9432a;
  --coral-soft: #fbe3dc;
  --ok: #1d7a46;
  --ok-soft: #dcf2e4;
  --bg: #f8f4ec;
  --surface: #ffffff;
  --surface-2: #f2ede3;
  --line: #e2dacb;
  --text: #1d2a2c;
  --muted: #5a6668;
  --focus: #1f6feb;
  --mat: #2563a8;
  --por: #8a3fa0;
  --red: #b9432a;
  --rev: #1d7a46;
  --out: #6b6b6b;
  --shadow: 0 1px 2px rgba(13, 74, 79, .06), 0 4px 16px rgba(13, 74, 79, .06);
  --radius: 16px;
  --radius-s: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #5cc2c0; --brand-2: #7fd3d1; --brand-soft: #173a3d;
    --sun: #ffd27a; --sun-soft: #3b3220; --coral: #ff9a80; --coral-soft: #44261f;
    --ok: #6fd39a; --ok-soft: #1c3a2a;
    --bg: #0f1719; --surface: #172224; --surface-2: #1e2c2f; --line: #2c3d40;
    --text: #e8eeee; --muted: #a5b3b4; --focus: #7ab7ff;
    --mat: #7fb2ef; --por: #d39be3; --red: #ff9a80; --rev: #6fd39a; --out: #b4b4b4;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #5cc2c0; --brand-2: #7fd3d1; --brand-soft: #173a3d;
  --sun: #ffd27a; --sun-soft: #3b3220; --coral: #ff9a80; --coral-soft: #44261f;
  --ok: #6fd39a; --ok-soft: #1c3a2a;
  --bg: #0f1719; --surface: #172224; --surface-2: #1e2c2f; --line: #2c3d40;
  --text: #e8eeee; --muted: #a5b3b4; --focus: #7ab7ff;
  --mat: #7fb2ef; --por: #d39be3; --red: #ff9a80; --rev: #6fd39a; --out: #b4b4b4;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--brand-2); }
:root:not([data-theme="dark"]) a { color: var(--brand); }
small, .muted { color: var(--muted); }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Estrutura ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.content { flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
main { padding: 16px 16px 110px; max-width: 1080px; margin: 0 auto; outline: none; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text) !important; }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 1.25rem; letter-spacing: -.02em; }
.brand small { font-size: .78rem; }
.brand-mini svg { width: 30px; height: 30px; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
}
.tabbar a, .tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
  min-height: 52px; font: inherit; font-size: .72rem; color: var(--muted); text-decoration: none;
  background: none; border: 0; border-radius: 12px; cursor: pointer;
}
.tabbar svg, .navlink svg { width: 24px; height: 24px; }
.tabbar [aria-current="page"] { color: var(--brand); font-weight: 700; background: var(--brand-soft); }

@media (min-width: 960px) {
  .tabbar, .topbar .brand-mini { display: none; }
  .topbar { justify-content: flex-end; min-height: 56px; }
  .sidebar {
    display: flex; flex-direction: column; gap: 18px; width: 248px; flex: none; padding: 20px 14px;
    position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line);
    overflow-y: auto;
  }
  main { padding: 24px 32px 48px; }
}
.navlink {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--text) !important; text-decoration: none; font-weight: 500;
}
.navlink:hover { background: var(--surface-2); }
.navlink[aria-current="page"] { background: var(--brand-soft); color: var(--brand) !important; font-weight: 700; }
.navlink .badge { margin-left: auto; }
.nav-sep { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 12px 4px; }

/* ---------- Componentes ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head p { margin: 0; color: var(--muted); }
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); min-width: 0;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); color: #fff; border: 0;
  position: relative; overflow: hidden;
}
:root[data-theme="dark"] .hero { color: #08282a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { color: #08282a; } }
.hero .muted, .hero small { color: inherit; opacity: .85; }
.hero::after {
  content: ""; position: absolute; right: -40px; bottom: -40px; width: 200px; height: 120px;
  background: radial-gradient(circle at 30% 30%, var(--sun) 0 30%, transparent 31%); opacity: .45; pointer-events: none;
}
.stack > * + * { margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { justify-content: space-between; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 2px 10px;
  border-radius: 999px; background: var(--surface-2); color: var(--text); white-space: nowrap;
}
.tag-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tag-warn { background: var(--sun-soft); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-coral { background: var(--coral-soft); color: var(--coral); }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--coral); color: #fff; font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; }
:root[data-theme="dark"] .badge { color: #2a0f08; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  font: inherit; font-weight: 600; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); }
.btn svg, .pill svg { width: 20px; height: 20px; flex: none; }
.btn-s svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
:root[data-theme="dark"] .btn-primary { color: #08282a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #08282a; } }
.btn-sun { background: var(--sun); border-color: var(--sun); color: #3a2a00; }
.btn-sun:hover { filter: brightness(.96); background: var(--sun); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--coral); border-color: var(--coral-soft); }
.btn-s { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-icon { min-width: 40px; min-height: 40px; padding: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.hero .btn:not(.btn-sun) { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.35); color: inherit; }

/* ---------- Formulários ---------- */
label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; min-width: 0; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.error { font-size: .88rem; color: var(--coral); margin-top: 4px; font-weight: 600; }
input[type=text], input[type=number], input[type=date], input[type=search], input[type=email], input[type=password], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-s);
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--coral); }
textarea { resize: vertical; line-height: 1.6; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; margin: 0 0 14px; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.week-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.week-inputs label { font-weight: 500; font-size: .85rem; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; padding: 6px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 10px; cursor: pointer; color: var(--muted); min-height: 38px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Blocos de estudo ---------- */
.blocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.block {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c, var(--brand));
  border-radius: 12px; min-width: 0;
}
.block.done { opacity: .72; }
.block.done .block-title { text-decoration: line-through; text-decoration-thickness: 1px; }
.block.skipped { opacity: .55; border-left-style: dashed; }
.block-title { font-weight: 600; overflow-wrap: anywhere; }
.block-meta { font-size: .83rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.block-actions { display: flex; gap: 2px; }
.tick {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--c, var(--brand)); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: #fff; padding: 0;
}
.tick[aria-pressed="true"] { background: var(--c, var(--brand)); }
.tick svg { width: 16px; height: 16px; }

.week-grid { display: grid; gap: 10px; }
@media (min-width: 900px) { .week-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } .week-grid .block { grid-template-columns: 1fr; } .week-grid .block .tick { display: none; } }
.day-col { background: var(--surface-2); border-radius: 14px; padding: 10px; min-width: 0; }
.day-col.today { outline: 2px solid var(--brand); }
.day-col h3 { font-size: .92rem; display: flex; justify-content: space-between; gap: 6px; }

.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month .dow { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 700; padding: 4px 0; }
.mday {
  aspect-ratio: 1 / 1; min-height: 44px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; padding: 2px; font-size: .9rem;
}
.mday.out { opacity: .35; }
.mday.today { border: 2px solid var(--brand); font-weight: 800; }
.mday.target { background: var(--sun-soft); border-color: var(--sun); }
.mday .dots { display: flex; gap: 2px; height: 6px; }
.mday .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.mday .dots i.done { background: var(--ok); }
.mday .dots i.late { background: var(--coral); }

/* ---------- Constância (sem punição) ---------- */
.tide { display: flex; gap: 6px; flex-wrap: wrap; }
.tide span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .72rem; color: inherit; }
.tide i { width: 30px; height: 30px; border-radius: 50%; border: 2px solid currentColor; opacity: .55; display: grid; place-items: center; font-style: normal; }
.tide i.on { background: var(--sun); border-color: var(--sun); opacity: 1; color: #3a2a00; }

/* ---------- Progresso ---------- */
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--c, var(--brand)); border-radius: inherit; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 1.6rem; line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.chart div { flex: 1; min-width: 0; background: var(--brand); border-radius: 4px 4px 0 0; position: relative; }
.chart div.zero { background: var(--line); height: 2px !important; }
.chart-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 700; }
.table-wrap { overflow-x: auto; }

/* ---------- Foco ---------- */
.timer { display: grid; place-items: center; gap: 16px; text-align: center; }
.ring { position: relative; width: min(260px, 70vw); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring .track { stroke: var(--surface-2); }
.ring .prog { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.ring .time { position: absolute; inset: 0; display: grid; place-content: center; }
.ring .time b { font-size: clamp(2.4rem, 12vw, 3.4rem); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--sun);
  color: #3a2a00; font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; font-size: .92rem;
}
.pill.paused { background: var(--surface-2); color: var(--text); }

/* ---------- Questões ---------- */
.q-text { font-size: 1.08rem; font-weight: 500; }
.options { display: grid; gap: 8px; margin: 12px 0; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 2px solid var(--line); border-radius: 12px;
  cursor: pointer; background: var(--surface); font-weight: 500;
}
.opt input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.opt .letter { font-weight: 800; color: var(--muted); }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--coral); background: var(--coral-soft); }
.feedback { border-radius: 12px; padding: 12px 14px; margin-top: 8px; }
.feedback.ok { background: var(--ok-soft); }
.feedback.no { background: var(--coral-soft); }
.notice { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; font-size: .88rem; color: var(--muted); background: var(--surface-2); }

/* ---------- Redação ---------- */
.essay-layout { display: grid; gap: 16px; }
@media (min-width: 900px) { .essay-layout { grid-template-columns: 260px minmax(0, 1fr); } }
.essay-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.essay-list button {
  width: 100%; text-align: left; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.essay-list button[aria-current="true"] { border-color: var(--brand); background: var(--brand-soft); }
.editor { min-height: 360px; font-size: 1.02rem; }
.save-state { font-size: .85rem; color: var(--muted); }
.save-state.fail { color: var(--coral); font-weight: 700; }
.version { border-top: 1px solid var(--line); padding: 10px 0; }

/* ---------- Avisos, modal, toast ---------- */
.banner { padding: 10px 16px; font-size: .92rem; font-weight: 600; text-align: center; }
.banner-demo { background: var(--sun); color: #3a2a00; }
.banner-error { background: var(--coral); color: #fff; }
.banner .btn { min-height: 32px; padding: 4px 10px; margin-left: 8px; }
dialog {
  border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(10, 30, 32, .5); }
.modal-box { padding: 20px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 50; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
@media (min-width: 960px) { .toasts { bottom: 24px; } }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.toast button { background: none; border: 0; color: var(--sun); font: inherit; font-weight: 700; cursor: pointer; }
.empty { text-align: center; padding: 24px 12px; color: var(--muted); }
.empty svg { width: 64px; height: 64px; opacity: .6; }
.status-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.status-list li { display: flex; gap: 10px; align-items: flex-start; }
.noscript { padding: 24px; text-align: center; }
.sheet-links { display: grid; gap: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Contas, entrada e sincronização ---------- */
.auth-mode .sidebar, .auth-mode .tabbar, .auth-mode .topbar { display: none; }
.auth-mode main { padding-bottom: 32px; }
.auth-wrap { min-height: calc(100vh - 48px); display: grid; place-items: center; padding: 16px 0; }
.auth-card { width: min(440px, 100%); padding: 24px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.auth-brand svg { width: 56px; height: 56px; flex: none; }
.auth-brand h1 { margin: 0; font-size: 1.8rem; }
.auth-brand p { margin: 0; }
.auth-tabs { display: flex; width: 100%; margin-bottom: 16px; }
.auth-tabs button { flex: 1; }
.auth-foot { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; text-align: center; }
.auth-foot .hint { margin-top: 6px; }
.btn-block { width: 100%; margin-top: 8px; }
.pw-wrap { display: flex; gap: 6px; align-items: center; }
.pw-wrap input { flex: 1; min-width: 0; }
.pw-wrap .btn { flex: none; }
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.sync-pill svg { width: 16px; height: 16px; }
.sync-pill.ok { color: var(--ok); border-color: var(--ok-soft); }
.sync-pill.warn { color: var(--coral); border-color: var(--coral); background: var(--coral-soft); }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
#sync-side { margin-top: auto; }
.space-tag { display: block; font-size: .8rem; color: var(--muted); padding: 0 12px 8px; }
.banner-env { background: var(--brand-soft); color: var(--text); font-weight: 500; }
.reset-code { font: 700 1.8rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; text-align: center; padding: 14px; background: var(--sun-soft); border-radius: 12px; user-select: all; }
pre.code { background: var(--surface-2); padding: 10px 12px; border-radius: 10px; overflow-x: auto; font-size: .9rem; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 420px) { .sync-pill span:not(.sr-only) { max-width: 120px; overflow: hidden; text-overflow: ellipsis; } }

/* ---------- Espaços e cursinhos ---------- */
.space-chip {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0;
}
.space-chip span:last-child { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.space-chip small { font-weight: 500; color: var(--muted); font-size: .72rem; }
#space-top .space-chip { width: auto; max-width: 46vw; padding: 4px 8px; }
@media (min-width: 960px) { #space-top { display: none; } }
.space-badge { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; color: #fff; font-weight: 800; flex: none; font-size: .95rem; }
.space-badge.personal { background: var(--brand-soft); color: var(--brand); }
.space-badge svg { width: 18px; height: 18px; }
.space-option { justify-content: flex-start; text-align: left; gap: 12px; }
.space-option[aria-current="true"] { border-color: var(--brand); background: var(--brand-soft); }
.inst-head { display: flex; align-items: center; gap: 14px; }
.inst-head .space-badge { width: 52px; height: 52px; border-radius: 14px; font-size: 1.5rem; }
.inst-head h1 { margin: 0; overflow-wrap: anywhere; }
.gtabs { display: flex; flex-wrap: wrap; }
.gtabs .badge { margin-left: 4px; }
.code-big { font: 700 1.4rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; padding: 6px 12px; background: var(--sun-soft); border-radius: 10px; user-select: all; }
.roster { margin: 6px 0 0; padding-left: 20px; }
.roster li { margin: 2px 0; }
.turma-card.archived { opacity: .7; }
.brand-preview { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
input[type=color] { width: 64px; height: 44px; padding: 2px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people-who { min-width: 0; flex: 1 1 200px; overflow-wrap: anywhere; }
.people-actions { display: flex; gap: 8px; align-items: center; flex: 1 1 220px; justify-content: flex-end; }
.people-actions select { max-width: 220px; }
@media (max-width: 480px) {
  #sync-top .sync-pill > span:not(.sr-only) { display: none; }
  #sync-top .sync-pill { padding: 6px 8px; }
  .people-actions { justify-content: flex-start; }
}

/* ---------- Atividades (Parte 3) ---------- */
.ativ-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ativ-item { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text) !important; text-decoration: none; background: var(--surface); }
.ativ-item:hover { border-color: var(--brand); }
.ativ-item small { color: var(--muted); }
.ativ-title { overflow-wrap: anywhere; }
.ativ-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.essay-text { font-size: 1.02rem; line-height: 1.7; }
.crit-list { margin: 6px 0; padding-left: 20px; }
.crit-list li { margin: 4px 0; }
.crit-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.q-item { border: 0; padding: 0; margin: 0; min-width: 0; }
.q-item legend { padding: 0; }
.card hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.sim-bar { position: sticky; top: 64px; z-index: 10; }
@media (min-width: 960px) { .sim-bar { top: 64px; } }
.countdown { font-variant-numeric: tabular-nums; font-size: 1.3rem; }
.countdown.low { color: var(--coral); }
.q-detail { border-top: 1px solid var(--line); padding: 10px 0; }
.q-detail summary { cursor: pointer; }
.picked { margin: 0; padding-left: 22px; }
.picked li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 4px 0; }
.pick-list, .qb-list { list-style: none; margin: 10px 0 0; padding: 0; }
.pick-list li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qb-list li { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.alt-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 6px; }
.alt-row input[type=radio] { width: 20px; height: 20px; accent-color: var(--brand); }
.corr-layout { display: grid; gap: 0 16px; }
@media (min-width: 1100px) { .corr-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }
.ext-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; width: 100%; }
.ext-sub { display: flex; gap: 8px; padding: 6px 8px; margin: 0; }
.ext-sub legend { font-size: .85rem; }
.ext-sub label { font-size: .8rem; font-weight: 500; margin: 0; }
.ext-sub input { width: 76px; min-height: 38px; padding: 6px 8px; }
.opt.right, .opt.right:has(input:checked) { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong, .opt.wrong:has(input:checked) { border-color: var(--coral); background: var(--coral-soft); }

/* QR da ativação das duas etapas: fundo branco sempre, para a câmera ler também no tema escuro */
.mfa-qr { margin: .5rem 0 1rem; }
.mfa-qr img { display: block; width: 220px; max-width: 100%; height: auto; background: #fff; padding: 6px; border-radius: 12px; }
.mfa-manual { margin: 0 0 1rem; }
.mfa-manual summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }
