/* Estudiary — sistema visual
   Ideia: uma sala de estudos ao entardecer. A luz âmbar das luminárias é reservada para foco e progresso.
   Cores-base: papel-sálvia, tinta ardósia, musgo (ações), âmbar (foco), crepúsculo (escuro). */

:root {
  --paper: #E9ECE6;
  --surface: #F7F8F4;
  --surface-2: #EFF1EB;
  --ink: #1F2A36;
  --ink-2: #4A5664;
  --ink-3: #6E7884;
  --line: #D3D8CF;
  --line-2: #C3C9BE;
  --moss: #2E5E4E;
  --moss-ink: #F4F7F2;
  --moss-soft: #DCE7DF;
  --lamp: #F2B544;
  --lamp-ink: #3A2A08;
  --lamp-soft: #FBEBC4;
  --danger: #A63E2F;
  --danger-soft: #F5DCD6;
  --ok: #2F7A55;
  --focus: #2F6FB0;
  --shadow: 0 1px 2px rgba(31, 42, 54, .06), 0 6px 18px rgba(31, 42, 54, .06);
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 22px;
  --f-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --f-body: 'Atkinson Hyperlegible', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-0: .8125rem; --fs-1: .9375rem; --fs-2: 1.0625rem; --fs-3: 1.3rem; --fs-4: 1.65rem; --fs-5: 2.2rem; --fs-timer: clamp(3rem, 7vw, 4.6rem);
  --sidebar: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17202B; --surface: #1E2935; --surface-2: #243140; --ink: #E8ECEF; --ink-2: #B7C0C9; --ink-3: #8E99A4;
    --line: #2E3B4A; --line-2: #3A4859; --moss: #7FBFA4; --moss-ink: #0F1D17; --moss-soft: #22392F;
    --lamp-soft: #3A3018; --danger: #E58B7B; --danger-soft: #3A2320; --ok: #7FD1A4; --focus: #8FC1F2;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17202B; --surface: #1E2935; --surface-2: #243140; --ink: #E8ECEF; --ink-2: #B7C0C9; --ink-3: #8E99A4;
  --line: #2E3B4A; --line-2: #3A4859; --moss: #7FBFA4; --moss-ink: #0F1D17; --moss-soft: #22392F;
  --lamp-soft: #3A3018; --danger: #E58B7B; --danger-soft: #3A2320; --ok: #7FD1A4; --focus: #8FC1F2;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}
:root.large-text { font-size: 112.5%; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--fs-1)/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 650; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: var(--fs-5); letter-spacing: -.025em; }
h2 { font-size: var(--fs-4); letter-spacing: -.02em; }
h3 { font-size: var(--fs-3); }
h4 { font-size: var(--fs-2); }
p { margin: 0; }
a { color: var(--moss); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-0); }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: var(--r-sm); z-index: 99; }
.skip:focus { top: 8px; }

/* ───────── Estrutura ───────── */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 16px 16px;
  border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 0 6px; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-family: var(--f-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -.03em; }
.me-card { display: grid; gap: 8px; padding: 10px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; }
.me-card .desk-svg { border-radius: var(--r-md); aspect-ratio: 3 / 2; width: 100%; height: auto; }
.me-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 2px; }
.me-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-md);
  color: var(--ink-2); text-decoration: none; font-weight: 700;
}
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--moss); }
.sidebar-foot { margin-top: auto; display: grid; gap: 2px; }
.main { min-width: 0; padding: 28px clamp(16px, 4vw, 44px) 120px; }
.page { max-width: 1180px; margin: 0 auto; display: grid; gap: 28px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { color: var(--ink-2); margin-top: 6px; max-width: 62ch; }

.mobile-bar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 18px 16px 120px; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .mobile-bar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-bar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; font-size: .72rem; font-weight: 700; color: var(--ink-3); text-decoration: none; border-radius: var(--r-md); }
  .mobile-bar a svg { width: 22px; height: 22px; }
  .mobile-bar a[aria-current="page"] { color: var(--moss); background: var(--moss-soft); }
  h1 { font-size: 1.8rem; }
}
@media (min-width: 901px) { .mobile-top { display: none; } }

