/* Vila Amorosa — UI flutuante sobre o canvas. A vila é a protagonista; o chrome só sussurra. */

:root {
  --sun: #FFB84D;
  --coral: #FF8A5C;
  --leaf: #6FBF73;
  --sky: #7EC8E3;
  --lilac: #B79CED;
  --ink: #3D2C29;
  --ink-soft: #7A6660;
  --glass: rgba(255, 252, 245, 0.78);
  --font-stack: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* ---- faixas do rodapé (mobile): números mágicos 96/108/120/10 viram lanes que se referem entre si ---- */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --sheet-peek-h: 96px;                              /* altura da fita do painel recolhido (peek/zen) */
  --deck-0: calc(var(--sheet-peek-h) + var(--safe-b)); /* topo da fita peek: onde a chrome do rodapé "senta" */
  --deck-gap: 12px;
  --deck-1: calc(var(--deck-0) + var(--deck-gap));   /* primeira faixa flutuante acima do peek */
  --shelf-h: 68px;                                   /* altura da shelf do baú: slot 54 + padding 6×2 + borda */
}

/* ---- reset-lite ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overscroll-behavior: none; }
body {
  overflow: hidden;
  font-family: var(--font-stack);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
html.reordering, html.reordering * { cursor: grabbing !important; user-select: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }

/* touch-action none: iOS não dá zoom-de-página no double-tap/pinça e Android não puxa refresh
   sobre o canvas; os gestos (girar/pinçar/mirar) são todos do jogo. O painel/cards rolam normal. */
#game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; touch-action: none; }

.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;
}

