/* ============================================================ tokens */
:root {
  --bg: #FBF8F4;
  --bg-tint: #FFFDFB;
  --surface: #FFFFFF;
  --surface-2: #F7F2EC;
  --surface-3: #EFE8E0;
  --border: #EFE7DE;
  --border-strong: #E0D5C9;
  --text: #2B2421;
  --text-2: #4A403B;
  --muted: #8C8077;
  --primary: #C04A6E;
  --primary-hover: #AA3D5F;
  --primary-ink: #FFFFFF;
  --primary-soft: #FCE9EF;
  --primary-soft-ink: #A93D5E;
  --peach: #FFEDE0;   --peach-ink: #C25A1C;
  --lavender: #EFEAFF; --lavender-ink: #6A4FD0;
  --mint: #E3F6EA;    --mint-ink: #2E8A57;
  --sky: #E3F1FC;     --sky-ink: #2C74B4;
  --butter: #FFF3CC;  --butter-ink: #A07600;
  --danger: #C53030;
  --danger-soft: #FDECEC;
  --ring: rgba(192, 74, 110, .28);
  --wood-top: #F1DFC5;
  --wood: #E2C59F;
  --wood-edge: #C9A47A;
  --shadow-sm: 0 1px 2px rgba(60, 40, 30, .05);
  --shadow: 0 2px 6px rgba(60, 40, 30, .05), 0 10px 30px -12px rgba(60, 40, 30, .14);
  --shadow-lg: 0 30px 70px -20px rgba(60, 40, 30, .35);
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --font: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sidebar: 268px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120F;
    --bg-tint: #1A1613;
    --surface: #1F1B18;
    --surface-2: #28231F;
    --surface-3: #332D28;
    --border: #2F2925;
    --border-strong: #423A34;
    --text: #F6F0EA;
    --text-2: #DDD3CA;
    --muted: #A99D93;
    --primary: #EC7E9E;
    --primary-hover: #F395B0;
    --primary-ink: #2A0E17;
    --primary-soft: #3A1E27;
    --primary-soft-ink: #F5A9BF;
    --peach: #3A2618;   --peach-ink: #FDBA8C;
    --lavender: #2A2440; --lavender-ink: #C4B5FD;
    --mint: #18301F;    --mint-ink: #86EFAC;
    --sky: #172A3B;     --sky-ink: #93C5FD;
    --butter: #352B10;  --butter-ink: #FCD34D;
    --danger: #F87171;
    --danger-soft: #3A1A1A;
    --ring: rgba(236, 126, 158, .35);
    --wood-top: #6B4E33;
    --wood: #573E28;
    --wood-edge: #3E2B1B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

/* ============================================================ base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; color: var(--text); font-weight: 800; letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: 1.85rem; font-weight: 900; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; font-weight: 700; }
button { font: inherit; }
svg.i { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: breathe 1.1s var(--ease) infinite alternate; border-radius: 16px; }
@keyframes breathe { from { opacity: .4; transform: scale(.92) } to { opacity: 1; transform: none } }

/* ============================================================ movimento */
@keyframes rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(8px) } to { opacity: 1; transform: none } }
@keyframes grow { from { width: 0 } }
@keyframes ripple { to { transform: scale(4); opacity: 0 } }
@keyframes shimmer { from { background-position: -400px 0 } to { background-position: 400px 0 } }
.view { animation: rise .38s var(--ease) both; }
.view > * { animation: rise .45s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: .04s } .view > *:nth-child(3) { animation-delay: .08s }
.view > *:nth-child(4) { animation-delay: .12s } .view > *:nth-child(5) { animation-delay: .16s }
.view > *:nth-child(6) { animation-delay: .2s }  .view > *:nth-child(n+7) { animation-delay: .24s }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 0, var(--surface-3) 50%, var(--surface-2) 100%) 0 0 / 800px 100%; animation: shimmer 1.2s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}