/* ───────── Componentes ───────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h3, .panel-head h2 { font-size: var(--fs-2); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1000px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--moss); border-color: var(--moss); color: var(--moss-ink); }
.btn-primary:hover { background: color-mix(in oklab, var(--moss) 88%, black); }
.btn-lamp { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink); }
.btn-lamp:hover { background: color-mix(in oklab, var(--lamp) 90%, black); }
.btn-danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 40%, var(--line)); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: var(--fs-2); border-radius: var(--r-lg); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: var(--fs-0); }
.btn-icon { width: 40px; padding: 0; }

.field { display: grid; gap: 6px; }
.field > span, .field > label { font-weight: 700; font-size: var(--fs-0); color: var(--ink-2); }
.field .hint { font-size: var(--fs-0); color: var(--ink-3); }
.field .err { font-size: var(--fs-0); color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink);
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus { outline: 3px solid color-mix(in oklab, var(--focus) 40%, transparent); outline-offset: 0; border-color: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--moss); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.seg { display: inline-flex; padding: 3px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 700; color: var(--ink-2); cursor: pointer; min-height: 32px; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-0); font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip-focus { background: var(--lamp-soft); color: color-mix(in oklab, var(--lamp-ink) 60%, var(--ink)); border-color: transparent; }
:root[data-theme="dark"] .chip-focus { color: var(--lamp); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip-focus { color: var(--lamp); } }
.chip-ok { background: var(--moss-soft); color: var(--moss); border-color: transparent; }
.chip-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rar-rare { color: #3D6DA8; } .rar-epic { color: #7C5C8E; } .rar-legendary { color: #A9761B; }

.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--moss); border-radius: inherit; transition: width .4s ease; }
.bar.lamp > i { background: var(--lamp); }

.empty { padding: 28px 16px; text-align: center; color: var(--ink-3); display: grid; gap: 10px; justify-items: center; }
.empty strong { color: var(--ink-2); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: var(--r-md); min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-page { display: grid; gap: 16px; }
.error-box { padding: 14px 16px; border-radius: var(--r-md); background: var(--danger-soft); color: var(--danger); font-weight: 700; }

.list { display: grid; }
.list > * { padding: 12px 0; border-top: 1px solid var(--line); }
.list > *:first-child { border-top: 0; padding-top: 0; }

/* Toasts */
.toasts { position: fixed; z-index: 80; right: 18px; bottom: 18px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
@media (max-width: 900px) { .toasts { bottom: 86px; right: 12px; } }
.toast { background: var(--ink); color: var(--paper); padding: 12px 14px; border-radius: var(--r-md); box-shadow: var(--shadow); font-weight: 700; display: flex; gap: 10px; align-items: start; animation: toast-in .2s ease; }
.toast.err { background: var(--danger); color: #fff; }
.toast.reward { background: var(--lamp); color: var(--lamp-ink); }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

/* Modal */
dialog.modal { overflow-y: auto; border: 0; padding: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: calc(100vh - 32px); }
dialog.modal::backdrop { background: rgba(15, 22, 30, .45); }
.modal-body { padding: 24px; display: grid; gap: 18px; }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ───────── Mesinha ───────── */
.desk-svg { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; }
.desk-frame { border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.desk-rain line { animation: rain 1.1s linear infinite; }
@keyframes rain { from { transform: translateY(-8px); } to { transform: translateY(10px); } }
.desk-steam path { animation: steam 3s ease-in-out infinite; }
.desk-steam path:nth-child(2) { animation-delay: 1.2s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: .7; } 100% { opacity: 0; transform: translateY(-8px); } }
.desk-glow, .desk-halo { animation: glow 6s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .82; } }
.desk-fish { animation: fish 7s ease-in-out infinite; }
@keyframes fish { 50% { transform: translateX(-14px); } }
@media (prefers-reduced-motion: reduce) { .desk-svg * { animation: none !important; } }
.reduce-motion .desk-svg *, .reduce-motion * { animation: none !important; transition: none !important; }

/* ───────── Início ───────── */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .9fr); gap: 24px; align-items: stretch; }
@media (max-width: 960px) { .home-hero { grid-template-columns: 1fr; } }
.hero-desk { position: relative; }
.hero-desk .desk-frame { height: 100%; }
.hero-desk .desk-svg { height: 100%; }
.hero-side { display: grid; gap: 16px; align-content: start; }
.greet h1 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.greet p { color: var(--ink-2); margin-top: 8px; }
.today-goal { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.ring { width: 92px; height: 92px; }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--surface-2); }
.ring .val { stroke: var(--lamp); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s ease; }
.ring text { font-family: var(--f-display); font-weight: 700; fill: var(--ink); font-size: 20px; }
.stat-line { display: flex; gap: 22px; flex-wrap: wrap; }
.stat { display: grid; gap: 2px; }
.stat b { font-family: var(--f-display); font-size: var(--fs-4); line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-3); font-size: var(--fs-0); font-weight: 700; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week-day { display: grid; gap: 6px; justify-items: center; font-size: var(--fs-0); color: var(--ink-3); font-weight: 700; }
.week-day .col { width: 100%; height: 84px; border-radius: var(--r-md); background: var(--surface-2); display: flex; align-items: flex-end; overflow: hidden; border: 1px solid var(--line); }
.week-day .col i { display: block; width: 100%; background: var(--moss); border-radius: 6px 6px 0 0; min-height: 0; }
.week-day.goal .col i { background: var(--lamp); }
.week-day.today { color: var(--ink); }
.week-day.today .col { border-color: var(--ink-3); }
.mission { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.mission .bar { grid-column: 1 / -1; }
.mission.done .m-name { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }

/* ───────── Salas ───────── */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.room-card { display: grid; gap: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; transition: border-color .15s; }
.room-card:hover { border-color: var(--ink-3); }
.room-card.is-mine { border-color: var(--lamp); box-shadow: inset 0 0 0 1px var(--lamp); }
.room-lamps { display: flex; gap: 4px; flex-wrap: wrap; min-height: 14px; }
.room-lamps i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); }
.room-lamps i.on { background: var(--lamp); border-color: var(--lamp); box-shadow: 0 0 8px color-mix(in oklab, var(--lamp) 70%, transparent); }