/* ---- topbar ---- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(0.5rem + env(safe-area-inset-top)) calc(0.75rem + env(safe-area-inset-right)) 0.5rem calc(0.75rem + env(safe-area-inset-left));
  pointer-events: none;
  transition: opacity 0.4s;
}
.topbar-right { display: flex; gap: 0.25rem; }
.icon-btn {
  pointer-events: auto;
  min-width: 44px; min-height: 44px;
  border: 0; background: transparent; border-radius: 14px;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.3s, transform 0.15s;
}
.icon-btn:hover, .icon-btn:focus-visible { opacity: 1; }
.icon-btn:active { transform: scale(0.94); }
.topbar.sleeping .icon-btn { opacity: 0.12; }
.topbar.sleeping .icon-btn:hover, .topbar.sleeping .icon-btn:focus-visible { opacity: 1; }

/* ---- painel (bottom sheet mobile-first) ---- */
.panel {
  position: fixed; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 88vh;
  height: 88dvh;
  z-index: 10;
  background: var(--glass);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 32px rgba(61, 44, 41, 0.12);
  display: flex; flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.4s;
  will-change: transform;
}
@supports (backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px)) {
  .panel {
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
  }
}
@supports not ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))) {
  .panel { background: #FFF6E8; }
}
.panel[data-snap="peek"] { transform: translateY(calc(100% - var(--deck-0))); }
.panel[data-snap="half"] { transform: translateY(52%); }
.panel[data-snap="full"] { transform: translateY(4%); }
.panel[data-snap="zen"]  { transform: translateY(calc(100% - var(--deck-0))); }
.panel[data-snap="hidden"] { transform: translateY(105%); }  /* modos de edição: painel sai de cena */
.panel.dragging { transition: opacity 0.4s; }

.panel-handle {
  height: 56px; flex: 0 0 56px;
  display: grid; place-items: center;
  cursor: grab; touch-action: none;
}
.panel-handle:active { cursor: grabbing; }
.handle-bar { width: 44px; height: 5px; border-radius: 3px; background: rgba(61, 44, 41, 0.25); }

.panel-content {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 0 0.9rem;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.panel-content::-webkit-scrollbar { display: none; }

/* desktop: painel lateral flutuante */
@media (min-width: 900px) {
  .panel {
    left: auto; right: 24px; top: 80px; bottom: auto;
    width: 410px; height: min(780px, calc(100dvh - 112px)); max-height: none;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(61, 44, 41, 0.16);
    /* height entra na transição p/ o painel encolher/crescer suave ao virar aba (ease sem overshoot) */
    transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1),
                height 0.35s cubic-bezier(0.33, 0.1, 0.25, 1), opacity 0.4s;
  }
  .panel[data-snap="peek"], .panel[data-snap="half"], .panel[data-snap="full"], .panel[data-snap="hidden"] { transform: none; }
  /* baú aberto: encurta o painel pra não cobrir a hotbar de construção lá embaixo (~78px + folga).
     176px = topo(80) + barra(68) + offset(10) + ~18px de respiro. A aba recolhida fica no topo,
     longe da hotbar, então o :not(zen) preserva a pílula compacta. height anima → encolhe suave. */
  body.has-bau .panel:not([data-snap="zen"]) {
    height: min(780px, calc(100dvh - 176px - env(safe-area-inset-bottom)));
  }
  /* zen: o painel recolhe numa aba esbelta "‹ Tarefas" rente à borda — some o painelzão vazio
     e fica claro o que mora ali. translateX = 100% + right(24px) − largura da aba(56px) = 100% − 32px,
     deixando exatos 56px visíveis colados na borda direita. */
  .panel[data-snap="zen"] {
    transform: translateX(calc(100% - 32px));
    height: 9.5rem;  /* encolhe junto: a aba vira pílula compacta, não um painelzão vazio */
    box-shadow: -6px 12px 32px rgba(61, 44, 41, 0.16);
  }
  .panel[data-snap="zen"] .panel-content { display: none; }  /* esconde a lista enquanto recolhido */
  .panel[data-snap="zen"] .panel-toggle { display: none; }   /* a aba "‹ Tarefas" assume */
  .panel[data-snap="zen"] .panel-tab {
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
    width: 56px; padding: 1.1rem 0;
    /* ancorado no topo (sem flex:1/center): o topo do painel é fixo, então o rótulo fica
       parado enquanto a altura anima — nada de "Tarefas" subindo de baixo pra cima */
  }
  .panel-handle { display: none; }
  .panel-content { padding-top: 0.8rem; }
}

.panel-toggle {
  display: none;
  /* alça de gaveta: metade pra fora da borda esquerda — nunca cobre o conteúdo */
  position: absolute; left: -16px; top: 22px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(255, 252, 245, 0.95); color: var(--ink-soft);
  cursor: pointer; z-index: 3; font-size: 17px; line-height: 1; padding: 0;
  box-shadow: 0 2px 8px rgba(61, 44, 41, 0.18);
}
.panel-toggle:hover { color: var(--ink); }
@media (min-width: 900px) {
  .panel-toggle { display: grid; place-items: center; }
}

/* aba de gaveta recolhida (desktop, zen): pílula vertical "‹ Tarefas" — só aparece via .panel[data-snap="zen"] */
.panel-tab {
  display: none;
  border: none; background: none; cursor: pointer; color: var(--ink);
}
.panel-tab-chevron {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(61, 44, 41, 0.06); color: var(--ink-soft);
  font-size: 1.05rem; line-height: 1;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.panel-tab:hover .panel-tab-chevron { background: rgba(61, 44, 41, 0.1); color: var(--ink); }
.panel-tab:active .panel-tab-chevron { transform: scale(0.92); }
.panel-tab-label {
  writing-mode: vertical-rl;
  font-weight: 700; font-size: 0.92rem; letter-spacing: 0.08em; color: var(--ink);
}

/* ---- timer flutuante ---- */
.timer-float {
  position: fixed; z-index: 15;
  bottom: calc(var(--deck-0) + 24px);  /* = 96 + safe + 24 = 120 + safe (lane, valor idêntico ao antigo) */
  left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  transition: opacity 0.4s;
}
.focus-float-cta {
  min-width: 172px; min-height: 52px; padding: 0.7rem 1.4rem;
  font-size: 1.02rem;
  box-shadow: 0 10px 30px rgba(255, 138, 92, 0.38), 0 2px 8px rgba(61, 44, 41, 0.12);
}
.focus-popover {
  width: min(360px, calc(100vw - 32px)); padding: 0.75rem;
  border: 1px solid rgba(61, 44, 41, 0.09); border-radius: 20px;
  background: rgba(255, 252, 245, 0.94);
  box-shadow: 0 16px 44px rgba(61, 44, 41, 0.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.18);
  backdrop-filter: blur(16px) saturate(1.18);
  transform-origin: 50% 100%;
}
.timer-transition-out {
  pointer-events: none;
  animation: timer-control-out 0.18s cubic-bezier(0.4, 0, 1, 1) both;
}
.timer-transition-in {
  animation: timer-control-in 0.38s cubic-bezier(0.2, 1.35, 0.45, 1) both;
}
@keyframes timer-control-out {
  from { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  to { opacity: 0; transform: translateY(10px) scale(0.88); filter: blur(3px); }
}
@keyframes timer-control-in {
  from { opacity: 0; transform: translateY(14px) scale(0.78); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@media (min-width: 900px) {
  .timer-float { bottom: 32px; left: 32px; transform: none; }
}

.ring { width: 180px; height: 180px; position: relative; }
@media (min-width: 900px) { .ring { width: 200px; height: 200px; } }
.ring svg { width: 100%; height: 100%; display: block; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(61, 44, 41, 0.10); stroke-width: 5; }
.ring-arc { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring-center {
  position: absolute; inset: 13%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, rgba(255, 252, 245, 0.94), rgba(255, 252, 245, 0.6) 68%, rgba(255, 252, 245, 0.18));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 0.15rem; padding: 0.5rem;
}
.ring-time {
  font-size: 2.6rem; font-weight: 300; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.tf-task {
  margin-top: 0.55rem;
  font-size: 1.02rem; font-weight: 700; color: var(--ink);
  background: rgba(255, 252, 245, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px; padding: 0.5rem 1.15rem;
  box-shadow: 0 4px 16px rgba(61, 44, 41, 0.16);
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center;
}
.tf-task::before { content: "🌻 "; }
button.tf-task { cursor: pointer; border: none; font: inherit; font-size: 1.02rem; font-weight: 700; }
button.tf-task::after { content: " ⌄"; opacity: 0.45; font-size: 0.85em; }
.tf-task-none { color: var(--ink-soft); }

/* menu de troca de tarefa (abre acima do anel) */
.tf-task-menu {
  position: absolute; bottom: 100%; margin-bottom: 8px;
  left: 50%; transform: translateX(-50%);
  background: rgba(255, 252, 245, 0.97);
  border-radius: 16px; padding: 0.4rem;
  box-shadow: 0 12px 32px rgba(61, 44, 41, 0.22);
  min-width: 220px; max-width: 300px; max-height: 240px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; z-index: 6;
}
.tf-task-menu button {
  border: none; background: none; text-align: left; cursor: pointer;
  padding: 0.6rem 0.8rem; border-radius: 12px;
  font-size: 0.95rem; color: var(--ink); min-height: 44px;
}
.tf-task-menu button:hover { background: rgba(61, 44, 41, 0.07); }
.tf-task-menu .tf-task-menu-none { color: var(--ink-soft); }

.tf-wrap { display: flex; flex-direction: column; align-items: center; position: relative; }
.tf-controls { gap: 0.5rem; justify-content: center; margin-top: 0.6rem; }
.tf-run-controls, .tf-paused { display: none; }
.tf-wrap[data-view="run"] .tf-run-controls { display: flex; }
.tf-wrap[data-view="paused"] .tf-paused { display: flex; }
.tf-paused-msg {
  margin-top: 0.6rem; font-size: 0.85rem; color: var(--ink-soft);
  background: var(--glass); border-radius: 999px; padding: 0.4rem 1rem; text-align: center;
  max-width: 260px;
}
.tf-confirm {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 20px; padding: 1.25rem; max-width: 280px; text-align: center;
  box-shadow: 0 12px 36px rgba(61, 44, 41, 0.18);
  display: flex; flex-direction: column; gap: 0.75rem;
}
.tf-confirm strong { font-size: 1rem; }
.tf-confirm p { font-size: 0.85rem; color: var(--ink-soft); }

/* ---- cards centrais ---- */
.card-layer {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background: rgba(61, 44, 41, 0.10);
}
.card {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 24px;
  max-width: 420px; width: calc(100% - 48px);
  padding: 1.75rem;
  box-shadow: 0 16px 48px rgba(61, 44, 41, 0.18);
  animation: card-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.card h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.card-body { font-size: 0.95rem; line-height: 1.5; color: var(--ink); margin-bottom: 0.75rem; white-space: pre-line; }
.card-sub { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 0.4rem; }
.card-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; align-items: stretch; }
.card-actions-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.card-close {
  position: absolute; top: 0.6rem; right: 0.6rem;
  width: 36px; height: 36px; min-width: 36px; min-height: 36px;
  border: 0; border-radius: 50%; background: rgba(61, 44, 41, 0.06);
  cursor: pointer; font-size: 0.9rem; color: var(--ink-soft);
}
.carry-list { margin-bottom: 0.5rem; }
.carry-list li { font-size: 0.9rem; padding: 0.2rem 0; }
.carry-list li::before { content: "🌿 "; }

/* ---- botões ---- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.7rem 1.5rem;
  border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--sun), var(--coral));
  color: var(--ink); font-weight: 600; font-size: 1rem; cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 138, 92, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:active { transform: scale(0.97); box-shadow: 0 3px 10px rgba(255, 138, 92, 0.3); }
.btn-primary:disabled { opacity: 0.45; cursor: default; box-shadow: none; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 44px; padding: 0.5rem 1.1rem;
  border: 1px solid rgba(61, 44, 41, 0.14); border-radius: 999px;
  background: var(--glass); cursor: pointer; font-size: 0.95rem;
  transition: transform 0.15s, background 0.2s;
}
.btn-ghost:active { transform: scale(0.97); }
.btn-danger { color: #c0463f; border-color: rgba(192, 70, 63, 0.3); }

.btn-link {
  border: 0; background: none; padding: 0.5rem;
  color: var(--ink-soft); cursor: pointer; font-size: 0.9rem;
  text-decoration: underline; text-underline-offset: 3px; border-radius: 8px;
}

.chip {
  min-height: 48px; padding: 0.6rem 1.1rem;
  border: 1px solid rgba(61, 44, 41, 0.15); border-radius: 999px;
  background: rgba(255, 252, 245, 0.6); cursor: pointer; font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  transition: transform 0.15s, background 0.2s;
}
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--sun), var(--coral));
  border-color: transparent; font-weight: 600;
}

input[type="checkbox"] { accent-color: var(--leaf); width: 1.25rem; height: 1.25rem; }

/* ---- seções do painel ---- */
.panel-section { padding: 0.25rem 0 1rem; }

/* Navegação do workspace: cada área usa o painel inteiro em vez de competir por espaço. */
.panel-nav {
  position: relative; z-index: 10; flex: 0 0 auto;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: column; gap: 0.2rem;
  margin: 0 -0.1rem 0.55rem; padding: 0.25rem;
  border: 1px solid rgba(61, 44, 41, 0.08); border-radius: 18px;
  background: rgba(255, 252, 245, 0.92);
  box-shadow: 0 8px 24px rgba(61, 44, 41, 0.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
}
.panel-nav-tab {
  position: relative;
  display: inline-flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 0.28rem;
  min-width: 0; min-height: 46px; padding: 0.4rem 0.25rem;
  border: 0; border-radius: 14px; background: transparent;
  color: var(--ink-soft); cursor: pointer; font-size: 0.8rem; font-weight: 650;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.15s;
}
.panel-nav-tab:active { transform: scale(0.97); }
.panel-nav-tab[aria-selected="true"] {
  color: var(--ink); background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 10px rgba(61, 44, 41, 0.09);
}
.panel-nav-tab[data-panel-tab="today"][aria-selected="true"] { background: rgba(111, 191, 115, 0.18); }
.panel-nav-tab[data-panel-tab="later"][aria-selected="true"] { background: rgba(183, 156, 237, 0.18); }
.panel-nav-tab.drop-into { outline: 2px dashed rgba(111, 191, 115, 0.75); outline-offset: -3px; }
.panel-nav-icon { font-size: 0.95rem; line-height: 1; }
.panel-nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-nav-count {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  min-width: 18px; height: 18px; padding: 0 0.25rem; border-radius: 999px;
  background: rgba(61, 44, 41, 0.09); color: var(--ink-soft);
  font-size: 0.68rem; font-weight: 750; font-variant-numeric: tabular-nums;
}
.panel-focus { flex: 0 0 auto; }
.panel-view--tasks {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 0 calc(1.5rem + env(safe-area-inset-bottom));
  scrollbar-width: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.panel-view--tasks::-webkit-scrollbar { display: none; }

.picker { position: relative; display: flex; flex-direction: column; gap: 0.5rem; }
.picker-collapse {
  position: absolute; z-index: 1; top: -0.2rem; right: -0.15rem;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 1rem;
}
.picker-collapse:hover { background: rgba(61, 44, 41, 0.07); color: var(--ink); }
.picker-label { font-size: 0.8rem; color: var(--ink-soft); }
.task-select {
  width: 100%; min-height: 44px; padding: 0.5rem 0.75rem;
  border: 1px solid rgba(61, 44, 41, 0.15); border-radius: 14px;
  background: rgba(255, 252, 245, 0.7);
}
.picker-label .task-select { display: block; margin-top: 0.2rem; }
.picker-start-row { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 0.45rem; }
.focus-duration-select { min-width: 0; }
.focus-start-compact { min-height: 44px; padding: 0.5rem 0.8rem; font-size: 0.92rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stepper { display: flex; align-items: center; gap: 0.75rem; }
.stepper-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(61, 44, 41, 0.15); background: rgba(255, 252, 245, 0.7);
  font-size: 1.25rem; cursor: pointer;
}
.stepper-value { min-width: 5.5rem; text-align: center; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.ratio-hint { font-size: 0.72rem; color: var(--ink-soft); padding: 0 0.25rem 0.1rem; }

.section-head { display: flex; align-items: center; gap: 0.6rem; margin: 0.5rem 0 0.4rem; }
.section-head h2 { font-size: 1.05rem; }
.task-counter { font-size: 0.75rem; color: var(--ink-soft); }
.section-head .archive-btn { margin-left: auto; padding: 0.4rem 0.2rem; }
.empty-msg { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.5; padding: 0.75rem 0; }

/* ---- zonas suaves (Hoje / Depois) ---- */
.task-zone {
  min-height: 100%; border-radius: 22px;
  padding: 0.45rem 0.8rem 0.65rem;
  margin: 0 0 0.7rem;
  box-shadow: inset 0 0 0 1px rgba(61, 44, 41, 0.035);
}
.task-zone--today { background: linear-gradient(155deg, rgba(111, 191, 115, 0.13), rgba(255, 252, 245, 0.24)); }
.task-zone--later { background: linear-gradient(155deg, rgba(183, 156, 237, 0.15), rgba(255, 252, 245, 0.24)); }
.task-zone-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 0.55rem;
  margin: -0.45rem -0.8rem 0; padding: 0.85rem 0.8rem 0.65rem;
  border-radius: 22px 22px 12px 12px;
  background: rgba(255, 252, 245, 0.86);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.task-zone-title { font-size: 1.12rem; font-weight: 760; letter-spacing: -0.015em; color: var(--ink); }
.task-zone-head .task-counter { font-weight: 400; }
.task-zone-head .archive-btn { margin-left: auto; padding-right: 0; }
.task-zone-head--toggle { cursor: pointer; user-select: none; }
.zone-chevron { margin-left: auto; color: var(--ink-soft); font-size: 0.9rem; }
.task-zone-head--toggle .task-counter { margin-left: 0; }
.task-zone--later .task-zone-head--toggle .task-zone-title { color: var(--ink); }

/* ---- tarefas ---- */
.task-list { display: flex; flex-direction: column; }
.task-row {
  display: flex; align-items: center; gap: 0.7rem;
  min-height: 46px; padding: 0.22rem 0; position: relative;
  border-bottom: 1px solid rgba(61, 44, 41, 0.055);
}
.task-row:last-child { border-bottom-color: transparent; }
.task-row .task-check { margin-top: 0; }
.task-zone .task-list { margin: 0; }
.task-drag {
  flex: 0 0 auto; align-self: stretch;
  width: 22px; margin: -0.4rem -0.4rem -0.4rem -0.5rem; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--ink-soft);
  font-size: 1rem; line-height: 1; cursor: grab;
  opacity: 0; transition: opacity 0.2s; touch-action: none;
}
.task-row:hover .task-drag,
.task-row:focus-within .task-drag,
.task-row.show-actions .task-drag { opacity: 0.4; }
.task-drag:hover { opacity: 0.75; }
.task-row.dragging {
  z-index: 5; cursor: grabbing;
  background: rgba(255, 252, 245, 0.97);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(61, 44, 41, 0.18);
}
.task-row.dragging .task-drag { opacity: 0.75; cursor: grabbing; }
.task-check {
  position: relative; flex: 0 0 26px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(61, 44, 41, 0.3); background: rgba(255, 252, 245, 0.5);
  cursor: pointer; padding: 0; font-size: 0.8rem; line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}
.task-check::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
.task-row.done .task-check { background: var(--leaf); border-color: var(--leaf); }
.task-row.done .task-check::before { content: "🌿"; font-size: 0.8rem; }
.task-main { flex: 1; min-width: 0; }
.task-title-line { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.task-title {
  font-size: 0.95rem; line-height: 1.35;
  white-space: normal; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.task-title-button {
  width: 100%; margin: 0; padding: 0; border: 0; background: transparent;
  color: inherit; text-align: left; cursor: text;
}
.task-title-button:hover { color: var(--ink-soft); }
.task-row.done .task-title { text-decoration: line-through; color: var(--ink-soft); }
.carryover-tag {
  font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 999px;
  background: rgba(183, 156, 237, 0.22); color: var(--ink-soft); white-space: nowrap; flex: 0 0 auto;
}
/* faixinha separada do pote de foco — entre o Focar e a lista de tarefas */
.village-preview {
  margin: 0 0 0.55rem;
  padding: 0.65rem 0.8rem;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(111, 191, 115, 0.17), rgba(126, 200, 227, 0.08));
  box-shadow: inset 0 0 0 1px rgba(111, 191, 115, 0.08);
  font-size: 0.78rem; line-height: 1.35; color: var(--ink-soft);
}
.village-preview:empty { display: none; }
.village-preview-main strong { color: var(--ink); }
.village-preview-sub { opacity: 0.85; margin-top: 0.2rem; }
/* barra do pote de foco: enche até a Maravilha, paradas de tier acendem no caminho */
.pool-bar {
  position: relative; height: 8px; border-radius: 999px;
  margin: 0.5rem 0.35rem 0.55rem;
  background: rgba(61, 44, 41, 0.12);
}
.pool-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--leaf), var(--sun));
  transition: width 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.pool-stop {
  /* maior que a barra de propósito: as paradas "sentam" sobre a linha — não cortar com overflow */
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  font-size: 0.85rem; line-height: 1;
  filter: grayscale(1); opacity: 0.45;
  transition: filter 0.4s, opacity 0.4s, transform 0.3s;
}
.pool-stop.reached { filter: none; opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
.village-preview.tier-up { animation: tier-up-pulse 0.9s ease-out; }
@keyframes tier-up-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 184, 77, 0.7); }
  60% { box-shadow: 0 0 0 12px rgba(255, 184, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 184, 77, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .timer-transition-in, .timer-transition-out { animation: none; }
  .village-preview.tier-up { animation: none; }
  .pool-bar-fill { transition: none; }
  .pool-stop { transition: none; }
  .task-zone-head { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass); }
}
.task-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem; }
.effort-dots { display: flex; gap: 3px; }
.effort-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--leaf); }
.task-sub { font-size: 0.75rem; color: var(--ink-soft); margin-top: 0.15rem; }
.task-actions { margin-left: auto; display: flex; gap: 0.05rem; opacity: 0.38; transition: opacity 0.2s; flex: 0 0 auto; }
.task-row:hover .task-actions,
.task-row:focus-within .task-actions,
.task-row.show-actions .task-actions { opacity: 1; }
.task-icon-btn {
  width: 32px; height: 40px; min-width: 32px; min-height: 40px;
  border: none; border-radius: 50%; background: transparent;
  color: var(--ink-soft); font-size: 0.95rem; line-height: 1; cursor: pointer; padding: 0;
}
.task-icon-btn:hover { background: rgba(61, 44, 41, 0.08); color: var(--ink); }
.task-move { font-size: 0.9rem; }
.task-zone--later .task-move { color: var(--leaf); }
.task-edit-input, .task-add-input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0.5rem 0.85rem;
  border: 1px solid rgba(61, 44, 41, 0.1); border-radius: 14px;
  background: rgba(255, 252, 245, 0.88);
}
.task-add { display: flex; gap: 0.45rem; margin: 0.65rem 0 0.55rem; }
.btn-add-task {
  flex: 0 0 44px; width: 44px; padding: 0;
  border-color: transparent; background: rgba(255, 252, 245, 0.88);
  color: var(--ink); font-size: 1.45rem; font-weight: 350;
  box-shadow: 0 2px 8px rgba(61, 44, 41, 0.07);
}

/* ---- concluídas recolhíveis ---- */
.done-section { margin-top: 0.2rem; }
.done-toggle {
  border: none; background: none; cursor: pointer;
  display: block; width: 100%; text-align: left;
  padding: 0.45rem 0; font-size: 0.8rem; color: var(--ink-soft);
}
.done-toggle:hover { color: var(--ink); }

/* ---- realce de drop ---- */
.task-zone-head.drop-into,
.task-list.drop-into { outline: 2px dashed rgba(111, 191, 115, 0.7); outline-offset: 2px; border-radius: 12px; }

@media (max-width: 420px) {
  .panel-content { padding-left: 0.65rem; padding-right: 0.65rem; }
  .panel-nav-tab { gap: 0.2rem; padding-left: 0.15rem; padding-right: 0.15rem; font-size: 0.76rem; }
  .panel-nav-icon { font-size: 0.85rem; }
  .task-zone { padding-left: 0.65rem; padding-right: 0.65rem; }
  .task-zone-head { margin-left: -0.65rem; margin-right: -0.65rem; padding-left: 0.65rem; padding-right: 0.65rem; }
  .task-actions { gap: 0; }
  .task-icon-btn { width: 30px; min-width: 30px; }
}

/* ---- arquivo / conquistas ---- */
.archive-zone {
  background: linear-gradient(155deg, rgba(126, 200, 227, 0.14), rgba(183, 156, 237, 0.11) 55%, rgba(255, 252, 245, 0.25));
}
.archive-zone-head .archive-btn { margin-left: auto; }
.archive-group { margin-top: 0.75rem; }
.archive-day {
  margin: 0 0 0.35rem; padding-left: 0.2rem;
  font-size: 0.72rem; color: var(--ink-soft); font-weight: 700;
  letter-spacing: 0.045em; text-transform: capitalize;
}
.archive-entry {
  display: flex; align-items: center; gap: 0.65rem; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid rgba(61, 44, 41, 0.055);
  background: rgba(255, 252, 245, 0.36); cursor: default;
  padding: 0.58rem 0.65rem; color: var(--ink);
}
.archive-entry:first-of-type { border-radius: 14px 14px 0 0; }
.archive-entry:last-child { border-bottom: 0; border-radius: 0 0 14px 14px; }
.archive-entry:only-of-type { border-radius: 14px; }
button.archive-entry { cursor: pointer; }
button.archive-entry:hover { background: rgba(255, 252, 245, 0.72); }
.archive-entry-check {
  display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px;
  border-radius: 50%; background: rgba(111, 191, 115, 0.2); color: var(--leaf); font-weight: 800;
}
.archive-entry-copy { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.archive-entry-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.archive-entry-meta { color: var(--ink-soft); font-size: 0.72rem; }
.archive-entry-arrow { color: var(--ink-soft); font-size: 0.9rem; }
.archive-empty { display: grid; place-items: center; gap: 0.25rem; min-height: 180px; text-align: center; padding: 1rem; }
.archive-empty-icon { font-size: 1.8rem; opacity: 0.7; }

/* ---- baú: hotbar fixa (estilo Minecraft), fora do painel ---- */
.inv-bar {
  position: fixed; z-index: 16; /* acima do timer-float pra nunca ficar atrás dele */
  right: 14px; left: auto;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: none; align-items: center; gap: 7px;
  max-width: min(calc(100vw - 28px), 600px);
  padding: 6px 8px;
  border: 1px solid rgba(61, 44, 41, 0.08);
  background: linear-gradient(145deg, rgba(255, 252, 245, 0.96), rgba(111, 191, 115, 0.13));
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(61, 44, 41, 0.16);
}
.inv-bar-label {
  display: grid; place-items: center; flex: 0 0 auto;
  min-width: 38px; height: 38px; padding: 0 0.45rem;
  border-radius: 13px; background: rgba(111, 191, 115, 0.15);
  color: var(--ink-soft); font-size: 0.75rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.inv-slots {
  display: flex; gap: 6px; flex: 1 1 auto; min-width: 0;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.inv-slots::-webkit-scrollbar { display: none; }
.inv-slot {
  position: relative; padding: 0; cursor: pointer;
  width: 54px; height: 54px; flex: 0 0 auto;
  border: 1px solid rgba(61, 44, 41, 0.09); border-radius: 15px;
  background: rgba(255, 252, 245, 0.72);
  box-shadow: 0 2px 8px rgba(61, 44, 41, 0.06);
  overflow: hidden; transition: transform 0.14s, box-shadow 0.16s, border-color 0.16s, background 0.16s;
}
.inv-slot:hover { transform: translateY(-2px); background: rgba(255, 252, 245, 0.95); box-shadow: 0 7px 18px rgba(61, 44, 41, 0.13); }
.inv-slot:active { transform: translateY(0); }
.inv-slot.selected {
  border-color: rgba(111, 191, 115, 0.75);
  background: rgba(111, 191, 115, 0.18);
  box-shadow: 0 0 0 2px rgba(111, 191, 115, 0.28), 0 6px 16px rgba(61, 44, 41, 0.1);
}
.inv-slot-canvas { display: block; width: 54px; height: 54px; }
.inv-bar-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.inv-act {
  width: 44px; height: 44px; border: 1px solid rgba(61, 44, 41, 0.07); border-radius: 13px; cursor: pointer;
  background: rgba(255, 252, 245, 0.72); color: var(--ink-soft); font-size: 1.05rem; line-height: 1;
  transition: transform 0.14s, background 0.16s, color 0.16s;
}
.inv-act:hover { transform: translateY(-1px); background: rgba(183, 156, 237, 0.16); color: var(--ink); }
.inv-act:active { transform: translateY(0); }
/* O espaço do baú pertence ao conteúdo rolável; no contêiner flex ele cortava a lista. */
body.has-bau .panel-view--tasks { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }

/* ---- tray/bandeja: slots + botões durante colocação/arrumação (sem texto — os slots mandam) ---- */
.inv-tray-btn {
  flex: 0 0 auto; border: none; border-radius: 999px; cursor: pointer;
  background: var(--leaf); color: #fff; font-size: 0.9rem; font-weight: 650;
  padding: 0 1rem; min-height: 44px; white-space: nowrap;
}
.inv-tray-btn:hover { filter: brightness(0.96); }
.inv-tray-btn.inv-tray-btn--ghost { background: rgba(255, 252, 245, 0.9); color: var(--ink); border: 1px solid rgba(61, 44, 41, 0.14); }
.inv-store-zone {
  flex: 0 0 auto; display: grid; place-items: center;
  min-width: 54px; height: 54px; padding: 0 0.5rem;
  border: 2px dashed rgba(183, 156, 237, 0.7); border-radius: 15px;
  background: rgba(183, 156, 237, 0.12); color: var(--ink); font-size: 1.15rem; cursor: default;
}
.inv-store-zone.is-over { background: rgba(183, 156, 237, 0.32); border-style: solid; }
.inv-break-time {
  flex: 0 0 auto; display: grid; place-items: center;
  min-height: 38px; padding: 0 0.6rem; border-radius: 13px;
  background: rgba(126, 200, 227, 0.2); color: var(--ink-soft);
  font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ---- shelf (baú) e tray no mobile: fita full-width acima do peek, ciente do snap ---- */
@media (max-width: 899px) {
  .inv-bar {
    left: 10px; right: 10px; max-width: none;
    bottom: calc(var(--deck-0) + 10px);  /* acima da fita peek */
  }
  /* half: painel = translateY(52%) de 88dvh → topo visível a (1−0.52)·88dvh do fundo; a shelf senta logo acima */
  .inv-bar[data-snap="half"] { bottom: calc(88dvh * 0.48 + 10px); }
  .inv-bar[data-snap="full"] { display: none !important; }
  /* modos de edição escondem o painel; o topo visível não existe → shelf/tray na faixa peek */
  .inv-bar[data-snap="hidden"] { bottom: calc(var(--deck-0) + 10px); }

  /* body.editing: o timer flutuante e a faixa "vendo vila de ontem" saem (o ☕ e os controles vivem na tray) */
  body.editing .timer-float,
  body.editing .view-banner { display: none !important; }

  /* CTA "Focar" nunca divide a lane com a shelf do baú: em peek/zen (shelf rente à fita) o CTA
     sobe uma prateleira. Em half a shelf pula pro topo do painel e o CTA fica na lane padrão. */
  body.has-bau[data-snap="peek"] .timer-float,
  body.has-bau[data-snap="zen"] .timer-float {
    bottom: calc(var(--deck-0) + 10px + var(--shelf-h) + var(--deck-gap));
  }
}

/* (o antigo .edit-bar flutuante morreu: a tray do baú, §inventory, é o rodapé dos modos de edição) */

/* ---- calendário ---- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.cal-title { font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.cal-nav { display: flex; gap: 0.25rem; }
.cal-nav button {
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: rgba(61, 44, 41, 0.06); color: var(--ink); cursor: pointer; font-size: 0.9rem;
}
.cal-nav button:disabled { opacity: 0.3; cursor: default; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays span { text-align: center; font-size: 0.65rem; color: var(--ink-soft); padding-bottom: 0.2rem; }
.cal-cell {
  aspect-ratio: 1 / 1; border: none; border-radius: 10px; cursor: default;
  background: transparent; color: var(--ink-soft);
  font-size: 0.8rem; position: relative; display: flex; align-items: center; justify-content: center;
}
.cal-cell.blank { visibility: hidden; }
.cal-cell.has-data { background: rgba(255, 252, 245, 0.7); color: var(--ink); cursor: pointer; }
.cal-cell.has-data:hover { background: var(--leaf); color: #fff; }
.cal-cell.has-data::after {
  content: ""; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--leaf);
}
.cal-cell.has-data:hover::after { background: #fff; }
.cal-cell.today { outline: 2px solid var(--leaf); outline-offset: -2px; }

/* faixa "vendo vila de ontem" */
.view-banner {
  position: fixed; z-index: 36; top: calc(12px + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 999px; padding: 0.45rem 0.6rem 0.45rem 1rem;
  box-shadow: 0 10px 28px rgba(61, 44, 41, 0.18); max-width: calc(100vw - 32px);
}
.view-banner-label { font-size: 0.85rem; color: var(--ink); white-space: nowrap; }
.view-banner-back {
  border: none; border-radius: 999px; cursor: pointer;
  background: var(--leaf); color: #fff; font-size: 0.85rem; font-weight: 600;
  padding: 0.4rem 0.85rem; min-height: 34px; white-space: nowrap;
}

/* ---- onboarding ---- */
.onboard-added { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.5rem 0; }
.onboard-added li { font-size: 0.9rem; }
.onboard-added li::before { content: "🌱 "; }

/* ---- ajustes: card acolhedor, seções, switches de verdade e idioma segmentado ---- */
.card-settings { width: min(420px, calc(100% - 40px)); padding: 1.5rem 1.35rem 1.4rem; }
.settings-title { font-size: 1.35rem; margin-bottom: 0.9rem; letter-spacing: -0.01em; }

.settings-section { margin-bottom: 1.15rem; }
.settings-section-head {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 0.5rem 0.15rem;
}
.settings-section-body { display: flex; flex-direction: column; gap: 0.4rem; }

/* linha: superfície creme arredondada — rótulo à esquerda, controle à direita */
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.85rem;
  min-height: 52px; padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(61, 44, 41, 0.06);
  border-radius: 14px;
}
.settings-row-label { font-size: 0.96rem; font-weight: 550; color: var(--ink); flex: 1; line-height: 1.3; }
.settings-row--stack { flex-direction: column; align-items: stretch; gap: 0.6rem; }
.settings-row--stack .settings-row-label { flex: none; }

/* dica sob uma linha — tom suave, encostada na margem */
.settings-hint { font-size: 0.76rem; line-height: 1.5; color: var(--ink-soft); margin: 0.15rem 0.35rem 0.1rem; }

/* status de armazenamento (proteção / cópia) */
.settings-storage { font-size: 0.8rem; line-height: 1.45; color: var(--ink-soft); margin: 0 0.2rem 0.7rem; }

/* ---- switch (trilho-pílula + botão que desliza; alvo tocável ≥44px via ::after) ---- */
.switch {
  position: relative; flex: 0 0 auto;
  width: 52px; height: 30px; padding: 0; border: 0; border-radius: 999px;
  background: #E0BE8A; cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(61, 44, 41, 0.2);
  transition: background 0.22s ease, transform 0.15s ease;
}
.switch::after { content: ""; position: absolute; inset: -7px -8px; border-radius: 999px; }
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #FFFDF8; box-shadow: 0 2px 5px rgba(61, 44, 41, 0.28);
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.switch.is-on { background: var(--leaf); box-shadow: inset 0 1px 3px rgba(46, 125, 79, 0.32); }
.switch.is-on .switch-knob { transform: translateX(22px); }
.switch:active { transform: scale(0.96); }
.switch.is-disabled { opacity: 0.5; cursor: default; }
.switch:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }

/* ---- idioma segmentado (3 segmentos ≥44px; ativo = verde folha) ---- */
.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 4px; border-radius: 14px;
  background: rgba(61, 44, 41, 0.06); border: 1px solid rgba(61, 44, 41, 0.06);
}
.segmented-opt {
  min-height: 44px; padding: 0.4rem 0.3rem; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; font-family: inherit;
  font-size: 0.85rem; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.segmented-opt:hover { color: var(--ink); }
.segmented-opt.is-active {
  background: var(--leaf); color: #fff; font-weight: 700;
  box-shadow: 0 3px 8px rgba(91, 174, 70, 0.32);
}
.segmented-opt:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }

/* ---- ações e rodapé destrutivo ---- */
.settings-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.35rem; }
.settings-actions .btn-ghost { flex: 1 1 44%; }
.settings-actions--danger { margin-top: 0.2rem; }
.settings-actions--danger .btn-danger { flex: 1 1 100%; }
.settings-divider {
  height: 1px; margin: 1.1rem 0 0.9rem;
  background: linear-gradient(90deg, transparent, rgba(61, 44, 41, 0.14), transparent);
}

/* sem movimento (settings.reducedFx OU prefers-reduced-motion): switches/segmentos sem transição */
.card--calm .switch,
.card--calm .switch-knob,
.card--calm .segmented-opt { transition: none; }

@media (max-width: 360px) {
  .card-settings { padding: 1.3rem 1rem 1.2rem; }
  .settings-row { padding: 0.5rem 0.7rem; }
  .settings-row-label { font-size: 0.9rem; }
  .segmented-opt { font-size: 0.8rem; padding: 0.4rem 0.15rem; }
}

/* ---- toasts ---- */
.toast-layer {
  position: fixed; z-index: 40;
  top: calc(0.75rem + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: min(92vw, 480px);
  pointer-events: none;
}
/* mobile: desce pra baixo dos ícones da topbar (regra DEPOIS da base pra vencer por ordem) */
@media (max-width: 899px) {
  .toast-layer { top: calc(56px + env(safe-area-inset-top)); }
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 0.75rem;
  max-width: 100%;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 999px; padding: 0.6rem 1.15rem;
  box-shadow: 0 8px 24px rgba(61, 44, 41, 0.16);
  font-size: 0.9rem; line-height: 1.4;
  animation: card-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transition: opacity 0.3s, transform 0.3s;
}
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast-action {
  border: 0; background: none; cursor: pointer;
  color: #C45A2E; font-weight: 600; white-space: nowrap; padding: 0.25rem 0.4rem;
  border-radius: 8px;
}

/* ---- celebração: o chrome sai de cena (inclui a shelf/tray do baú, que não têm id) ---- */
body.celebrating #topbar,
body.celebrating #panel,
body.celebrating #timer-float,
body.celebrating .inv-bar {
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}

/* ---- movimento reduzido ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
