/* Pine Daily: pensado para o Safari do iPhone.
   Base nativa do iOS (fonte do sistema, listas agrupadas, toques de 44pt);
   o único elemento chamativo é a semana desenhada como batimento. */

:root {
  --bg: #f2f1f6;
  --surface: #ffffff;
  --surface-2: #e9e8ef;
  --ink: #17161c;
  --ink-2: #6b6975;
  --ink-3: #a5a3ad;
  --hairline: rgba(60, 60, 67, 0.16);
  --accent: #d6194f;        /* cereja: cor da área Treino */
  --accent-ink: #ffffff;
  --accent-wash: #fbe3ea;
  --treino: #d6194f;
  --peso: #5b46d6;          /* violeta: cor da área Peso */
  --peso-wash: #ebe7fc;
  --lembrete: #c25400;      /* laranja: cor da área Lembretes */
  --lembrete-wash: #fdebd9;
  --check: #1f8a4c;         /* verde: cor da área Checklist */
  --check-wash: #dcf3e5;
  --filmes: #8f6200;        /* dourado: cor da área Filmes */
  --filmes-wash: #fbf0d3;
  --danger: #e0352b;
  --bar: rgba(242, 241, 246, 0.82);

  --round: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --r-tile: 26px;
  --r-group: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --ink: #f4f3f8;
    --ink-2: #9a98a3;
    --ink-3: #5d5b64;
    --hairline: rgba(84, 84, 88, 0.6);
    --accent: #ff4775;
    --accent-ink: #ffffff;
    --accent-wash: #3a1420;
  --treino: #ff4775;
  --peso: #9b8cff;
  --peso-wash: #241d45;
  --lembrete: #ff9f0a;
  --lembrete-wash: #3b2507;
  --check: #30d158;
  --check-wash: #10331d;
  --filmes: #f2b632;
  --filmes-wash: #3a2b08;
    --danger: #ff5a4f;
    --bar: rgba(0, 0, 0, 0.72);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --ink: #f4f3f8;
  --ink-2: #9a98a3;
  --ink-3: #5d5b64;
  --hairline: rgba(84, 84, 88, 0.6);
  --accent: #ff4775;
  --accent-ink: #ffffff;
  --accent-wash: #3a1420;
  --treino: #ff4775;
  --peso: #9b8cff;
  --peso-wash: #241d45;
  --lembrete: #ff9f0a;
  --lembrete-wash: #3b2507;
  --check: #30d158;
  --check-wash: #10331d;
  --filmes: #f2b632;
  --filmes-wash: #3a2b08;
  --danger: #ff5a4f;
  --bar: rgba(0, 0, 0, 0.72);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.35 var(--text);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(env(safe-area-inset-bottom) + 96px); /* espaço para a barra do Safari */
}
button, input, textarea, label.action { font: inherit; color: inherit; touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
/* o anel de foco só aparece para quem usa teclado; no toque do iPhone ele não aparece */
html:not(.kbd) :focus-visible { outline: none; }
main { padding: 0 16px; max-width: 560px; margin: 0 auto; }
html.demo { scrollbar-width: none; } /* a prévia imita o iPhone, que não mostra barra de rolagem */

/* entrada ao trocar de tela (respeita "reduzir movimento") */
#root.enter { animation: enter .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

/* ---------- início ---------- */
.home-head { padding: 2px 20px 6px; max-width: 560px; margin: 0 auto; }
.home-head p { margin: 0; color: var(--ink-2); font-size: 15px; font-weight: 500; }
.home-head h1 { margin: 2px 0 0; font: 700 34px/1.12 var(--round); letter-spacing: -0.02em; }

.tiles { display: grid; gap: 14px; margin-top: 18px; }
.tile {
  appearance: none; border: 0; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border-radius: var(--r-tile);
  padding: 18px 18px 16px; display: flex; flex-direction: column;
  transition: transform .18s ease, background-color .18s;
}
.tile:active { transform: scale(0.975); background: var(--surface-2); }
.tile-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.glyph {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center;
}
.glyph svg { width: 17px; height: 17px; fill: #fff; }
.tile-name { flex: 1; font-size: 17px; font-weight: 600; color: var(--accent); }
.chev { width: 9px; height: 15px; color: var(--ink-3); display: grid; }
.chev svg { width: 100%; height: 100%; }
.tile-status { margin: 0; font: 700 28px/1.1 var(--round); letter-spacing: -0.02em; }
.tile-status.done { color: var(--ink); }
.tile-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }

.pulse { width: 100%; height: auto; margin: 14px 0 2px; overflow: visible; }
.pulse path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pulse-past {
  stroke: var(--accent); stroke-width: 2.6;
  stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: draw 1.1s .15s cubic-bezier(.45, 0, .2, 1) both;
}
.pulse-future { stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 2 6; }
.pulse-now { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
@keyframes draw { from { stroke-dashoffset: 1; } }

.days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.days .on { color: var(--accent); }
.days .today { color: var(--ink); position: relative; }
.days .today::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 4px; height: 4px;
  margin-left: -2px; border-radius: 50%; background: var(--ink);
}
.tile-foot { margin-top: 16px; padding-top: 12px; border-top: 0.5px solid var(--hairline); color: var(--ink-2); font-size: 15px; }
.tile-foot b { color: var(--ink); font-family: var(--round); }

.more {
  margin: 14px 0 0; padding: 18px; border-radius: var(--r-tile);
  border: 1.5px dashed var(--hairline); color: var(--ink-2); font-size: 15px; text-align: center;
}

/* ---------- barra de navegação (estilo iOS) ---------- */
.navbar {
  position: sticky; top: 0; z-index: 10;
  height: calc(env(safe-area-inset-top) + 44px); padding: env(safe-area-inset-top) 8px 0;
  display: flex; align-items: center;
  background: transparent; border-bottom: 0.5px solid transparent;
  transition: background-color .2s, border-color .2s;
}
.navbar.scrolled {
  background: var(--bar); border-bottom-color: var(--hairline);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.back {
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--accent);
  display: flex; align-items: center; gap: 5px; height: 44px; padding: 0 8px; font-size: 17px;
}
.back svg { width: 12px; height: 20px; }
.back:active { opacity: .4; }
.nav-title {
  position: absolute; left: 50%; transform: translateX(-50%); font-weight: 600; font-size: 17px;
  opacity: 0; transition: opacity .2s;
}
.navbar.scrolled .nav-title { opacity: 1; }

.large { padding: 2px 20px 0; max-width: 560px; margin: 0 auto; }
.large h1 { margin: 0; font: 700 34px/1.12 var(--round); letter-spacing: -0.02em; }
.large p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }

/* ---------- grupos (listas do iOS) ---------- */
.group { background: var(--surface); border-radius: var(--r-group); }
.sec { margin: 30px 4px 8px; font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.sec-row { display: flex; justify-content: space-between; align-items: baseline; }
.link { appearance: none; border: 0; background: none; color: var(--accent); font-size: 17px; padding: 8px 4px; cursor: pointer; }
.group-foot { margin: 8px 16px 0; color: var(--ink-2); font-size: 13px; line-height: 1.4; }

.list .row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 6px 16px; position: relative; width: 100%;
}
.list .row + .row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--hairline);
}
.row-label { font-size: 17px; }
.row.action {
  appearance: none; border: 0; background: none; text-align: left; justify-content: flex-start;
  color: var(--accent); font-size: 17px; cursor: pointer;
}
.row.action:active { background: var(--surface-2); }
.list .row.action:first-child:active { border-radius: var(--r-group) var(--r-group) 0 0; }
.list .row.action:last-child:active { border-radius: 0 0 var(--r-group) var(--r-group); }
.row.action.danger { color: var(--danger); }
.row.paste { flex-direction: column; align-items: stretch; padding: 10px 16px 14px; }
textarea {
  width: 100%; font-size: 16px; border: 0; border-radius: 10px; padding: 10px 12px;
  background: var(--surface-2); resize: vertical;
}
.row.paste .pill { align-self: flex-end; margin-top: 10px; }

/* botões +/− */
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper output { min-width: 78px; text-align: center; color: var(--ink-2); font-size: 15px; font-variant-numeric: tabular-nums; }
.stepper output b { color: var(--ink); font: 600 19px var(--round); }
.stepper button {
  appearance: none; border: 0; cursor: pointer; width: 44px; height: 34px; border-radius: 9px;
  background: var(--surface-2); font-size: 22px; line-height: 1; color: var(--ink);
}
.stepper button:active { background: var(--hairline); }

/* controle segmentado */
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 2px; }
.segmented button {
  appearance: none; border: 0; background: none; cursor: pointer; border-radius: 7px;
  padding: 6px 12px; font-size: 14px; font-weight: 500; color: var(--ink);
}
.segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.14); font-weight: 600; }
:root[data-theme="dark"] .segmented button[aria-pressed="true"] { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented button[aria-pressed="true"] { background: #636366; } }

.pill {
  appearance: none; border: 0; cursor: pointer; border-radius: 999px; padding: 11px 20px;
  background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 600;
}
.pill:active { opacity: .75; }

/* ---------- mês ---------- */
.month { margin-top: 22px; padding: 14px 12px 4px; }
.month-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px; }
.month-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.month-head h2 span { color: var(--ink-2); font-weight: 500; }
.month-nav { display: flex; }
.month-nav button {
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--accent);
  width: 44px; height: 44px; display: grid; place-items: center;
}
.month-nav svg { width: 11px; height: 19px; }
.month-nav button:disabled { color: var(--ink-3); cursor: default; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; text-align: center; }
.dow { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 4px 0 6px; }
.cd {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 0;
  width: 40px; height: 40px; justify-self: center; border-radius: 50%;
  font: 500 17px var(--round); color: var(--ink); font-variant-numeric: tabular-nums;
  transition: transform .15s;
}
.cd:active:not(:disabled) { transform: scale(.88); }
.cd:disabled { color: var(--ink-3); cursor: default; }
.cd.today { color: var(--accent); font-weight: 700; }
.cd.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cd.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }

.month-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); margin: 10px -12px 0; padding: 12px 4px;
  border-top: 0.5px solid var(--hairline);
}
.month-stats div { display: flex; flex-direction: column; align-items: center; }
.month-stats dd { margin: 0; font: 700 20px var(--round); font-variant-numeric: tabular-nums; }
.month-stats dt { font-size: 12px; color: var(--ink-2); }

/* ---------- treinos ---------- */
.workout { background: var(--surface); border-radius: 20px; padding: 16px 16px 6px; margin-bottom: 12px; }
.workout header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.workout h3 { margin: 0; font-size: 17px; font-weight: 600; }
.workout header p { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; font-variant-numeric: tabular-nums; }
.dur { font: 700 30px/1 var(--round); letter-spacing: -0.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.dur small { font-size: 15px; font-weight: 600; margin: 0 1px; }
.workout.manual { padding-bottom: 6px; }
.check { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-wash); display: grid; place-items: center; }
.check svg { width: 16px; height: 16px; fill: var(--accent); }