.room-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .room-layout { grid-template-columns: 1fr; } }
.timer-panel { position: sticky; top: 20px; display: grid; gap: 16px; }
@media (max-width: 1100px) { .timer-panel { position: static; } }
.timer-face { text-align: center; display: grid; gap: 6px; padding: 8px 0; }
.timer-digits { font-family: var(--f-display); font-size: var(--fs-timer); font-weight: 650; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.timer-state { font-weight: 700; color: var(--ink-3); }
.timer-state.running { color: color-mix(in oklab, var(--lamp) 55%, var(--ink)); }
.timer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.timer-actions .btn { min-height: 48px; }
.pomo-dots { display: flex; justify-content: center; gap: 6px; }
.pomo-dots i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-2); }
.pomo-dots i.done { background: var(--lamp); border-color: var(--lamp); }

.hall {
  border-radius: var(--r-xl); padding: 18px; background: color-mix(in oklab, var(--surface-2) 70%, var(--paper));
  border: 1px solid var(--line); display: grid; gap: 14px;
}
.hall-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.hall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.seat { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; min-width: 0; }
.seat .desk-frame { border-radius: var(--r-md); }
.seat.me .desk-frame { outline: 2px solid var(--lamp); outline-offset: 2px; }
.seat.ended { opacity: .6; }
.seat-meta { display: grid; gap: 2px; padding: 0 2px; }
.seat-name { display: flex; justify-content: space-between; gap: 6px; font-weight: 700; font-size: var(--fs-1); }
.seat-name span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-sub { font-size: var(--fs-0); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-time { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 700; }
.conn { font-size: var(--fs-0); color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; }
.conn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.conn.off::before { background: var(--danger); }

/* Dock da sessão em outras páginas */
.dock {
  position: fixed; z-index: 40; left: calc(var(--sidebar) + 50%); transform: translateX(calc(-50% - var(--sidebar) / 2)); bottom: 18px;
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px; border-radius: 999px;
  background: var(--ink); color: var(--paper); box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.dock .lampdot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); }
.dock .lampdot.on { background: var(--lamp); box-shadow: 0 0 10px var(--lamp); }
.dock b { font-family: var(--f-display); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.dock .btn { background: transparent; color: var(--paper); border-color: rgba(255,255,255,.25); min-height: 34px; border-radius: 999px; }
.dock .btn:hover { background: rgba(255,255,255,.1); }
@media (max-width: 900px) { .dock { left: 50%; transform: translateX(-50%); bottom: 78px; } }

/* ───────── Mesinha (página) ───────── */
.desk-page { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .desk-page { grid-template-columns: 1fr; } }
.desk-stage { position: sticky; top: 20px; display: grid; gap: 12px; }
@media (max-width: 1000px) { .desk-stage { position: static; } }
.slot-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.slot-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.item {
  display: grid; gap: 8px; padding: 8px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  text-align: left; cursor: pointer; color: inherit; position: relative;
}
.item:hover { border-color: var(--ink-3); }
.item[aria-pressed="true"] { border-color: var(--moss); box-shadow: inset 0 0 0 1px var(--moss); }
.item .thumb { border-radius: var(--r-md); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); }
.item .thumb svg { width: 100%; height: 100%; display: block; }
.item.locked .thumb { filter: grayscale(.85) brightness(.9); opacity: .65; }
.item-name { font-weight: 700; font-size: var(--fs-0); line-height: 1.3; }
.item-req { font-size: .75rem; color: var(--ink-3); line-height: 1.35; }
.item .badge { position: absolute; top: 12px; right: 12px; }