/* ============================================================ estrutura */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 20;
  display: none; flex-direction: column; gap: 4px; overflow-y: auto;
  background: var(--bg-tint); border-right: 1px solid var(--border); padding: 20px 14px;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 2px 10px 14px; color: var(--text); font-weight: 900; font-size: 1.12rem; letter-spacing: -.02em; }
.logo img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 4px 12px -4px rgba(192, 74, 110, .5); }
.wordmark { font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.wordmark span { color: var(--text-2); }
.wordmark b { font-weight: 900; color: var(--primary); }
.nav-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 16px 12px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 700; transition: background .2s, color .2s, transform .15s var(--ease);
}
.nav a:hover { background: var(--surface-2); }
.nav a:active { transform: scale(.98); }
.nav a.active { background: var(--primary-soft); color: var(--primary-soft-ink); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.nav a .club-mark { width: 24px; height: 24px; border-radius: 8px; font-size: .62rem; }
.nav a .nav-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); color: var(--text); transition: background .2s; }
.user-chip:hover { background: var(--surface-2); }
.user-chip .name { font-weight: 800; font-size: .92rem; line-height: 1.2; }
.user-chip .email { font-size: .78rem; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 165px; }

.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .logo { padding: 0; flex: 1; }
.content { padding: 24px 16px 110px; max-width: 1120px; margin: 0 auto; }
.tabbar {
  position: fixed; inset: auto 12px 12px 12px; z-index: 15; display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow);
  padding: 6px; margin-bottom: env(safe-area-inset-bottom);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; padding: 6px 2px; border-radius: 16px; font-size: .7rem; font-weight: 800; color: var(--muted); transition: color .2s, background .2s, transform .15s var(--ease); }
.tabbar a:active { transform: scale(.92); }
.tabbar a.active { color: var(--primary); background: var(--primary-soft); }
.tabbar svg.i { width: 22px; height: 22px; }
@media (min-width: 980px) {
  .sidebar { display: flex; }
  .topbar, .tabbar { display: none; }
  .main { margin-left: var(--sidebar); }
  .content { padding: 38px 44px 70px; }
}

/* ============================================================ cabeçalhos */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 640px; font-weight: 600; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 34px 0 14px; }
.section-head .count { color: var(--muted); font-weight: 700; font-size: .9rem; }
.club-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.club-hero .club-mark { width: 52px; height: 52px; border-radius: 16px; font-size: 1.05rem; }
.subnav { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: 0 0 24px; background: var(--surface-2); border-radius: 16px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 12px; color: var(--text-2); font-weight: 800; font-size: .9rem; transition: background .2s, color .2s, box-shadow .2s; }
.subnav a:hover { color: var(--text); }
.subnav a.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.subnav svg.i { width: 17px; height: 17px; }

