/* Biblioteca — CSS puro, segue o tema claro/escuro do sistema. */

:root {
  color-scheme: light dark;
  --brand: #8e1b1b;
  --tint: #b3261e;
  --bg: #ffffff;            /* lista simples: texto direto sobre o fundo */
  --surface: #ffffff;       /* células, folhas */
  --paper: #ffffff;         /* página do leitor */
  --text-raw: #000000;
  /* Intensidade do texto (Aparência): mistura a cor do texto com o fundo; padrão 88%. */
  --ink: 88%;
  --text: color-mix(in srgb, var(--text-raw) var(--ink), var(--bg));
  --text-2: rgba(60, 60, 67, .62);
  --text-3: rgba(60, 60, 67, .32);
  --sep: rgba(60, 60, 67, .2);
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --bar-bg: rgba(249, 249, 249, .82);
  --done: #248a3d;
  --press: rgba(0, 0, 0, .06);
  --shadow: 0 10px 40px rgba(0, 0, 0, .18);
  --font-ui: -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Segoe UI", "Noto Sans", sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", Charter, "Noto Serif", Georgia, "Times New Roman", serif;
  --font-sans: var(--font-ui);
  --reader-font: var(--font-serif);
  --reader-scale: 1;
  --bar-h: max(44px, 2.75rem);
  --gutter: 16px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.32, .72, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --tint: #ff6b5e;
    --bg: #000000;
    --surface: #1c1c1e;
    --paper: #000000;
    --text-raw: #ffffff;
    --text-2: rgba(235, 235, 245, .6);
    --text-3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .6);
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .36);
    --bar-bg: rgba(22, 22, 24, .82);
    --done: #30d158;
    --press: rgba(255, 255, 255, .08);
    --shadow: 0 10px 40px rgba(0, 0, 0, .6);
  }
}