/* ───────── Progresso ───────── */
.chart { width: 100%; height: auto; display: block; }
.chart .gridline { stroke: var(--line); }
.chart .lbl { fill: var(--ink-3); font-size: 11px; font-family: var(--f-body); }
.chart .bar-v { fill: var(--moss); }
.chart .bar-v.goal { fill: var(--lamp); }
.chart .goal-line { stroke: var(--ink-3); stroke-dasharray: 4 4; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.heat i[data-l="1"] { background: color-mix(in oklab, var(--moss) 30%, var(--surface)); border-color: transparent; }
.heat i[data-l="2"] { background: color-mix(in oklab, var(--moss) 55%, var(--surface)); border-color: transparent; }
.heat i[data-l="3"] { background: var(--moss); border-color: transparent; }
.heat i[data-l="4"] { background: var(--lamp); border-color: transparent; }
.heat i.future { opacity: .3; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-0); color: var(--ink-3); align-items: center; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ach { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.ach-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.ach.unlocked .ach-icon { background: var(--lamp-soft); color: color-mix(in oklab, var(--lamp) 60%, var(--ink)); border-color: transparent; }
.ach-icon svg { width: 22px; height: 22px; }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-1); }
.table th { text-align: left; font-size: var(--fs-0); color: var(--ink-3); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.me td { background: var(--lamp-soft); }
.table-wrap { overflow-x: auto; }
.rank { font-family: var(--f-display); font-weight: 700; width: 3ch; }

/* ───────── Desafios ───────── */
.challenge { display: grid; gap: 12px; }
.challenge-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.challenge .reward { display: flex; gap: 8px; flex-wrap: wrap; }

/* ───────── Organização ───────── */
.plan-week { display: grid; grid-template-columns: repeat(7, minmax(128px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.plan-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 180px; }
.plan-day.today { border-color: var(--moss); }
.plan-day h4 { font-size: var(--fs-1); display: flex; justify-content: space-between; }
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.task.done .task-title { text-decoration: line-through; color: var(--ink-3); }
.task-title { font-weight: 700; }
.task-mini { padding: 7px 8px; border-radius: var(--r-md); background: var(--surface-2); border-left: 3px solid var(--sc, var(--ink-3)); font-size: var(--fs-0); display: grid; gap: 4px; }
.task-mini.done { opacity: .55; text-decoration: line-through; }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; background: var(--sc); flex: none; }

/* ───────── Primeiros passos (Início) ───────── */
.first-steps { display: grid; gap: 14px; margin-top: 20px; }
.first-steps .panel-head { align-items: flex-start; margin-bottom: 0; }
.fs-progress { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.fs-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fs-row { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; font: inherit; text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s; }
a.fs-row:hover, button.fs-row:hover { border-color: var(--moss); background: var(--surface-2); }
.fs-step.done .fs-row { cursor: default; background: var(--surface-2); border-style: dashed; }
.fs-step.done .fs-text b { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.fs-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; }
.fs-check svg { width: 15px; height: 15px; }
.fs-step.done .fs-check { background: var(--moss); border-color: var(--moss); color: var(--moss-ink); }
.fs-text { display: grid; gap: 1px; min-width: 0; }
.fs-text b { font-size: var(--fs-1); line-height: 1.3; }
.fs-reward { font-size: var(--fs-0); font-weight: 700; color: color-mix(in oklab, var(--lamp-ink) 55%, var(--ink)); background: var(--lamp-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.fs-reward svg { width: 13px; height: 13px; }
.fs-step.done .fs-reward { background: var(--moss-soft); color: var(--moss); }
.first-steps.all-done { background: linear-gradient(135deg, var(--lamp-soft), var(--surface) 60%); }
@media (max-width: 760px) {
  .fs-list { grid-template-columns: minmax(0, 1fr); }
  .fs-row { grid-template-columns: auto minmax(0, 1fr); }
  .fs-reward { grid-column: 2; justify-self: start; }
}

/* ───────── Entrada (login e cadastro) ───────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(400px, .75fr); }
.auth-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); align-content: space-between; gap: 34px;
  padding: 36px clamp(28px, 4.5vw, 64px) 40px; color: #EEF1F3;
  background: radial-gradient(120% 70% at 50% 78%, rgba(242, 181, 68, .16), transparent 60%), linear-gradient(180deg, #121A23 0%, #1A2531 100%);
}
.auth-hero::after { content: ''; position: absolute; inset: auto -10% -40% -10%; height: 60%; background: radial-gradient(closest-side, rgba(242, 181, 68, .10), transparent); pointer-events: none; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; font: 700 var(--fs-3)/1 var(--f-display); letter-spacing: -.02em; color: inherit; text-decoration: none; justify-self: start; }
.auth-brand svg { width: 32px; height: 32px; flex: none; }
.auth-hero .auth-brand svg rect { fill: #24313F; }
.auth-copy { display: grid; gap: 16px; max-width: 620px; }
.auth-live { display: inline-flex; align-items: center; gap: 9px; justify-self: start; margin: 0; padding: 5px 12px 5px 10px; border-radius: 999px;
  background: rgba(127, 209, 164, .1); border: 1px solid rgba(127, 209, 164, .22); color: #BFE6CF; font-size: var(--fs-0); font-weight: 700; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #7FD1A4; box-shadow: 0 0 0 0 rgba(127, 209, 164, .6); animation: live 2.4s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(127, 209, 164, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 209, 164, 0); } }
.auth-hero h1 { font-size: clamp(2.5rem, 4.6vw, 4rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 750; }
.auth-hero h1 em { font-style: normal; color: #F2B544; text-shadow: 0 0 34px rgba(242, 181, 68, .35); }
.auth-lede { margin: 0; color: #B4BEC8; font-size: var(--fs-2); max-width: 50ch; }
.auth-room { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 14px;
  border-radius: 22px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .07); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.auth-seat { margin: 0; display: grid; gap: 7px; min-width: 0; }
.auth-seat .desk-svg { border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.auth-seat figcaption { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: var(--fs-0); padding-inline: 2px; min-width: 0; }
.auth-seat b { color: #E8ECEF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-seat figcaption span { color: #F6CF7E; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.auth-seat figcaption span.is-break { color: #9FD3BA; }
.auth-feats { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.auth-feats li { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.auth-feats b { display: block; color: #EEF1F3; font-size: var(--fs-1); line-height: 1.3; }
.auth-feats div span { color: #9AA6B2; font-size: var(--fs-0); }
.auth-feat-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(242, 181, 68, .13); color: #F2B544; }
.auth-feat-ic svg { width: 19px; height: 19px; }
.auth-side { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 40px clamp(20px, 4vw, 56px); background: var(--paper); }
.auth-card { width: min(430px, 100%); display: grid; gap: 22px; padding: 30px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-card h2 { font-size: var(--fs-4); }
.auth-card form { display: grid; gap: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.auth-tabs a { text-align: center; padding: 8px 10px; border-radius: 10px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.auth-tabs a:hover { color: var(--ink); }
.auth-tabs a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(31, 42, 54, .12); }
.auth-switch { text-align: center; }
@media (max-width: 1100px) { .auth-feats { grid-template-columns: 1fr; gap: 12px; } }
@media (max-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { gap: 22px; padding: 22px 16px 26px; align-content: start; }
  .auth-room { gap: 8px; padding: 8px; border-radius: 16px; }
  .auth-feats { display: none; }
  .auth-side { padding: 22px 16px 40px; place-items: start center; }
  .auth-card { padding: 22px; }
}
@media (max-width: 480px) {
  .auth-hero h1 { font-size: clamp(2.1rem, 10vw, 2.6rem); }
  .auth-lede { font-size: var(--fs-1); }
  .auth-seat figcaption { font-size: .72rem; }
}

/* ───────── Recuperação de senha ───────── */
.auth-forgot { justify-self: end; margin-top: -6px; }
.recover { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: 24px; padding: 32px 16px 56px; background: var(--paper); color: var(--ink); }
.recover .auth-brand { justify-self: center; }
.recover .auth-card { gap: 18px; }
.recover .auth-card h1 { font-size: var(--fs-4); }
.recover .auth-card form { display: grid; gap: 14px; }
.recover .auth-switch { display: inline-flex; gap: 4px; align-items: center; justify-self: center; }
.recover .auth-switch svg { width: 15px; height: 15px; }
.recover-sent { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--moss-soft); color: var(--moss); }
.recover-sent svg { width: 24px; height: 24px; }
.recover .notice { padding: 10px 12px; border-radius: var(--r-md); background: var(--lamp-soft); }

/* ───────── Boas-vindas (depois do cadastro) ───────── */
.welcome { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; background: var(--paper); }
.welcome-top { display: flex; justify-content: space-between; align-items: center; padding: 16px clamp(16px, 4vw, 40px); color: var(--ink); }
.welcome-body { width: min(980px, 100%); margin: 0 auto; padding: 12px 16px 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.welcome-preview { display: grid; gap: 12px; padding: 14px 14px 16px; border-radius: 24px; color: #EEF1F3;
  background: radial-gradient(90% 70% at 50% 70%, rgba(242, 181, 68, .2), transparent 70%), linear-gradient(180deg, #121A23, #1A2531); box-shadow: 0 30px 60px -30px rgba(18, 26, 35, .55); }
.welcome-preview .desk-svg { border-radius: 14px; }
.welcome-preview p { margin: 0; display: grid; justify-items: center; line-height: 1.3; }
.welcome-preview b { font: 700 var(--fs-3) var(--f-display); }
.welcome-preview p span { color: #AEB8C2; font-size: var(--fs-0); }
.welcome-card { display: grid; gap: 16px; padding: 28px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.welcome-card h1 { font-size: var(--fs-4); }
.welcome-card [data-step] { display: grid; gap: 14px; }
.welcome-card [data-step] > p { margin: -6px 0 0; }
.welcome-steps { display: flex; align-items: center; gap: 6px; }
.welcome-steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background .3s; }
.welcome-steps span.on { background: var(--moss); }
.welcome-steps small { margin-left: 6px; color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.welcome-sub { font-size: var(--fs-2); margin-top: 6px; }
.welcome-back { justify-self: start; }
.input-lg { min-height: 52px; font-size: var(--fs-2); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: 700 var(--fs-1) var(--f-body); cursor: pointer; transition: background .15s, border-color .15s; }
.choice:hover { border-color: var(--ink-3); }
.choice[aria-checked="true"] { background: var(--moss-soft); border-color: var(--moss); color: var(--moss); }
.choice:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 760px) {
  .welcome-body { grid-template-columns: 1fr; align-items: start; padding-top: 0; gap: 16px; }
  .welcome-preview { width: min(300px, 100%); justify-self: center; padding: 10px 10px 12px; border-radius: 18px; }
  .welcome-preview b { font-size: var(--fs-2); }
  .welcome-card { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ───────── Admin ───────── */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kv .panel { padding: 14px; }

/* Resumo de sessão */
.summary-hero { display: grid; gap: 4px; text-align: center; padding: 6px 0; }
.summary-hero b { font-family: var(--f-display); font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.reward-list { display: grid; gap: 8px; }
.reward-list > div { display: block; padding: 8px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.reward-list .r-lamp { background: var(--lamp-soft); }

/* Ícones embutidos em texto */
.chip svg, .me-line svg, .row > svg, .stat svg, .item .badge svg, .small > svg, .btn-sm svg { width: 15px; height: 15px; flex: none; }
.me-line .row { align-items: center; }
.week-day .num { min-height: 1.2em; }
main:focus, main:focus-visible { outline: none; }
.brand-mark rect:first-child { fill: var(--brand-bg, #17202B); }
:root[data-theme="dark"] { --brand-bg: #2A3746; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --brand-bg: #2A3746; } }
.hall-total { display: grid; gap: 2px; text-align: right; }
@media (max-width: 640px) { .hall-total { text-align: left; } }
@media (max-width: 640px) { .hall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .hall { padding: 12px; } }

/* ───────── Fotos ───────── */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; background: var(--surface-2); box-shadow: 0 0 0 2px var(--surface); }
.avatar-ini { display: inline-grid; place-items: center; color: #fff; font-family: var(--f-display); font-weight: 700; line-height: 1; letter-spacing: .02em; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -8px; }

/* ───────── Início ───────── */
.home-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.home-head h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.strip { display: flex; flex-wrap: wrap; gap: 6px 28px; align-items: flex-start; padding: 14px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.strip-item { display: grid; gap: 5px; min-width: 110px; }
.strip-goal { min-width: 170px; }
.strip-label { font-size: .75rem; font-weight: 700; color: var(--ink-3); }
.strip-value { display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-display); font-weight: 650; font-size: 1.15rem; }
.strip-value svg { width: 16px; height: 16px; }
.strip .bar { height: 6px; }
.strip-week { margin-left: auto; }
.dots { display: flex; gap: 6px; }
.dot { display: grid; justify-items: center; gap: 3px; }
.dot i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-2); background: transparent; }
.dot.some i { background: color-mix(in oklab, var(--moss) 30%, var(--surface)); border-color: transparent; }
.dot.on i { background: var(--moss); border-color: var(--moss); }
.dot.goal i { background: var(--lamp); border-color: var(--lamp); }
.dot.today i { outline: 2px solid var(--ink-3); outline-offset: 1px; }
.dot.future i { opacity: .45; }
.dot b { font-size: .65rem; color: var(--ink-3); font-weight: 700; }
@media (max-width: 760px) { .strip { gap: 12px 20px; } .strip-week { margin-left: 0; } .strip-item { min-width: 0; } }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .home-grid { grid-template-columns: 1fr; } }
.mini-hall { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mini-seat { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; color: inherit; text-decoration: none; }
.mini-seat .desk-frame { border-radius: var(--r-md); }
.mini-seat.me .desk-frame { outline: 2px solid var(--lamp); outline-offset: 2px; }
a.mini-seat:hover .desk-frame { border-color: var(--ink-3); }
.mini-seat-name { display: flex; justify-content: space-between; gap: 6px; font-weight: 700; font-size: var(--fs-0); }
.mini-seat-name span:first-child, .mini-seat-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .mini-hall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.missions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
@media (max-width: 640px) { .missions-grid { grid-template-columns: 1fr; } }
.invites { border-color: var(--lamp); }
.invite-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.invite-row > svg { width: 22px; height: 22px; color: var(--ink-3); }
@media (max-width: 560px) { .invite-row { grid-template-columns: auto minmax(0, 1fr); } .invite-row > .row { grid-column: 2; } }
.friend-room { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.friend-room:hover b { text-decoration: underline; }
.challenge-mini { display: grid; gap: 6px; color: inherit; text-decoration: none; }

/* ───────── Convites por @ ───────── */
.picker { position: relative; display: grid; gap: 8px; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.picker-chips:empty { display: none; }
.picker-chip { padding: 3px 4px 3px 4px; gap: 6px; }
.picker-chip button { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 0 2px; display: grid; place-items: center; }
.picker-chip button svg { width: 14px; height: 14px; }
.picker-input, .input-at { position: relative; }
.picker-input > span, .input-at > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 700; pointer-events: none; }
.picker-input .input, .input-at .input { padding-left: 28px; }
.picker-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; margin-top: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 4px; display: grid; max-height: 240px; overflow-y: auto; }
.picker-opt { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; cursor: pointer; color: inherit; }
.picker-opt:hover, .picker-opt:focus-visible { background: var(--surface-2); }

/* ───────── Salas com amigos / desafios ───────── */
.member { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; padding-block: 2px; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: inherit; text-decoration: none; font-size: var(--fs-0); font-weight: 700; }
.person-chip.pending { opacity: .65; }
.rank-person { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.rank-person:hover b { text-decoration: underline; }

/* ───────── Perfil ───────── */
.profile { max-width: 980px; }
.profile-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 360px); gap: 24px; align-items: center; }
.profile-main { display: grid; gap: 14px; min-width: 0; }
.profile-desk { width: 100%; }
.profile-id { display: flex; align-items: center; gap: 18px; }
.profile-avatar { box-shadow: 0 0 0 4px var(--surface); }
.profile-id h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
@media (max-width: 760px) { .profile-head { grid-template-columns: 1fr; } .profile-desk { order: -1; } }
.profile-bio { max-width: 62ch; font-size: var(--fs-2); }
.btn-liked { background: var(--lamp-soft); border-color: var(--lamp); }
.btn-liked svg { fill: currentColor; }
.profile-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.profile-stats .stat { padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.profile-stats .stat b { font-size: var(--fs-3); }
@media (max-width: 860px) { .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cal28 { display: grid; grid-template-columns: repeat(7, minmax(0, 28px)); gap: 6px; }
.cal28 .cal-h { font-size: .7rem; color: var(--ink-3); font-weight: 700; text-align: center; }
.cal28 i { aspect-ratio: 1; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); }
.cal28 i.some { background: color-mix(in oklab, var(--moss) 30%, var(--surface)); border-color: transparent; }
.cal28 i.on { background: var(--moss); border-color: transparent; }
.ach-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ach-badge { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-md); background: var(--surface-2); }
.ach-badge .ach-icon { width: 36px; height: 36px; background: var(--lamp-soft); color: color-mix(in oklab, var(--lamp) 60%, var(--ink)); border-color: transparent; }

/* ───────── Configurações / Mais ───────── */
.photo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.more-list { display: grid; padding: 6px; }
.more-list a { display: flex; align-items: center; gap: 12px; padding: 12px 10px; color: inherit; text-decoration: none; font-weight: 700; border-radius: var(--r-md); }
.more-list a:hover { background: var(--surface-2); }
.more-list a svg { width: 20px; height: 20px; }
.more-list a svg:last-child { margin-left: auto; color: var(--ink-3); }
a.seat { color: inherit; text-decoration: none; }
a.seat:hover .desk-frame { border-color: var(--ink-3); }
.seat-meta { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.seat-name, .mini-seat-name { min-width: 0; }
.seat-time, .mini-seat-name .num { flex: none; }

/* ───────── Salão (sala de estudos) ───────── */
.hall { gap: 16px; }
.hall-head { align-items: center; }
.hall-head h2 { font-size: var(--fs-3); }
.hall-body { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .hall-body { grid-template-columns: 1fr; } }
.hall-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 640px) { .hall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.seat .desk-frame { display: block; }
.seat-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 20px; }
.tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-2); }
.tag-paused { background: var(--surface-2); color: var(--ink-2); border-color: var(--ink-3); }
.tag-break { background: var(--lamp-soft); color: color-mix(in oklab, var(--lamp) 45%, var(--ink)); border-color: transparent; }
.seat.me { padding: 8px; margin: -8px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--lamp); }
.seat.me .desk-frame { outline: none; }
.seat-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.seat-controls .btn { flex: 1 1 auto; }
.topic-btn { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; border: 1px dashed var(--line-2); background: transparent; color: var(--ink-2); border-radius: 8px; padding: 5px 8px; cursor: pointer; font-size: var(--fs-0); text-align: left; }
.topic-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-btn svg { width: 14px; height: 14px; flex: none; }
.topic-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.topic-form { display: flex; gap: 6px; }
.topic-form .input { min-height: 32px; padding: 4px 8px; font-size: var(--fs-0); }
.departures { border-left: 1px solid var(--line); padding-left: 16px; display: grid; gap: 10px; align-content: start; }
@media (max-width: 860px) { .departures { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; } }
.departures ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.departures li { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-0); line-height: 1.4; }
.departures li a { color: inherit; }
.mode-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .mode-choices { grid-template-columns: 1fr; } }
.mode-choice { display: grid; gap: 6px; text-align: left; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.mode-choice b { font-family: var(--f-display); font-size: var(--fs-3); }
.mode-choice span { color: var(--ink-2); font-size: var(--fs-0); }
.mode-choice:hover, .mode-choice:focus-visible { border-color: var(--lamp); background: var(--lamp-soft); }
.room-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

/* ───────── Flashcards ───────── */
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.deck { display: grid; gap: 12px; }
.deck-name { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 650; font-size: var(--fs-2); color: inherit; text-decoration: none; min-width: 0; }
.deck-name:hover { text-decoration: underline; }
.deck-stats { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); }
.fc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .fc-fields { grid-template-columns: 1fr; } }
.fc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.fc-row.editing { grid-template-columns: 1fr 1fr; }
.fc-row.editing .row { grid-column: 1 / -1; }
.fc-q { font-weight: 700; white-space: pre-wrap; overflow-wrap: anywhere; }
.fc-a { white-space: pre-wrap; overflow-wrap: anywhere; }
.fc-meta { display: flex; gap: 4px; align-items: center; }
@media (max-width: 640px) { .fc-row { grid-template-columns: 1fr; } }
.box-dots { display: inline-flex; gap: 3px; margin-right: 6px; }
.box-dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--line-2); }
.box-dots i.on { background: var(--moss); border-color: var(--moss); }
.fc-review { gap: 18px; }
.fc-card { display: grid; gap: 14px; align-content: center; justify-items: center; text-align: center; min-height: 280px; padding: 32px 24px; border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); cursor: pointer; font: inherit; width: 100%; }
.fc-card.flipped { cursor: default; }
.fc-front { font-family: var(--f-display); font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 600; line-height: 1.3; white-space: pre-wrap; overflow-wrap: anywhere; }
.fc-back { font-size: var(--fs-2); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 52ch; }
.fc-divider { width: 60px; height: 2px; background: var(--line-2); border-radius: 2px; }
.fc-grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 520px) { .fc-grades { grid-template-columns: 1fr 1fr; } }
.fc-grade { display: grid; gap: 2px; min-height: 64px; position: relative; }
.fc-grade kbd { position: absolute; top: 6px; right: 8px; font: 700 .65rem var(--f-body); color: var(--ink-3); }
.fc-again { border-color: color-mix(in oklab, var(--danger) 50%, var(--line)); }
.fc-good { border-color: var(--moss); }
.fc-easy { border-color: var(--lamp); }
.fc-done { display: grid; gap: 12px; padding: 32px; }
.fc-done h1 { font-size: var(--fs-4); }
.hall-grid { align-items: start; }
.seat { align-content: start; }

/* Cartão da sala no início */
.room-card-home { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 24px; border-radius: var(--r-xl);
  background: color-mix(in oklab, var(--lamp-soft) 55%, var(--surface)); border: 1px solid color-mix(in oklab, var(--lamp) 45%, var(--line)); }
.rch-text { display: grid; gap: 8px; min-width: 0; }
.rch-text h2 { font-size: var(--fs-3); }
.rch-text p { color: var(--ink-2); }
.rch-faces { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink-2); }
.rch-face { margin-left: -8px; border-radius: 50%; position: relative; }
.rch-face:first-child { margin-left: 0; }
.rch-face .avatar { box-shadow: 0 0 0 2px var(--surface); }
.rch-face.on::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 0 2px var(--surface); }
.rch-more { margin-left: 8px; font-weight: 700; font-size: var(--fs-0); }
.rch-actions { display: grid; gap: 8px; justify-items: center; }
@media (max-width: 640px) { .rch-actions { width: 100%; } .rch-actions .btn { width: 100%; } }