/* ============================================================ componentes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 22px; }
.card + .card { margin-top: 16px; }
a.card, .card.clickable { color: var(--text); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; cursor: pointer; }
a.card:hover, .card.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid > .card + .card, .member-grid > .card + .card, .choice-grid > .card + .card { margin-top: 0; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .grid-stats { grid-template-columns: repeat(4, 1fr); gap: 16px; } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid-2 { grid-template-columns: 1.4fr 1fr; align-items: start; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.stat { position: relative; overflow: hidden; border: 0; padding: 18px; border-radius: var(--radius-lg); display: flex; flex-direction: column; min-height: 124px; }
.stat .k { position: relative; display: flex; align-items: flex-start; gap: 8px; font-size: .84rem; font-weight: 800; line-height: 1.25; opacity: .9; }
.stat .k svg.i { margin-top: 1px; }
.stat .v { font-size: 1.9rem; font-weight: 900; line-height: 1.1; letter-spacing: -.03em; margin-top: auto; padding-top: 10px; color: var(--text); }
.stat .s { font-size: .8rem; font-weight: 700; color: var(--muted); margin-top: 2px; min-height: 1.25em; }
.stat .blob { position: absolute; right: -18px; top: -18px; width: 74px; height: 74px; border-radius: 50%; opacity: .55; }
.tone-peach { background: var(--peach); } .tone-peach .k { color: var(--peach-ink); } .tone-peach .blob { background: color-mix(in srgb, var(--peach-ink) 18%, transparent); }
.tone-lavender { background: var(--lavender); } .tone-lavender .k { color: var(--lavender-ink); } .tone-lavender .blob { background: color-mix(in srgb, var(--lavender-ink) 16%, transparent); }
.tone-mint { background: var(--mint); } .tone-mint .k { color: var(--mint-ink); } .tone-mint .blob { background: color-mix(in srgb, var(--mint-ink) 16%, transparent); }
.tone-sky { background: var(--sky); } .tone-sky .k { color: var(--sky-ink); } .tone-sky .blob { background: color-mix(in srgb, var(--sky-ink) 16%, transparent); }
.tone-butter { background: var(--butter); } .tone-butter .k { color: var(--butter-ink); } .tone-butter .blob { background: color-mix(in srgb, var(--butter-ink) 16%, transparent); }
.tone-rose { background: var(--primary-soft); } .tone-rose .k { color: var(--primary-soft-ink); } .tone-rose .blob { background: color-mix(in srgb, var(--primary) 14%, transparent); }

.row { display: flex; gap: 14px; align-items: flex-start; }
.row.center { align-items: center; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge svg.i { width: 14px; height: 14px; }
.badge.primary { background: var(--primary-soft); color: var(--primary-soft-ink); }
.badge.success { background: var(--mint); color: var(--mint-ink); }
.badge.gold { background: var(--butter); color: var(--butter-ink); }
.badge.lavender { background: var(--lavender); color: var(--lavender-ink); }
.badge.sky { background: var(--sky); color: var(--sky-ink); }
.badge.peach { background: var(--peach); color: var(--peach-ink); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badges .badge { max-width: 100%; white-space: normal; height: auto; min-height: 26px; padding: 3px 10px; line-height: 1.3; }
.feature .info .btn { max-width: 100%; white-space: normal; height: auto; min-height: 34px; padding: 6px 12px; line-height: 1.25; }

/* botões com micro-interações */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent; cursor: pointer;
  font: 800 .92rem var(--font); background: var(--primary); color: var(--primary-ink); white-space: nowrap;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 70%, transparent);
  transition: transform .18s var(--spring), box-shadow .2s var(--ease), background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn:active { transform: scale(.96); transition-duration: .08s; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn:focus-visible, input:focus-visible, .seg button:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.soft { background: var(--primary-soft); color: var(--primary-soft-ink); box-shadow: none; }
.btn.soft:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 12%); }
.btn.ghost { background: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); box-shadow: none; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 34px; padding: 0 13px; font-size: .84rem; border-radius: 11px; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 1rem; border-radius: 16px; }
.btn.block { width: 100%; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 34px; }
.btn .rip { position: absolute; z-index: -1; border-radius: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; background: currentColor; opacity: .18; transform: scale(0); animation: ripple .55s var(--ease) forwards; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .86rem; font-weight: 800; color: var(--text-2); margin-bottom: 6px; }
.field > small { display: block; color: var(--muted); margin-top: 5px; font-size: .8rem; font-weight: 600; }
.field > span.row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.field > span.row a { font-size: .82rem; }
input, textarea, select {
  width: 100%; font: 600 .95rem var(--font); color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border-strong); border-radius: 13px; padding: 10px 13px; min-height: 44px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:hover, textarea:hover, select:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border-strong)); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); font-weight: 500; }