.chart-wrap { position: relative; margin: 14px 0 0; }
.chart { width: 100%; height: 96px; display: block; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart .th { stroke: var(--ink-3); stroke-dasharray: 3 4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.th-label {
  position: absolute; right: 0; transform: translateY(-120%);
  font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--surface); padding: 0 0 0 4px;
}
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }

.wstats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 12px 0 0; padding-top: 12px; border-top: 0.5px solid var(--hairline); }
.wstats div { display: flex; flex-direction: column-reverse; }
.wstats dt { font-size: 13px; color: var(--ink-2); }
.wstats dd { margin: 0; font: 600 22px var(--round); font-variant-numeric: tabular-nums; }
.wstats dd small { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }

.del {
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--ink-2);
  font-size: 14px; padding: 12px 0 10px; min-height: 44px;
}
.del:active { color: var(--danger); }

.empty { padding: 22px 18px; text-align: center; color: var(--ink-2); font-size: 15px; }
.empty p { margin: 0; }
.empty .pill { margin-top: 14px; }

/* ---------- aviso (estilo notificação do iOS) ---------- */
#toast {
  position: fixed; z-index: 50; left: 50%; top: calc(env(safe-area-inset-top) + 10px);
  width: max-content; max-width: calc(100% - 32px);
  transform: translate(-50%, -140%); opacity: 0; pointer-events: none;
  background: var(--surface); color: var(--ink);
  padding: 12px 18px; border-radius: 22px; font-size: 15px; font-weight: 500; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.18), 0 0 0 0.5px var(--hairline);
  transition: transform .45s cubic-bezier(.2, 1.2, .3, 1), opacity .25s;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

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

/* ---------- engrenagem no Início ---------- */
.home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.gear {
  appearance: none; border: 0; cursor: pointer; flex: none;
  width: 40px; height: 40px; border-radius: 50%; margin-bottom: 2px;
  background: var(--surface); color: var(--ink-2); display: grid; place-items: center;
}
.gear svg { width: 22px; height: 22px; fill: currentColor; }
.gear:active { background: var(--surface-2); }

/* ---------- Ajustes > Aparência ---------- */
.appearance { display: grid; grid-template-columns: repeat(3, 1fr); padding: 18px 8px 14px; }
.appearance button {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 4px 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.t-label { font-size: 15px; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink-3); display: grid; place-items: center; }
.appearance [aria-checked="true"] .radio { background: var(--accent); border-color: var(--accent); }
.appearance [aria-checked="true"] .radio::after {
  content: ""; width: 10px; height: 6px; margin-top: -3px;
  border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg);
}
.appearance [aria-checked="true"] .thumb { box-shadow: 0 0 0 2.5px var(--accent); }