/* Android: Material 3 — cantos maiores, barra de título alinhada à esquerda. */
.android {
  --bar-h: max(64px, 4rem);
  --bg: #ffffff;
  --surface: #ffffff;
  --paper: #ffffff;
  --bar-bg: #ffffff;
  --fill: #f1f1f1;
  --fill-2: #e6e6e6;
}
@media (prefers-color-scheme: dark) {
  .android {
    --bg: #000000;
    --surface: #1c1c1c;
    --paper: #000000;
    --bar-bg: #000000;
    --fill: #1e1e1e;
    --fill-2: #2c2c2c;
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* Sem text-size-adjust fora do iOS: no Chrome do Android ele desliga a escala de fonte do sistema. */
html {
  font-family: var(--font-ui);
  font-size: 100%;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
/* iOS: respeita o tamanho de texto escolhido nos Ajustes (Dynamic Type). */
html.ios { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@supports (font: -apple-system-body) {
  html.ios { font: -apple-system-body; font-family: var(--font-ui); }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  overscroll-behavior-x: none;
  -webkit-font-smoothing: antialiased;
}
body.reading { background: var(--paper); }

[hidden] { display: none !important; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 24px; height: 24px; flex: none; display: block; }
.ico.sm { width: 1.0625rem; height: 1.0625rem; }

/* ---------- Splash ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--brand);
  color: #fdf3e7;
  transition: opacity .35s ease-out, visibility 0s linear .35s;
}
.splash-logo {
  width: 112px;
  height: 112px;
  background: url(icons/logo.svg) center / contain no-repeat;
  animation: splash-in .6s var(--ease) both;
}
.splash-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  letter-spacing: .02em;
  animation: splash-in .6s .08s var(--ease) both;
}
.splash.out { opacity: 0; visibility: hidden; pointer-events: none; }
.no-splash .splash { display: none; }
@keyframes splash-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ---------- Barras ---------- */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: var(--sat) var(--sar) 0 var(--sal);
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 .5px 0 var(--sep);
  transition: transform .3s var(--ease), box-shadow .2s, background-color .2s;
  -webkit-user-select: none;
  user-select: none;
}
.bar-row {
  height: var(--bar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 8px;
}
.bar-side { display: flex; align-items: center; min-width: 0; }
.bar-side.end { justify-content: flex-end; }
.bar-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
  text-align: center;
}
.bar-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 44px;
  height: 44px;
  justify-content: center;
  color: var(--tint);
  border-radius: 22px;
}
.bar-btn:active { opacity: .45; }
.back { justify-content: flex-start; padding-right: 8px; }
.back-label { font-size: 1.0625rem; }
.back-android { display: none; }

/* Lista: título pequeno desde o início; a barra ganha fundo quando a lista rola por baixo dela. */
#library-bar { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
#library-bar.scrolled { background: var(--bar-bg); box-shadow: 0 .5px 0 var(--sep); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }

.android .bar { box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.android .bar-row { grid-template-columns: auto 1fr auto; padding: 0 4px; }
.android .bar-title { text-align: left; font-size: 1.375rem; font-weight: 400; max-width: none; padding-left: 4px; }
.android .bar-btn { color: var(--text); width: 48px; height: 48px; border-radius: 24px; }
.android .bar-btn:active { opacity: 1; background: var(--fill-2); }
.android .back-ios, .android .back-label { display: none; }
.android .back-android { display: block; }
.android .back { justify-content: center; padding: 0; }
.android #library-bar.scrolled { background: var(--fill); }
.android #reader-bar { background: var(--bar-bg); }

/* ---------- Biblioteca ---------- */
#library { padding-bottom: calc(24px + var(--sab)); }
.library-head {
  padding: calc(var(--sat) + var(--bar-h) + 4px) calc(var(--gutter) + var(--sar)) 8px calc(var(--gutter) + var(--sal));
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  min-height: max(36px, 2.25rem);
  border-radius: 10px;
  background: var(--fill);
  color: var(--text-2);
}
.search > .ico { position: absolute; left: 8px; pointer-events: none; }
.search input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.0625rem;
  padding: .4em calc(1.125rem + 16px) .4em calc(1.0625rem + 14px);
  line-height: 1.25;
  -webkit-appearance: none;
  appearance: none;
  border-radius: inherit;
}
.search input::placeholder { color: var(--text-2); }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-clear { position: absolute; right: 4px; width: calc(1.125rem + 12px); height: calc(1.125rem + 12px); display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.search-clear .ico { width: 1.125rem; height: 1.125rem; }
.android .search { min-height: max(56px, 3.5rem); border-radius: 28px; background: var(--fill-2); }
.android .search > .ico { left: 18px; width: 1.375rem; height: 1.375rem; }
.android .search input { padding-left: calc(1.375rem + 30px); font-size: 1rem; }
.android .search-clear { right: 10px; }

.list {
  list-style: none;
  margin: 8px var(--sar) 0 var(--sal);
  padding: 0;
}
.list:empty { display: none; }
.list-header.first { margin-top: 12px; }
.list-header {
  margin: 24px calc(var(--gutter) + var(--sar)) 0 calc(var(--gutter) + var(--sal));
  font-size: .8125rem;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--text-2);
  letter-spacing: .02em;
}
.android .list-header { text-transform: none; font-size: .875rem; font-weight: 500; color: var(--tint); margin-left: calc(var(--gutter) + var(--sal)); }

.book {
  position: relative;
  display: flex;
  align-items: center;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.book + .book::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: var(--gutter);
  border-top: .5px solid var(--sep);
}
.android .book + .book::before { display: none; }
.book-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 10px var(--gutter);
  text-align: left;
  transition: background-color .15s;
}
.book.pressed, .book-open:active { background: var(--press); }
.android .book-open { padding-top: 12px; padding-bottom: 12px; }


.book-text { flex: 1; min-width: 0; padding-right: 4px; }
.book-title {
  display: block;
  font-size: 1.0625rem;
  line-height: 1.25;
  font-weight: 500;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.meter {
  height: 3px;
  margin: 6px 0 5px;
  border-radius: 2px;
  background: var(--fill-2);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--tint);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform .3s var(--ease);
}
.book-meta { display: flex; gap: 8px; font-size: .8125rem; color: var(--text-2); }
.book-meta .author { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-meta .pct { flex: none; font-variant-numeric: tabular-nums; }

.book.done .book-title { color: var(--text-2); font-weight: 400; }
.book.done .meter > span { background: var(--done); }
.book.done .pct { color: var(--done); display: flex; align-items: center; gap: 2px; }
.book.done .pct .ico { width: 13px; height: 13px; }

.book-fav { flex: none; width: 40px; align-self: stretch; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.book-fav .ico { width: 1.375rem; height: 1.375rem; }
.book-fav[aria-pressed="true"] { color: #e8a838; }
.book-fav:active .ico { transform: scale(.85); }
.book-more { flex: none; width: 44px; align-self: stretch; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.book-more:active { color: var(--text-2); }

mark { background: none; color: var(--tint); font-weight: 600; }

.empty { margin: 48px 32px; text-align: center; color: var(--text-2); }
.footnote { margin: 28px calc(var(--gutter) * 2); font-size: .75rem; color: var(--text-3); text-align: center; line-height: 1.5; }

/* ---------- Leitor ---------- */
#reader-bar .bar-row { grid-template-columns: auto minmax(0, 1fr) auto; }
#reader-bar .bar-title { max-width: none; padding: 0 4px; }
#reader-bar.hide { transform: translateY(-100%); box-shadow: none; }
#reader-title { font-size: .9375rem; font-weight: 600; }
.android #reader-title { font-size: 1.125rem; }
#btn-mark[aria-pressed="true"] { color: var(--tint); }

.page {
  padding: calc(var(--sat) + var(--bar-h) + 12px) calc(var(--gutter) + 6px + var(--sar)) calc(var(--sab) + 72px) calc(var(--gutter) + 6px + var(--sal));
  background: var(--paper);
  min-height: 100vh;
  min-height: 100dvh;
}

.chapter {
  max-width: 36em;
  margin: 0 auto;
  font-family: var(--reader-font);
  font-size: calc(1.1875rem * var(--reader-scale));
  line-height: 1.6;
  color: var(--text);
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-wrap: pretty;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}
.chapter.loading { min-height: 60vh; }
.chapter > :first-child { margin-top: .4em; }
.chapter p { margin: 0 0 .9em; }
.chapter h1, .chapter h2, .chapter h3, .chapter h4, .chapter h5, .chapter h6 {
  font-family: var(--reader-font);
  line-height: 1.25;
  margin: 1.6em 0 .7em;
  text-wrap: balance;
  font-weight: 600;
}
.chapter > h2:first-child { font-size: 1.55em; margin: .3em 0 1.2em; font-weight: 700; }
.chapter h2 { font-size: 1.35em; }
.chapter h3 { font-size: 1.2em; }
.chapter h4, .chapter h5, .chapter h6 { font-size: 1.05em; }
.chapter a { color: var(--tint); text-decoration: none; }
.chapter sup { font-size: .65em; line-height: 0; }
.chapter sup a { padding: 0 2px; }
.chapter blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid var(--sep); color: var(--text-2); }
.chapter hr { border: 0; text-align: center; margin: 1.6em 0; }
.chapter hr::after { content: "* * *"; letter-spacing: .6em; color: var(--text-3); }
.chapter img { max-width: 100%; height: auto; }
.chapter table { border-collapse: collapse; font-size: .82em; line-height: 1.35; margin: 1em 0; display: block; overflow-x: auto; max-width: 100%; }
.chapter td, .chapter th { border: .5px solid var(--sep); padding: .3em .5em; vertical-align: top; }
.chapter .note { font-size: .82em; line-height: 1.45; color: var(--text-2); }
.chapter .info { font-family: var(--font-ui); font-size: .78em; line-height: 1.45; color: var(--text-2); }
.chapter .note + .note { margin-top: -.3em; }
.chapter ::selection { background: color-mix(in srgb, var(--tint) 30%, transparent); }

/* Marcador: fita na margem direita do parágrafo marcado. */
.chapter .bookmarked { position: relative; }
.chapter .bookmarked::after {
  content: "";
  position: absolute;
  top: .15em;
  right: calc(-1 * (var(--gutter) + 4px));
  width: 12px;
  height: 20px;
  background: var(--tint);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}
.chapter .flash { animation: flash 1.6s ease-out; border-radius: 4px; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--tint) 18%, transparent); } }

.chapter-nav {
  max-width: 36em;
  margin: 2.5em auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.nav-btn {
  flex: 1 1 140px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 14px;
  border-radius: 12px;
  background: var(--fill);
  color: var(--tint);
  font-size: .9375rem;
  font-weight: 500;
  text-align: left;
}
.nav-btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-btn.next { text-align: right; }
.nav-btn.finish { flex-basis: 100%; justify-content: center; background: var(--tint); color: #fff; }
.nav-btn.finish span { flex: none; }
.nav-btn:active { opacity: .6; }
.android .nav-btn { border-radius: 24px; }

.reader-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 0 calc(var(--gutter) + var(--sar)) calc(var(--sab) + 6px) calc(var(--gutter) + var(--sal));
  background: linear-gradient(to bottom, transparent, var(--paper) 40%);
  pointer-events: none;
  transition: transform .3s var(--ease), opacity .3s;
  -webkit-user-select: none;
  user-select: none;
}
.reader-foot .meter { margin: 10px 0 4px; height: 2px; }
.foot-row { display: flex; justify-content: space-between; gap: 12px; font-size: .75rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.foot-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-foot.hide { transform: translateY(100%); opacity: 0; }

/* ---------- Folhas (dialog) ---------- */
.sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 560px;
  max-height: none;
  margin: 0 auto;
  padding: 0 calc(8px + var(--sar)) calc(8px + var(--sab)) calc(8px + var(--sal));
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
.sheet[open] { animation: sheet-up .35s var(--ease); }
.sheet.closing { animation: sheet-down .22s ease-in forwards; }
.sheet::backdrop { background: rgba(0, 0, 0, .4); animation: fade-in .3s ease-out; }
.sheet.closing::backdrop { animation: fade-out .22s ease-in forwards; }
/* Aparência: sem escurecer a página, para ver o texto mudar enquanto se ajusta. */
#sheet-text::backdrop { background: transparent; }
#sheet-text .sheet-panel { box-shadow: var(--shadow); }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.sheet-group {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 8px;
  -webkit-user-select: none;
  user-select: none;
}
.sheet-caption { padding: 14px 16px 12px; text-align: center; font-size: .8125rem; color: var(--text-2); border-bottom: .5px solid var(--sep); }
.sheet-caption strong { display: block; color: var(--text); font-size: .875rem; font-weight: 600; margin-bottom: 2px; }
.sheet-btn {
  display: block;
  width: 100%;
  min-height: 57px;
  padding: 10px 16px;
  font-size: 1.25rem;
  color: var(--tint);
  text-align: center;
}
.sheet-btn + .sheet-btn { border-top: .5px solid var(--sep); }
.sheet-btn:active { background: var(--press); }
.sheet-btn.danger { color: #ff3b30; }
.cancel .sheet-btn { font-weight: 600; }

.sheet-panel {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sheet.tall .sheet-panel { max-height: calc(100dvh - var(--sat) - 48px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: .5px solid var(--sep); -webkit-user-select: none; user-select: none; }
.sheet-head h2 { margin: 0; font-size: 1.0625rem; font-weight: 600; }
.sheet-done { color: var(--tint); font-weight: 600; font-size: 1.0625rem; padding: 0; min-height: 44px; margin-left: 16px; }

/* Android: folha inferior Material, presa à borda. */
.android .sheet { padding: 0; max-width: 640px; }
.android .sheet-group, .android .sheet-panel { border-radius: 28px 28px 0 0; margin: 0; padding-bottom: var(--sab); }
.android .sheet-group.cancel { display: none; }
.android .sheet-group::before, .android .sheet-panel::before { content: ""; display: block; width: 32px; height: 4px; border-radius: 2px; background: var(--text-3); margin: 16px auto 4px; }
.android .sheet-caption { text-align: left; border: 0; padding: 12px 24px; }
.android .sheet-btn { text-align: left; font-size: 1rem; min-height: 56px; padding: 10px 24px; color: var(--text); }
.android .sheet-btn + .sheet-btn { border: 0; }
.android .sheet-btn.danger { color: #b3261e; }
.android .sheet-head { border: 0; padding: 4px 24px 8px; }
.android .sheet-head h2 { font-size: 1.375rem; font-weight: 400; }

.toc { list-style: none; margin: 0; padding: 0 0 calc(var(--sab) + 8px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.toc button {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 12px 16px;
  text-align: left;
  font-size: 1rem;
  line-height: 1.3;
  border-bottom: .5px solid var(--sep);
}
.toc button:active { background: var(--press); }
.toc .n { flex: none; min-width: 1.8em; color: var(--text-3); font-variant-numeric: tabular-nums; font-size: .875rem; }
.toc .t { flex: 1; min-width: 0; }
.toc .current { color: var(--tint); font-weight: 600; }
.toc .current .n { color: var(--tint); }
.android .toc button { border: 0; padding: 14px 24px; }
.toc-mark { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--tint); font-size: 1rem; text-align: left; border-bottom: .5px solid var(--sep); }
.toc-mark:active { background: var(--press); }
.android .toc-mark { padding: 12px 24px; border: 0; }

.setting { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; }
.step { min-width: 88px; padding: 0 12px; min-height: 44px; border-radius: 10px; background: var(--fill); color: var(--text); font-family: var(--font-serif); display: flex; align-items: center; justify-content: center; }
.step:active { background: var(--fill-2); }
.step:disabled { opacity: .35; }
.a-sm { font-size: .9375rem; }
.a-lg { font-size: 1.5625rem; }
#size-value { font-variant-numeric: tabular-nums; color: var(--text-2); }
.segmented { display: flex; margin: 0 16px 16px; padding: 2px; border-radius: 9px; background: var(--fill); }
.segmented button { flex: 1; min-height: max(34px, 2.125rem); padding: 4px 8px; border-radius: 7px; font-size: .9375rem; }
.segmented button[aria-checked="true"] { background: var(--surface); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 600; }
@media (prefers-color-scheme: dark) { .segmented button[aria-checked="true"] { background: #636366; } }
.f-serif { font-family: var(--font-serif); }
.ink { display: flex; align-items: center; gap: 12px; padding: 0 16px 16px; }
.ink label { flex: none; font-size: .9375rem; }
.ink input { flex: 1; min-width: 0; accent-color: var(--tint); height: 32px; }
.ink output { flex: none; min-width: 3em; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; font-size: .9375rem; }
.android .ink { padding: 0 24px 24px; }
.android .step { border-radius: 22px; }
.android .segmented { border-radius: 20px; padding: 0; border: 1px solid var(--text-3); background: transparent; margin: 0 24px 24px; }
.android .segmented button { min-height: max(40px, 2.5rem); border-radius: 0; }
.android .segmented button[aria-checked="true"] { background: var(--fill-2); box-shadow: none; }
.android .setting { padding: 12px 24px; }

/* ---------- Aviso ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sab) + 56px);
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 20px;
  background: rgba(40, 40, 42, .94);
  color: #fff;
  font-size: .9375rem;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s var(--ease), opacity .3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.android .toast { border-radius: 4px; background: #322f35; }

@media (min-width: 700px) {
  .list, .library-head { max-width: 720px; margin-left: auto; margin-right: auto; }
  .library-head { padding-left: var(--gutter); padding-right: var(--gutter); }
  .list-header { max-width: 720px; margin-left: auto; margin-right: auto; padding-left: var(--gutter); }
}

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

.load-error { text-align: center; padding-top: 20vh; font-family: var(--font-ui); }
.load-error h2 { font-family: var(--font-ui); }
.load-error p { color: var(--text-2); }
.load-error .nav-btn { display: inline-flex; flex: none; margin-top: 8px; }