textarea { min-height: 92px; resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }
input[type=range] { padding: 0; min-height: 0; border: 0; accent-color: var(--primary); background: none; box-shadow: none; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.cols-2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .cols-2 { grid-template-columns: 1fr 1fr; } }
.cols-4 { display: grid; gap: 0 14px; grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) { .cols-4 { grid-template-columns: repeat(4, 1fr); } }

/* controle segmentado (status do livro, abas) */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 15px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; border: 0; background: none; height: 36px; padding: 0 14px; border-radius: 11px; color: var(--muted); font-weight: 800; font-size: .88rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .2s, color .2s, box-shadow .2s, transform .15s var(--spring); }
.seg button:active { transform: scale(.95); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button .n { font-size: .75rem; color: var(--muted); background: var(--surface-3); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.seg button.active .n { background: var(--primary-soft); color: var(--primary-soft-ink); }

.empty { text-align: center; padding: 38px 22px; color: var(--muted); font-weight: 600; }
.empty .ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-soft-ink); }
.empty .ic svg.i { width: 26px; height: 26px; }
.empty strong { display: block; color: var(--text); font-size: 1.05rem; font-weight: 800; margin-bottom: 4px; }

.progress { height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 75%, #F6A6BD), var(--primary)); animation: grow 1s var(--ease) both; }
.progress.mint > i { background: linear-gradient(90deg, #7DD3A3, var(--mint-ink)); }
.progress.lavender > i { background: linear-gradient(90deg, #B9A7FA, var(--lavender-ink)); }

.ring { position: relative; width: 108px; height: 108px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring .track { stroke: var(--surface-3); }
.ring .bar { stroke: var(--ring-color, var(--primary)); transition: stroke-dashoffset 1s var(--ease); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .center b { font-size: 1.35rem; font-weight: 900; display: block; line-height: 1; }
.ring .center span { font-size: .72rem; font-weight: 700; color: var(--muted); }
.goal { display: flex; align-items: center; gap: 16px; }

/* ============================================================ livros */
.cover { position: relative; flex: none; border-radius: 4px 9px 9px 4px; overflow: hidden; background: var(--surface-3); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 8px 18px -8px rgba(40,20,10,.4); }
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.18) 0, rgba(255,255,255,.12) 4%, transparent 9%); pointer-events: none; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; animation: fade .4s ease both; }
.cover.xs { width: 34px; height: 50px; }
.cover.sm { width: 48px; height: 72px; }
.cover.md { width: 78px; height: 117px; }
.cover.lg { width: 122px; height: 183px; }
.cover.xl { width: 172px; height: 258px; }
.cover-ph { width: 100%; height: 100%; display: grid; place-items: center; padding: 8%; text-align: center; color: #fff; font-weight: 800; font-size: .62rem; line-height: 1.2; background: linear-gradient(155deg, #E07B98, #8E3456); }
.cover.lg .cover-ph, .cover.xl .cover-ph { font-size: .95rem; }
.book-title { font-weight: 800; font-size: 1rem; line-height: 1.3; color: var(--text); letter-spacing: -.01em; }
.book-meta { color: var(--muted); font-size: .86rem; font-weight: 600; }
.book-grid { display: grid; gap: 20px 14px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.book-tile { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.book-tile .cover { width: 100%; height: auto; aspect-ratio: 2 / 3; transition: transform .25s var(--ease); }
.book-tile:hover .cover { transform: translateY(-3px); }
.book-tile .book-title { font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-tile .book-meta { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feature { display: flex; gap: 20px; }
.feature .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.feature .book-title { font-size: 1.35rem; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.clamp.open { -webkit-line-clamp: unset; }
@media (max-width: 520px) { .feature .cover.lg { width: 96px; height: 144px; } .feature { gap: 14px; } .feature .book-title { font-size: 1.12rem; } }
.stars { display: inline-flex; gap: 2px; color: #F2B33D; }
.stars svg.i { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.stars .off { color: var(--surface-3); }
.star-input { display: inline-flex; gap: 4px; }
.star-input button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--surface-3); transition: transform .15s var(--spring), color .15s; }
.star-input button:hover { transform: scale(1.18); }
.star-input button.on { color: #F2B33D; }
.star-input svg.i { width: 28px; height: 28px; fill: currentColor; stroke: none; }

/* ============================================================ prateleira virtual */
.shelf-wrap { padding: 20px 12px 4px; border-radius: var(--radius-lg); background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 70%, var(--wood-top)) 0%, var(--surface) 60%); border: 1px solid var(--border); }
@media (min-width: 720px) { .shelf-wrap { padding: 26px 22px 6px; } }
.shelf {
  --row: 172px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); grid-auto-rows: var(--row); column-gap: 14px; align-items: end;
  padding: 0 6px;
  background-image:
    linear-gradient(180deg, transparent calc(100% - 20px), var(--wood-top) calc(100% - 20px), var(--wood) calc(100% - 8px), var(--wood-edge) calc(100% - 8px), var(--wood-edge) calc(100% - 4px), transparent calc(100% - 4px));
  background-size: 100% var(--row);
}
@media (min-width: 720px) { .shelf { --row: 232px; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); column-gap: 22px; } }
.shelf-book { position: relative; align-self: end; margin-bottom: 20px; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; transform-origin: bottom center; transition: transform .3s var(--spring); }
.shelf-book .cover { width: 100%; height: auto; aspect-ratio: 2 / 3; box-shadow: 0 2px 3px rgba(0,0,0,.18), 6px 4px 14px -6px rgba(40,20,10,.55); }
.shelf-book:hover, .shelf-book:focus-visible { transform: translateY(-10px) rotate(-1.5deg); outline: none; }
.shelf-book:active { transform: translateY(-4px) scale(.97); }
.shelf-book .tag { position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 2; display: flex; justify-content: center; }
.shelf-book .tag .badge { height: 22px; font-size: .7rem; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.shelf-book .mini-progress { position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 2; height: 6px; border-radius: 999px; background: rgba(255,255,255,.6); overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.shelf-book .mini-progress i { display: block; height: 100%; background: var(--primary); animation: grow 1s var(--ease) both; }
.shelf-book .owned { position: absolute; top: 6px; right: 6px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--mint-ink); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.shelf-book .owned svg.i { width: 13px; height: 13px; stroke-width: 3; }
.shelf-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 18px; }
.shelf-tools .search-box { flex: 1 1 220px; }
.shelf-tools select { width: auto; min-width: 170px; }

.reading-card { display: flex; gap: 16px; align-items: center; }
.reading-card .grow { display: flex; flex-direction: column; gap: 6px; }

.slot { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); min-height: 98px; }
.slot.empty-slot { border: 2px dashed var(--border-strong); background: var(--surface-2); justify-content: center; color: var(--muted); cursor: pointer; font-weight: 800; transition: border-color .2s, color .2s, transform .2s var(--spring), background .2s; }
.slot.empty-slot:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.slot.empty-slot:active { transform: scale(.98); }
.slots { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .slots { grid-template-columns: 1fr 1fr; } }

.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 4px; border-radius: 999px; background: var(--surface-2); font-size: .84rem; font-weight: 700; }
.person.done { background: var(--mint); color: var(--mint-ink); }
.person svg.i { width: 15px; height: 15px; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .82rem; }
.avatar.xs { width: 24px; height: 24px; font-size: .62rem; }
.avatar.sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar.lg { width: 68px; height: 68px; font-size: 1.35rem; }
.club-mark { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: .8rem; }

.list-item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.list-item:last-child { border-bottom: 0; }
.member-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.member-card { display: flex; gap: 12px; align-items: center; padding: 16px; }
.scroller { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.scroller > * { scroll-snap-align: start; flex: none; width: 104px; }

.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 170px; padding-top: 8px; }
.bars .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bars .bar { width: 100%; max-width: 34px; border-radius: 10px 10px 6px 6px; background: color-mix(in srgb, var(--primary) 22%, var(--surface-2)); transform-origin: bottom; animation: barup .8s var(--ease) both; position: relative; min-height: 4px; }
.bars .col.now .bar { background: linear-gradient(180deg, #F08CA9, var(--primary)); }
.bars .bar b { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .7rem; font-weight: 800; color: var(--text-2); white-space: nowrap; }
.bars .lbl { font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: capitalize; }
@keyframes barup { from { transform: scaleY(0) } }

/* ============================================================ entrada */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-art {
  display: none; position: relative; overflow: hidden; padding: 56px; color: #fff;
  background: radial-gradient(120% 90% at 0% 0%, #F08CA9 0%, #C04A6E 45%, #6E2340 100%);
}
.auth-art h2 { color: #fff; font-size: 2.4rem; font-weight: 900; line-height: 1.12; max-width: 480px; }
.auth-art p { color: rgba(255,255,255,.88); max-width: 430px; margin-top: 16px; font-size: 1.05rem; font-weight: 600; }
.auth-art ul { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 14px; }
.auth-art li { display: flex; gap: 12px; align-items: center; font-weight: 700; }
.auth-art li span { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.auth-art .floaty { position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth-form { display: grid; place-items: center; padding: 32px 18px; }
.auth-box { width: 100%; max-width: 410px; animation: rise .5s var(--ease) both; }
.auth-box .logo { justify-content: center; padding: 0 0 24px; font-size: 1.25rem; }
.auth-box h1 { font-size: 1.75rem; text-align: center; }
.auth-box .sub { text-align: center; color: var(--muted); margin: 8px 0 24px; font-weight: 600; }
.auth-art > h2, .auth-art > p, .auth-art > ul { position: relative; width: 100%; max-width: 470px; margin-left: auto; margin-right: auto; }
.auth-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.auth-feats div { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: .8rem; font-weight: 700; color: var(--text-2); }
.auth-feats svg.i { width: 17px; height: 17px; color: var(--primary); }
@media (min-width: 980px) { .auth { grid-template-columns: 1.05fr 1fr; } .auth-art { display: flex; flex-direction: column; justify-content: center; } .auth-feats { display: none; } }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary-soft-ink); font-size: .9rem; font-weight: 700; margin-bottom: 18px; }
.choice-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice .ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 14px; }
.choice h2 { margin-bottom: 6px; }
.choice p { color: var(--muted); margin-bottom: 18px; font-weight: 600; }

/* ============================================================ janelas */
dialog.dlg {
  border: 1px solid var(--border); border-radius: 24px; background: var(--surface); color: var(--text);
  padding: 24px; width: min(94vw, 450px); box-shadow: var(--shadow-lg);
}
dialog.dlg[open] { animation: pop-in .32s var(--spring) both; }
dialog.dlg::backdrop { background: rgba(40, 22, 16, .42); backdrop-filter: blur(3px); animation: fade .25s ease both; }
dialog.wide { width: min(96vw, 680px); padding: 0; max-height: min(92vh, 860px); }
.dlg-inner { display: flex; flex-direction: column; max-height: min(92vh, 860px); }
.dlg-head { padding: 20px 20px 12px; border-bottom: 1px solid var(--border); }
.dlg-head .row { margin-bottom: 12px; }
.dlg-body { overflow-y: auto; padding: 10px 12px 16px; min-height: 240px; }
.dlg-body.pad { padding: 20px; }
.dlg-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.search-box { position: relative; }
.search-box svg.i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 40px; }
.dlg .search-box input { height: 50px; font-size: 1.02rem; }
.result { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px; border: 0; border-radius: var(--radius); background: none; color: var(--text); cursor: pointer; text-align: left; transition: background .15s, transform .15s var(--ease); animation: rise .3s var(--ease) both; }
.result:hover, .result:focus-visible { background: var(--surface-2); outline: none; transform: translateX(3px); }
.result .book-title { font-size: .96rem; }
.picker-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; font-weight: 700; padding: 10px 8px; }
.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--primary); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.picked { padding: 14px 8px 4px; animation: rise .3s var(--ease) both; }
.sim-tile { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--text); transition: transform .2s var(--spring); }
.sim-tile:hover { transform: translateY(-4px); }
.sim-tile .cover { width: 104px; height: 156px; }
.sim-tile .book-title { font-size: .8rem; margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

dialog.draw { width: min(94vw, 420px); text-align: center; padding: 30px 22px; }
.draw-stage { display: grid; place-items: center; height: 284px; }
.draw-stage.win .cover { animation: pop-in .6s var(--spring) both; box-shadow: 0 0 0 5px #F6C453, 0 24px 50px -12px rgba(0,0,0,.5); }
.draw-label { font-size: .8rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.draw-result { min-height: 90px; margin-top: 12px; }

.reveal {
  width: 100%; border: 0; cursor: pointer; text-align: center; color: #fff; padding: 28px 18px; border-radius: var(--radius-lg);
  background: radial-gradient(120% 120% at 0% 0%, #F08CA9, #C04A6E 55%, #7A2747); transition: transform .2s var(--spring);
}
.reveal:active { transform: scale(.98); }
.reveal .name { display: block; font-weight: 900; font-size: 1.8rem; margin: 6px 0 4px; transition: filter .35s var(--ease); }
.reveal.hidden .name { filter: blur(11px); }
.reveal small { opacity: .85; font-weight: 700; }

/* ============================================================ avisos */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 100; display: grid; gap: 8px; width: min(92vw, 420px); }
@media (min-width: 980px) { #toasts { bottom: 28px; left: auto; right: 28px; transform: none; } }
.toast { display: flex; gap: 10px; align-items: center; background: var(--text); color: var(--bg); padding: 13px 16px; border-radius: 16px; box-shadow: var(--shadow-lg); font-weight: 700; font-size: .92rem; animation: pop-in .3s var(--spring) both; }
.toast.out { animation: fade .25s ease reverse both; }
.toast.error { background: var(--danger); color: #fff; }
.code { font: 800 1.55rem/1 ui-monospace, 'SF Mono', Consolas, monospace; letter-spacing: .18em; padding: 18px; text-align: center; background: var(--surface-2); border: 2px dashed var(--border-strong); border-radius: var(--radius); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); }

/* ============================================================ páginas legais */
.legal { max-width: 720px; margin: 0 auto; padding: 36px 20px 80px; }
.legal .logo { padding: 0 0 28px; }
.legal h1 { margin-bottom: 6px; }
.legal h2 { margin: 30px 0 10px; font-size: 1.12rem; }
.legal p, .legal li { color: var(--text-2); font-weight: 500; line-height: 1.7; }
.legal ul { padding-left: 22px; margin: 8px 0; }
.legal li + li { margin-top: 6px; }
.legal-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin-top: 22px; font-size: .84rem; }
.legal-links a { color: var(--muted); font-weight: 700; }
.legal-links a:hover { color: var(--primary); }
.code-input { text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.code-input::placeholder { text-transform: none; letter-spacing: normal; font-weight: 500; }
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-row.fill > .btn { flex: 1 1 0; min-width: 150px; }
.dlg-foot.actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.dlg-foot.actions .btn { padding: 0 10px; }
@media (min-width: 600px) { .dlg-foot.actions { display: flex; justify-content: flex-end; } .dlg-foot.actions .btn { padding: 0 18px; } }
.dlg-foot.split { justify-content: space-between; flex-wrap: nowrap; }
.seg-grid { display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible; }
@media (max-width: 520px) { .seg-grid { grid-template-columns: 1fr 1fr; } .hide-sm { display: none; } }