/* miniaturas: cores fixas, independentes do tema atual */
.thumb {
  width: 64px; height: 116px; border-radius: 12px; padding: 14px 6px 0;
  display: flex; flex-direction: column; gap: 5px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.3);
  transition: box-shadow .2s;
}
.thumb i { display: block; border-radius: 4px; }
.thumb .t-title { width: 60%; height: 6px; border-radius: 3px; margin-bottom: 2px; }
.thumb .t-card { height: 36px; padding: 6px 5px; display: flex; flex-direction: column; gap: 4px; }
.thumb .t-card.short { height: 18px; }
.thumb b { display: block; height: 4px; border-radius: 2px; width: 70%; }
.thumb b:first-child { background: #d6194f; width: 45%; }

.thumb-light { background: #f2f1f6; }
.thumb-light .t-title { background: #17161c; }
.thumb-light .t-card { background: #fff; }
.thumb-light b + b { background: #c9c7d1; }

.thumb-dark { background: #000; }
.thumb-dark .t-title { background: #f4f3f8; }
.thumb-dark .t-card { background: #1c1c1e; }
.thumb-dark b:first-child { background: #ff4775; }
.thumb-dark b + b { background: #48464f; }

/* automático: metade clara, metade escura */
.thumb-auto { background: linear-gradient(90deg, #f2f1f6 50%, #000 50%); }
.thumb-auto .t-title { background: linear-gradient(90deg, #17161c 50%, #f4f3f8 50%); width: 100%; }
.thumb-auto .t-card { background: linear-gradient(90deg, #fff 50%, #1c1c1e 50%); }
.thumb-auto b, .thumb-auto b:first-child { width: 100%; background: linear-gradient(90deg, #d6194f 50%, #ff4775 50%); }
.thumb-auto b + b { background: linear-gradient(90deg, #c9c7d1 50%, #48464f 50%); }

/* ---------- cor de cada área ---------- */
.area-peso, [data-area="peso"] { --accent: var(--peso); --accent-wash: var(--peso-wash); }

/* ---------- Peso ---------- */
.tile-status small, .wnow small, .month-stats dd small {
  font-size: 0.55em; font-weight: 600; color: var(--ink-2); margin-left: 3px; letter-spacing: 0;
}
.spark { width: 100%; height: auto; margin: 12px 0 0; overflow: visible; }
.spark polyline {
  fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; animation: draw 1.1s .15s cubic-bezier(.45, 0, .2, 1) both;
}
.spark circle { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }

.weight-hero { margin-top: 22px; padding: 18px 12px 4px; text-align: center; }
.wnow { margin: 0; font: 700 56px/1 var(--round); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.weight-hero .month-stats { margin-top: 16px; }

.chart-card { margin-top: 14px; padding: 12px 14px 12px; }
.segmented.wide { display: flex; margin-bottom: 14px; }
.segmented.wide button { flex: 1; }
.wchart { position: relative; margin-right: 34px; }
.wchart svg { width: 100%; height: 150px; display: block; overflow: visible; }
.wchart .ln { fill: none; stroke: var(--accent); stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.wchart .grid { stroke: var(--hairline); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ylabel {
  position: absolute; left: 100%; transform: translate(6px, -50%);
  font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.enddot {
  position: absolute; width: 11px; height: 11px; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--accent); box-shadow: 0 0 0 3px var(--surface);
}
.chart-card .axis { margin-right: 34px; }
.chart-empty { margin: 8px 4px 12px; color: var(--ink-2); font-size: 15px; text-align: center; }

.wrow { appearance: none; border: 0; background: none; cursor: pointer; text-align: left; }
.wrow:active { background: var(--surface-2); }
.wrow > span:first-child { display: flex; flex-direction: column; }
.wrow small { color: var(--ink-2); font-size: 13px; }
.wval { font: 600 18px var(--round); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.wval small { font-family: var(--text); font-weight: 500; }
.wval i { display: block; font: 500 13px var(--text); font-style: normal; color: var(--ink-2); }
.add-row { flex-wrap: wrap; }
.add-input { display: flex; align-items: center; gap: 6px; color: var(--ink-2); margin-left: auto; }
.add-input input {
  width: 92px; font: 600 18px var(--round); text-align: right; color: var(--ink);
  border: 0; border-radius: 9px; background: var(--surface-2); padding: 8px 10px;
}
.add-row .pill { padding: 9px 16px; }
.muted-row { margin: 0; color: var(--ink-2); font-size: 15px; }
.from-scale { color: var(--ink-2); font-size: 15px; }
.from-scale b { color: var(--ink); font: 600 19px var(--round); }

/* ---------- Treino: abas Feitos / Plano ---------- */
.segmented.tabs { margin-top: 18px; }
.segmented.tabs + .month { margin-top: 14px; }

/* faixa da semana */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
.pd {
  appearance: none; border: 0; cursor: pointer; border-radius: 14px; padding: 9px 0 8px;
  background: var(--surface); color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; transition: transform .15s;
}
.pd:active { transform: scale(.93); }
.pd i { width: 7px; height: 7px; border-radius: 50%; background: var(--hairline); }
.pd.has i { background: var(--accent); }
.pd.today span { color: var(--accent); }
.pd[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.pd[aria-selected="true"] span { color: var(--accent-ink); }
.pd[aria-selected="true"] i { background: var(--accent-ink); opacity: .9; }
.pd[aria-selected="true"]:not(.has) i { opacity: .35; }

.day-head { margin: 22px 4px 10px; }
.day-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.day-head h2 span {
  font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-wash);
  padding: 2px 8px; border-radius: 999px; vertical-align: 3px; margin-left: 4px;
}
.day-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }

/* exercícios do dia */
.prow { appearance: none; border: 0; background: none; cursor: pointer; text-align: left; }
.prow:active { background: var(--surface-2); }
.pname { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pname span { font-size: 17px; }
.pname small { font-size: 13px; color: var(--ink-2); }
.psum { color: var(--ink-2); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.pchev { width: 8px; height: 14px; color: var(--ink-3); display: grid; flex: none; transition: transform .2s; }
.pchev svg { width: 100%; height: 100%; }
.prow.open .pchev { transform: rotate(90deg); }
.prow.open .psum { color: var(--accent); font-weight: 600; }
.peditor { background: var(--surface-2); padding: 4px 0 2px; }
.list .peditor .row::before { left: 16px; }
.peditor .stepper button { background: var(--surface); }
.cue { margin: 6px 16px 4px; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.pactions { justify-content: flex-end; gap: 18px; min-height: 48px; margin-top: 6px; }
.link:disabled { color: var(--ink-3); cursor: default; }
.link.danger { color: var(--danger); }
.link.strong { font-weight: 600; }
.link.block { display: block; margin: 10px auto 0; font-size: 15px; }
.padd { font-weight: 500; }

/* ---------- tela que sobe de baixo (adicionar exercício) ---------- */
html.sheet-open, html.sheet-open body { overflow: hidden; }
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0);
  transition: background-color .3s;
}
.sheet-backdrop.show { background: rgba(0, 0, 0, 0.38); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(100% - 44px - env(safe-area-inset-top));
  max-width: 600px; margin: 0 auto;
  background: var(--bg); border-radius: 14px 14px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .38s cubic-bezier(.2, .9, .25, 1);
}
.sheet-backdrop.show .sheet { transform: translateY(0); }
.sheet-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--ink-3); opacity: .5; margin: 6px auto 0; flex: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px 4px 20px; flex: none; }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.sheet-search {
  margin: 6px 16px 0; flex: none; font-size: 17px; border: 0; border-radius: 10px;
  padding: 9px 12px; background: var(--surface-2); color: var(--ink); -webkit-appearance: none;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 10px; flex: none; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  appearance: none; border: 0; cursor: pointer; white-space: nowrap; flex: none;
  padding: 7px 14px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 500;
}
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.sheet-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px calc(env(safe-area-inset-bottom) + 96px); flex: 1; } /* acima da barra do Safari */
.sheet-list h3 { margin: 18px 4px 8px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.exrow { appearance: none; border: 0; background: none; cursor: pointer; text-align: left; align-items: center; }
.exrow:active { background: var(--surface-2); }
.exname { display: flex; flex-direction: column; gap: 2px; flex: 1; padding: 6px 0; }
.exname span { font-size: 17px; }
.exname small { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.exadd {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-wash); color: var(--accent); font-size: 20px; font-weight: 600; line-height: 1;
}
.exrow.added .exadd { background: var(--accent); color: var(--accent-ink); font-size: 16px; }
.sheet-empty { text-align: center; color: var(--ink-2); margin-top: 30px; }
html.demo .sheet-list { scrollbar-width: none; }

/* ---------- botão do menu e menu lateral ---------- */
.home-head { display: block; }
.menu-btn {
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--accent);
  width: 44px; height: 44px; display: grid; place-items: center; margin-left: 4px; border-radius: 12px;
}
.menu-btn svg { width: 22px; height: 16px; }
.menu-btn:active { opacity: .4; }

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, 0);
  transition: background-color .3s;
}
.drawer-backdrop.show { background: rgba(0, 0, 0, 0.38); }
.drawer {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(82%, 320px);
  background: var(--bg); padding: calc(env(safe-area-inset-top) + 18px) 12px calc(env(safe-area-inset-bottom) + 92px); /* acima da barra do Safari */
  display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: 8px 0 30px rgba(0, 0, 0, .18);
  transform: translateX(-102%); transition: transform .34s cubic-bezier(.2, .9, .25, 1);
}
.drawer-backdrop.show .drawer { transform: translateX(0); }
.drawer-title { margin: 8px 10px 18px; font: 700 28px/1.1 var(--round); letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.drawer-title .brand { width: 34px; height: 34px; border-radius: 9px; background: #7c3aed; display: grid; place-items: center; flex: none; }
.drawer-title .brand svg { width: 22px; height: 22px; fill: #fff; }
.drawer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.drawer-foot { margin-top: auto !important; padding-top: 12px !important; border-top: 0.5px solid var(--hairline) !important; }
.drawer button {
  appearance: none; border: 0; background: none; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px;
  font-size: 18px; font-weight: 500; color: var(--ink); text-align: left; min-height: 52px;
}
.drawer button:active { background: var(--surface-2); }
.drawer button[aria-current="page"] { background: var(--surface); font-weight: 600; }
.drawer .glyph { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.drawer .glyph svg { width: 18px; height: 18px; fill: #fff; }

/* ---------- Lembretes ---------- */
.area-lembretes, [data-area="lembretes"] { --accent: var(--lembrete); --accent-wash: var(--lembrete-wash); }
.navbar .nav-add {
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--accent);
  width: 44px; height: 44px; margin-left: auto; margin-right: 4px; display: grid; place-items: center; border-radius: 12px;
}
.nav-add svg { width: 20px; height: 20px; }
.nav-add:active { opacity: .4; }

.tile-status.late, .rem-hero .late dd, .rem-sec.late { color: var(--danger); }
.tile-rem { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.tile-rem li { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 16px; }
.tile-rem li > span { display: flex; flex-direction: column; min-width: 0; }
.tile-rem small { color: var(--ink-2); font-size: 13px; }
.tile-rem li.late small { color: var(--danger); }
.tile-rem b { font: 600 16px var(--round); font-variant-numeric: tabular-nums; white-space: nowrap; }

.rem-hero { margin: 22px 0 0; padding: 16px 8px; display: grid; grid-template-columns: 1.6fr 1fr; text-align: center; }
.rem-hero div { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rem-hero div + div { border-left: 0.5px solid var(--hairline); }
.rem-hero dd { margin: 0; font: 700 26px/1.15 var(--round); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rem-hero dt { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.rem-filter { margin: 14px 0 0; }
.rem-new { margin-top: 14px; }
.rem-new .row.action { gap: 10px; font-weight: 500; }
.rem-new svg { width: 17px; height: 17px; }
.rem-sec { margin-top: 24px; }
.rem-none { text-align: center; color: var(--ink-2); margin: 28px 0 8px; }
.group-foot.first { margin-top: 0; }
.group-foot b { font-weight: 600; color: var(--ink); }

.rrow { padding-left: 6px !important; gap: 4px !important; align-items: stretch !important; }
.list .rrow + .row::before, .list .row + .rrow::before { left: 52px; }
.rcheck {
  appearance: none; border: 0; background: none; cursor: pointer; flex: none;
  width: 46px; display: grid; place-items: center;
}
.rcheck span {
  width: 24px; height: 24px; border-radius: 50%; border: 1.6px solid var(--ink-3);
  display: grid; place-items: center; transition: background-color .2s, border-color .2s;
}
.rrow.late .rcheck span { border-color: var(--danger); }
.rrow.checked .rcheck span { background: var(--accent); border-color: var(--accent); }
.rrow.checked .rcheck span::after {
  content: ""; width: 6px; height: 11px; border: solid var(--accent-ink); border-width: 0 2.4px 2.4px 0;
  transform: translateY(-1px) rotate(45deg);
}
.rrow.checked .rtext { opacity: .45; transition: opacity .3s; }
.rbody {
  appearance: none; border: 0; background: none; cursor: pointer; text-align: left; flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0;
}
.rbody:active { opacity: .55; }
.rtext { display: flex; flex-direction: column; min-width: 0; }
.rtext > span { font-size: 17px; }
.rtext small { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.rrow.late .rtext small:first-of-type { color: var(--danger); }
.rtext .rnote { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ramt { font: 600 17px var(--round); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lrow .rtext > span { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.lrow .link { font-size: 15px; }

.rem-empty { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 22px; }
.rem-empty .glyph { width: 48px; height: 48px; border-radius: 14px; }
.rem-empty .glyph svg { width: 28px; height: 28px; }

/* formulário do lembrete */
.sheet-head.three h2 { font-size: 17px; font-weight: 600; }
.rem-sheet .segmented { margin: 10px 0 0; }
.rem-sheet .group { margin-top: 18px; }
.rem-sheet .group-foot { margin-bottom: 8px; }
.form .row { cursor: text; }
.form input[type="text"], .form input[type="date"], .form input[type="time"], .form select {
  font: inherit; font-size: 17px; border: 0; background: none; color: var(--ink); min-width: 0;
  -webkit-appearance: none; appearance: none;
}
.form input[name="title"] { flex: 1; padding: 8px 0; }
.form input[name="amount"] { text-align: right; flex: 1; font-family: var(--round); font-weight: 600; }
.form input[type="date"], .form input[type="time"], .form select {
  color: var(--accent); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
.form select { padding-right: 10px; text-align: right; }
.form ::placeholder { color: var(--ink-3); }
.form textarea { background: none; padding: 6px 0; min-height: 52px; }
.form .row.paste { padding-top: 6px; padding-bottom: 6px; }
.switch {
  -webkit-appearance: none; appearance: none; width: 51px; height: 31px; border-radius: 16px; flex: none;
  background: var(--surface-2); position: relative; cursor: pointer; transition: background-color .2s; margin: 0;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s;
}
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(20px); }
.list .row[hidden] { display: none; }
.form input[type="text"]:focus-visible, .form textarea:focus-visible { outline: none; }
.form .cur { margin-left: auto; color: var(--ink-2); font: 600 17px var(--round); }
.form .cur + input[name="amount"] { flex: 0 1 120px; }

/* ---------- app de iPhone (sem a barra flutuante do Safari) ---------- */
html.native body { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
html.native .sheet-list { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
html.native .drawer { padding-bottom: calc(env(safe-area-inset-bottom) + 12px); }
.caixa-url code { font: 13px/1.4 ui-monospace, Menlo, monospace; color: var(--ink-2); word-break: break-all; -webkit-user-select: all; user-select: all; padding: 6px 0; }

/* ---------- Checklist ---------- */
.area-checklist, [data-area="checklist"] { --accent: var(--check); --accent-wash: var(--check-wash); }
:root[data-theme="dark"] .area-checklist, :root[data-theme="dark"] [data-area="checklist"] { --accent-ink: #052e14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .area-checklist, :root:not([data-theme="light"]) [data-area="checklist"] { --accent-ink: #052e14; } }
.ck-bar { display: block; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.ck-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.tile .ck-bar + .tile-sub { margin-top: 10px; }

.ck-week { display: flex; align-items: center; gap: 2px; margin-top: 16px; }
.ck-week .week-strip { flex: 1; margin-top: 0; gap: 4px; }
.ck-nav { appearance: none; border: 0; background: none; color: var(--ink-3); width: 22px; height: 44px; display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.ck-nav svg { width: 9px; height: 15px; }
.ck-week .pd { gap: 2px; padding: 7px 0 8px; }
.ck-week .pd span { font-size: 11px; color: var(--ink-2); }
.ck-week .pd b { font: 600 17px var(--round); }
.ck-week .pd i { margin-top: 3px; }
.pd.part i { background: linear-gradient(90deg, var(--accent) 50%, var(--hairline) 50%); }
.ck-week .pd[aria-selected="true"] span { color: var(--accent-ink); opacity: .85; }
.ck-head { display: flex; justify-content: space-between; align-items: baseline; }
.ck-head .link { font-size: 15px; }
.ck-progress { padding: 14px 16px 16px; margin-bottom: 14px; }
.ck-progress div { font-size: 15px; color: var(--ink-2); display: flex; align-items: baseline; gap: 4px; }
.ck-progress b { font: 700 28px var(--round); color: var(--ink); }
.ck-progress div span { margin-left: auto; color: var(--accent); font-weight: 600; }
.ck-progress .ck-bar { margin-top: 10px; }
.ck-row.done .rtext > span { text-decoration: line-through; text-decoration-color: var(--ink-3); color: var(--ink-2); }
.ck-row.checked .rtext { opacity: 1; }
.ck-new { margin-top: 18px; }
.ck-empty .glyph { background: var(--accent); }
.chips.ck-suggest { flex-wrap: wrap; justify-content: center; padding: 6px 0 4px; overflow: visible; }
.chips.ck-suggest button { background: var(--surface-2); }
.chips.ck-suggest.in-sheet { justify-content: flex-start; padding: 12px 0 0; }
.chips.ck-suggest.in-sheet button { background: var(--surface); }
.ck-days { margin-top: 12px; padding: 14px 12px 6px; }
.ck-daypick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ck-daypick button {
  appearance: none; border: 0; cursor: pointer; aspect-ratio: 1; max-width: 44px; justify-self: center; width: 100%;
  border-radius: 50%; background: var(--surface-2); color: var(--ink); font: 600 16px var(--round);
}
.ck-daypick button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.ck-quick { display: flex; justify-content: center; gap: 14px; margin-top: 6px; }
.ck-quick .link { font-size: 15px; }
.ck-auto-label { font-size: 16px; line-height: 1.3; padding-right: 8px; }
.group[hidden] { display: none; }

/* ---------- Filmes e séries ---------- */
.area-filmes, [data-area="filmes"] { --accent: var(--filmes); --accent-wash: var(--filmes-wash); }
:root[data-theme="dark"] .area-filmes, :root[data-theme="dark"] [data-area="filmes"] { --accent-ink: #3a2400; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .area-filmes, :root:not([data-theme="light"]) [data-area="filmes"] { --accent-ink: #3a2400; } }
.fhero { margin-top: 18px; display: grid; gap: 14px; }
.fhero:empty { display: none; }
.ftile { display: flex; gap: 14px; align-items: center; }
.ftile img { width: 56px; height: 84px; object-fit: cover; border-radius: 8px; flex: none; }
.ftile > span { display: flex; flex-direction: column; min-width: 0; }
.ftile .tile-status { font-size: 24px; }

/* o ingresso: papel creme nos dois temas */
.fticket { --paper: #f4e9cf; --paper-ink: #2a1420; --paper-soft: #6b4a57; background: var(--paper); color: var(--paper-ink); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.fticket.reveal { animation: freveal .45s ease-out; }
@keyframes freveal { from { transform: translateY(10px) rotate(-.6deg); opacity: .2; } }
.fposter { background: #cdbb98; display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; }
.fposter span { font: 800 28px/1.05 var(--round); color: var(--paper-soft); padding: 18px; text-align: center; }
.fbody { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.fkind { margin: 0; font-size: 13px; font-weight: 600; color: var(--paper-soft); }
.ftitle { margin: 0; font: 800 32px/1.02 var(--round); letter-spacing: -.02em; overflow-wrap: anywhere; }
.fticket.loading .ftitle { color: var(--paper-soft); padding: 20px 0; }
.forig { margin: -4px 0 0; font-size: 14px; font-style: italic; color: var(--paper-soft); }
.ffacts { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ffacts li { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: rgba(42, 20, 32, .08); }
.ffacts .score { background: var(--paper-ink); color: var(--paper); font-weight: 600; }
.foverview { margin: 2px 0 0; font-size: 15px; line-height: 1.45; }
.fwhere { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; margin-top: 2px; }
.fwhere img { width: 26px; height: 26px; border-radius: 7px; }
.fwhere a { color: var(--paper-ink); margin-left: 4px; }
.fstub { border-top: 2px dashed rgba(42, 20, 32, .35); display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--paper-soft); }
.fstub b { font: 800 30px/1 var(--round); color: var(--paper-ink); }

.factions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pill.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.fnotice { padding: 18px; }
.fnotice h2 { margin: 0 0 8px; font: 700 24px/1.1 var(--round); }
.fnotice p { margin: 0 0 10px; font-size: 15px; }
.fnotice ol { margin: 0 0 14px; padding-left: 20px; font-size: 15px; }
.fnotice li { margin-bottom: 6px; }
.fnotice a { color: var(--accent); font-weight: 600; }
.fkey { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fkey input { flex: 1 1 100%; font-size: 16px; padding: 11px 12px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink); min-width: 0; }
.ferr { color: var(--danger); font-weight: 600; margin: 10px 0 0 !important; }
.fsmall { font-size: 13px !important; color: var(--ink-2); margin: 12px 0 0 !important; }

.fsequel { padding: 14px 16px; }
.fsequel h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--accent); }
.fsequel ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fsequel li { display: flex; align-items: center; gap: 10px; }
.fsequel li.done { opacity: .6; }
.fsequel img, .fsequel i { width: 34px; height: 51px; border-radius: 4px; object-fit: cover; background: var(--surface-2); flex: none; }
.fsequel li > span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 15px; }
.fsequel small { color: var(--ink-2); font-size: 12px; }
.fsequel em { font-style: normal; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.fsequel .link { font-size: 15px; white-space: nowrap; }

.fprovs { display: flex; flex-wrap: wrap; gap: 8px; }
.fprovs button { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 5px 13px 5px 6px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; }
.fprovs button:not(:has(img)) { padding-left: 13px; }
.fprovs img { width: 28px; height: 28px; border-radius: 8px; }
.fprovs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.fmore { font-size: 15px; margin-top: 4px; }
.fmisc { margin-top: 26px; }
.fcredit { margin-top: 14px; }
.fcredit a { color: inherit; }
.fwlist .row { justify-content: flex-start; padding-top: 8px; padding-bottom: 8px; }
.fwlist img, .fwlist i { width: 40px; height: 60px; border-radius: 5px; object-fit: cover; background: var(--surface-2); flex: none; }
.fwlist .rtext { flex: 1; }
.fwlist .link { font-size: 14px; flex: none; }

/* Filmes: tudo do sorteio cabe na tela, com os botões sempre à vista */
.large:has(+ main .fhero) { padding-bottom: 0; }
.fhero { margin-top: 10px; gap: 12px; }
.fposter {
  position: relative; aspect-ratio: auto; background: #2b0e1f;
  height: clamp(130px, calc(100vh - 495px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 400px);
  height: clamp(130px, calc(100dvh - 495px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 400px);
}
html.native .fposter { height: clamp(130px, calc(100dvh - 420px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 420px); }
.fposter:not(:has(img)) { background: #cdbb98; }
.fposter .bg { position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px); object-fit: cover; filter: blur(18px) brightness(.65); }
.fposter .fg { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; }
.fbody { padding: 12px 16px; gap: 7px; }
.ftitle { font-size: 27px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fticket.loading .ftitle { padding: 26px 0; }
.fticket .ffacts { flex-wrap: nowrap; overflow: hidden; margin: 0; }
.ffacts li { white-space: nowrap; }
.fseqchip { appearance: none; border: 0; cursor: pointer; align-self: flex-start; padding: 5px 11px; border-radius: 8px; background: #f2b632; color: #3a2400; font-size: 13px; font-weight: 700; }
.fbottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.fwhere { margin: 0; min-width: 0; flex-wrap: nowrap; }
.fwhere span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fdetails { appearance: none; cursor: pointer; flex: none; min-height: 36px; padding: 0 16px; border-radius: 999px; border: 1.5px solid #2a1420; background: transparent; color: #2a1420; font-size: 14px; font-weight: 700; }
.fdetails:active { background: rgba(42, 20, 32, .1); }
.fstub { padding: 5px 14px; }
.fstub b { font-size: 22px; }
.factions { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 84px); z-index: 5; }
html.native .factions { bottom: calc(env(safe-area-inset-bottom) + 10px); }
.factions .pill { min-height: 48px; padding: 0 12px; }
.factions .pill:disabled { opacity: .55; cursor: default; }
.pill.ghost { background: var(--bg); }

.fgenre-pick { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin-top: 12px; border-radius: var(--r-group); background: var(--surface); color: var(--accent); font-size: 17px; font-weight: 600; cursor: pointer; }
.fgenre-pick i { width: 8px; height: 14px; display: grid; transform: rotate(90deg); }
.fgenre-pick i svg { width: 100%; height: 100%; }
.fgenre-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; }

.fset-label { margin: 0 4px 8px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.fset-foot { margin-top: 10px; }
.fset-key { margin-top: 14px; }

.fdetail { padding-top: 6px; display: flex; flex-direction: column; gap: 10px; }
.fd-name { margin: 0; font: 800 28px/1.05 var(--round); letter-spacing: -.02em; }
.fd-orig { margin: -6px 0 0; font-size: 14px; font-style: italic; color: var(--ink-2); }
.fdetail .ffacts li { background: var(--surface); }
.fdetail .ffacts .score { background: var(--ink); color: var(--bg); }
.fdetail .ffacts { flex-wrap: wrap; }
.fd-text { margin: 0; font-size: 16px; line-height: 1.5; }
.fd-where { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 15px; font-weight: 600; }
.fd-where span { display: inline-flex; align-items: center; gap: 7px; }
.fd-where img { width: 28px; height: 28px; border-radius: 8px; }
.fd-link { display: block; text-align: center; text-decoration: none; }
.fdetail .fsequel { flex: none; }

/* linhas que arrastam para o lado (apagar) */
.swipe { position: relative; overflow: hidden; }
.swipe-del {
  position: absolute; inset: 0; border: 0; cursor: pointer; background: var(--danger); color: #fff;
  font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: flex-end; padding-right: 22px;
}
.swipe-row { position: relative; background: var(--surface) !important; touch-action: pan-y; }
.swipe.removing { transition: opacity .2s; opacity: .4; }
.list .swipe + .swipe > .swipe-row::before, .list .peditor + .swipe > .swipe-row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--hairline);
}
.list .swipe:first-child .swipe-row, .list .swipe:first-child .swipe-del { border-radius: var(--r-group) var(--r-group) 0 0; }

/* Filmes: abas e lista Quero ver */
.ftabs { margin-top: 12px; }
.large .ftabs { display: flex; }
.flistwrap { margin-top: 14px; display: grid; gap: 12px; }
.fsearch-open { appearance: none; border: 0; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 14px; color: var(--ink-3); font-size: 17px; text-align: left; }
.fsearch-open svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.flist { overflow: hidden; }
.flrow { appearance: none; border: 0; cursor: pointer; text-align: left; justify-content: flex-start !important; padding-top: 8px !important; padding-bottom: 8px !important; }
.flrow img, .flrow i { width: 38px; height: 57px; border-radius: 5px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; font-style: normal; color: var(--ink-3); font-weight: 700; }
.flrow .rtext { flex: 1; }
.flrow .fok { color: #1f8a4c; font-weight: 600; }
:root[data-theme="dark"] .flrow .fok { color: #30d158; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flrow .fok { color: #30d158; } }
.factions.single { grid-template-columns: 1fr; }
.fres { justify-content: flex-start !important; padding-right: 10px !important; }
.fres-open { appearance: none; border: 0; background: none; cursor: pointer; text-align: left; color: inherit; flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.fres-open:active { opacity: .55; }
.fres-open img, .fres-open i { width: 34px; height: 51px; border-radius: 4px; object-fit: cover; flex: none; background: var(--surface-2); }
.fres-open .rtext { flex: 1; min-width: 0; }
.fres-add { appearance: none; border: 0; cursor: pointer; width: 36px; height: 36px; flex: none; }
.fres-add[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-size: 16px; }
.fd-hint { text-align: center; margin-top: -4px !important; }
.fadd .sheet-search { margin: 4px 0 12px; width: 100%; }
.fadd-foot { text-align: center; margin-top: 14px; }
.fadd-foot p { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.fadd-foot .pill { width: 100%; }
.fd-top { display: flex; gap: 14px; align-items: flex-start; }
.fd-top img, .fd-top i { width: 92px; height: 138px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.fd-top > div { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.fd-where-link { align-self: flex-start; font-size: 16px; font-weight: 600; padding: 0; }
.fd-actions { display: grid; gap: 10px; margin-top: 6px; }
.fd-actions .pill { min-height: 48px; }
.fd-actions .link { font-size: 16px; }

/* Filmes: o ingresso inteiro abre os detalhes; aba Assistindo */
[data-open-ticket] { cursor: pointer; }
.ftabs button { font-size: 14px; padding-left: 4px; padding-right: 4px; white-space: nowrap; }
.fwrow { padding-right: 10px !important; }
.fwrow .fres-add { width: auto; min-width: 44px; padding: 0 10px; border-radius: 999px; font-size: 15px; font-weight: 700; }
.fw-bar { margin-top: 6px; height: 5px; }
.fprog .stepper output { min-width: 70px; }
.fprog-bar { gap: 12px; }
.fprog-bar .ck-bar { flex: 1; margin: 0; }
.factions.three { grid-template-columns: 1fr 1fr 1.15fr; gap: 8px; }
.factions.three .pill { font-size: 15px; padding: 0 6px; }

/* ingresso: título, informações e streaming centralizados */
.fticket .fbody { align-items: center; text-align: center; }
.fticket .ffacts { justify-content: center; }
.fticket .fseqchip { align-self: center; }
.fticket .fbottom { justify-content: center; }

/* Filmes sem o título grande: as abas logo abaixo da barra */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.fhead .ftabs { margin-top: 2px; }
