/* ===========================================================================
   Design system extraído de /mockup/index.html — VERBATIM.
   Não reinterpretado: cores, tipografia e espaçamento são os do protótipo.
   Para mudar aparência, mude o mockup primeiro.
   =========================================================================== */

/* =====================================================================
   LISTINHA DE COMPRAS — mockup navegável (sem banco, estado só em memória)
   Design system: tokens do LEV PIZZA OS + lista estilo caderno.
   Ícones 100% SVG (sem emoji). Efeitos: entrada escalonada, risco de
   caneta, saída da linha, confete, spring no sheet.
   ===================================================================== */
:root {
  color-scheme: light;

  --brand-100: #e5dcff;
  --brand-300: #b39cff;
  --brand-500: #7c5cf6;
  --brand-600: #6a46ea;
  --brand-700: #5936cc;
  --brand-ink: #ffffff;
  --brand-grad: linear-gradient(135deg, #7c5cf6 0%, #a543fa 100%);
  --brand-bg:  rgba(124,92,246,0.10);
  --brand-glow: rgba(140,80,250,0.35);

  --page:      #f6f6f4;
  --surface:   #fcfcfb;
  --surface-2: #f4f3f0;
  --surface-3: #ecebe7;

  --ink:   #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #898781;
  --ink-inv: #ffffff;

  --hairline: rgba(11,11,11,0.10);
  --baseline: #c3c2b7;

  /* Categorias (matizes da paleta validada do LEV OS) */
  --c-horti: #008300;  --c-horti-bg: rgba(0,131,0,0.10);
  --c-frios: #c98500;  --c-frios-bg: rgba(237,161,0,0.14);
  --c-merc:  #d95926;  --c-merc-bg:  rgba(235,104,52,0.12);
  --c-beb:   #2a78d6;  --c-beb-bg:   rgba(42,120,214,0.12);
  --c-emb:   #6a46ea;  --c-emb-bg:   rgba(106,70,234,0.11);
  --c-limp:  #148660;  --c-limp-bg:  rgba(27,175,122,0.13);

  /* Sequencial (progresso) */
  --seq-1: #cde2fb; --seq-5: #256abf;

  /* Status — fixos */
  --ok:          #0ca30c;
  --warn:        #fab219;
  --danger:      #d03b3b;
  --ok-text:     #006300;
  --warn-text:   #8a5a00;
  --danger-text: #b02a2a;
  --ok-bg:     rgba(12,163,12,0.10);
  --warn-bg:   rgba(250,178,25,0.14);
  --danger-bg: rgba(208,59,59,0.10);

  --shadow-1: 0 1px 2px rgba(16,16,20,0.05), 0 1px 3px rgba(16,16,20,0.06);
  --shadow-2: 0 4px 12px rgba(16,16,20,0.08), 0 2px 4px rgba(16,16,20,0.05);
  --shadow-3: 0 12px 40px rgba(16,16,20,0.16), 0 4px 12px rgba(16,16,20,0.08);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
  --font: -apple-system, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Arial, system-ui, Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page:      #0d0d0f;
    --surface:   #1a1a1d;
    --surface-2: #222226;
    --surface-3: #2b2b30;
    --ink:   #f4f4f6;
    --ink-2: #b8b7c2;
    --ink-3: #85848f;
    --ink-inv: #0b0b0b;
    --hairline: rgba(255,255,255,0.10);
    --baseline: #3a3a40;
    --c-horti: #3fae3f;  --c-horti-bg: rgba(63,174,63,0.16);
    --c-frios: #e9b04a;  --c-frios-bg: rgba(233,176,74,0.16);
    --c-merc:  #ef7b4d;  --c-merc-bg:  rgba(239,123,77,0.15);
    --c-beb:   #5b9be4;  --c-beb-bg:   rgba(91,155,228,0.16);
    --c-emb:   #9d86ff;  --c-emb-bg:   rgba(157,134,255,0.16);
    --c-limp:  #2cc08c;  --c-limp-bg:  rgba(44,192,140,0.16);
    --seq-1: rgba(57,135,229,.22); --seq-5: #3987e5;
    --ok-text:     #4cc24c;
    --warn-text:   #e9b95c;
    --danger-text: #e66767;
    --ok-bg:     rgba(12,163,12,0.16);
    --warn-bg:   rgba(250,178,25,0.16);
    --danger-bg: rgba(230,103,103,0.14);
    --brand-500: #8f73ff;
    --brand-600: #7c5cf6;
    --brand-bg:  rgba(147,118,255,0.16);
    --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-2: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-3: 0 12px 40px rgba(0,0,0,0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:      #0d0d0f;
  --surface:   #1a1a1d;
  --surface-2: #222226;
  --surface-3: #2b2b30;
  --ink:   #f4f4f6;
  --ink-2: #b8b7c2;
  --ink-3: #85848f;
  --ink-inv: #0b0b0b;
  --hairline: rgba(255,255,255,0.10);
  --baseline: #3a3a40;
  --c-horti: #3fae3f;  --c-horti-bg: rgba(63,174,63,0.16);
  --c-frios: #e9b04a;  --c-frios-bg: rgba(233,176,74,0.16);
  --c-merc:  #ef7b4d;  --c-merc-bg:  rgba(239,123,77,0.15);
  --c-beb:   #5b9be4;  --c-beb-bg:   rgba(91,155,228,0.16);
  --c-emb:   #9d86ff;  --c-emb-bg:   rgba(157,134,255,0.16);
  --c-limp:  #2cc08c;  --c-limp-bg:  rgba(44,192,140,0.16);
  --seq-1: rgba(57,135,229,.22); --seq-5: #3987e5;
  --ok-text:     #4cc24c;
  --warn-text:   #e9b95c;
  --danger-text: #e66767;
  --ok-bg:     rgba(12,163,12,0.16);
  --warn-bg:   rgba(250,178,25,0.16);
  --danger-bg: rgba(230,103,103,0.14);
  --brand-500: #8f73ff;
  --brand-600: #7c5cf6;
  --brand-bg:  rgba(147,118,255,0.16);
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-3: 0 12px 40px rgba(0,0,0,0.6);
}

/* ============ Base ============ */
*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  /* Toques rápidos (stepper, PIN) não podem virar zoom de duplo toque.
     "manipulation" mantém rolagem e pinça, só tira o double-tap zoom. */
  touch-action: manipulation;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px; line-height: 1.5;
  color: var(--ink); background: var(--page);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }
svg.ic { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============ Moldura do app ============ */
#frame {
  max-width: 460px; margin: 0 auto; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--page); position: relative;
}
@media (min-width: 560px) {
  body { padding: 24px 0; }
  #frame {
    height: calc(100dvh - 48px); max-height: 900px;
    border: 1px solid var(--hairline); border-radius: 28px;
    box-shadow: var(--shadow-3); overflow: hidden;
  }
}

/* ============ Header ============ */
#hdr { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; flex: none; }
#hdr .back, #hdr .theme {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  transition: transform .15s, background .15s;
}
#hdr .back:active, #hdr .theme:active { transform: scale(.92); }
#hdr .titles { flex: 1; min-width: 0; }
#hdr h1 { font-size: 17px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
#hdr .sub { font-size: 11.5px; color: var(--ink-3); }

/* ============ Conteúdo ============ */
#view { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; scrollbar-width: thin; }
.anim-in { animation: fadeUp .3s cubic-bezier(.2,.8,.3,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes popIn  { from { opacity: 0; transform: scale(.92) translateY(6px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: popIn .34s cubic-bezier(.2,.8,.3,1) both; animation-delay: calc(var(--i, 0) * 45ms); }

/* ============ Bottom nav ============ */
#tabs {
  flex: none; display: flex;
  background: var(--surface); border-top: 1px solid var(--hairline);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
}
#tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0 4px; border-radius: var(--r-md);
  color: var(--ink-3); text-decoration: none;
  font-size: 10.5px; font-weight: 650; position: relative;
  transition: color .15s, background .2s;
}
#tabs a .ic { font-size: 21px; transition: transform .2s cubic-bezier(.34,1.56,.64,1); }
#tabs a.on { color: var(--brand-600); background: var(--brand-bg); }
#tabs a.on .ic { transform: translateY(-1px) scale(1.08); }
#tabs .badge {
  position: absolute; top: 2px; right: calc(50% - 21px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 750; line-height: 16px; text-align: center;
}

/* ============ Cards ============ */
.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  padding: 14px; margin-bottom: 12px; min-width: 0;
}
.sec-title {
  font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin: 16px 2px 8px; display: flex; align-items: center; gap: 6px;
}
.sec-title .cnt { font-weight: 650; letter-spacing: 0; text-transform: none; }

/* ============ Progresso ============ */
.progress-card { display: flex; flex-direction: column; gap: 9px; }
.progress-top { display: flex; align-items: baseline; gap: 8px; }
.progress-top b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.progress-top span { font-size: 12px; color: var(--ink-3); }
.meter { height: 8px; border-radius: 4px; background: var(--seq-1); overflow: hidden; position: relative; }
.meter > i {
  display: block; height: 100%; border-radius: 4px; background: var(--seq-5);
  transition: width .6s cubic-bezier(.2,.8,.3,1); position: relative; overflow: hidden;
}
.meter > i::after {
  content: ""; position: absolute; inset: 0; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shine 2.6s ease-in-out infinite;
}
@keyframes shine { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(300%); } }
.mini-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; color: var(--ok-text);
  background: var(--ok-bg); border-radius: 999px; padding: 4px 11px;
  transition: transform .15s;
}
.mini-chip:active { transform: scale(.95); }

/* =====================================================================
   LISTA — estilo caderno: um item embaixo do outro, linhas simples
   ===================================================================== */
.paper {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 2px 14px;
  margin: 12px 0;
}
.note-row {
  position: relative; display: flex; flex-direction: column;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer; max-height: 140px; overflow: visible;
  transition: max-height .35s ease, opacity .35s ease, transform .4s ease, background .2s;
  animation: popIn .3s cubic-bezier(.2,.8,.3,1) both;
  animation-delay: calc(var(--i, 0) * 25ms);
}
.note-row:last-child { border-bottom: none; }
.note-row:hover { background: var(--surface-2); }
.note-row.asking { background: var(--brand-bg); border-radius: 10px; }
.line-main { display: flex; align-items: center; gap: 11px; min-height: 50px; padding: 7px 4px; }
.line-main .cat-ic { font-size: 17px; display: grid; place-items: center; }
.nm {
  font-size: 13.5px; font-weight: 650; color: var(--ink); line-height: 1.3;
  letter-spacing: .01em; position: relative;
}
.nm::after { /* risco ao confirmar */
  content: ""; position: absolute; left: -3px; top: 50%; height: 2px; width: 0;
  border-radius: 2px; background: var(--danger);
  transition: width .45s cubic-bezier(.3,.7,.3,1);
}
.note-row.bought .nm::after { width: calc(100% + 6px); }
.note-row.bought .nm, .note-row.bought .qt { opacity: .5; }
.note-row.leave {
  transform: translateX(72%); opacity: 0; max-height: 0;
  border-color: transparent; pointer-events: none;
}
.qt {
  margin-left: auto; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); white-space: nowrap;
}
.pendtag {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font); font-size: 10.5px; font-weight: 750;
  color: var(--warn-text); background: var(--warn-bg);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.pendtag .ic { font-size: 11px; }

.confirm-bar {
  display: flex; align-items: center; gap: 8px;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .28s cubic-bezier(.2,.8,.3,1), opacity .22s, padding .28s;
  padding: 0 4px; font-size: 12px; color: var(--ink-2);
}
.note-row.asking .confirm-bar { max-height: 54px; opacity: 1; padding: 2px 4px 12px; }
.confirm-bar .q { flex: 1; font-weight: 650; }
.cbtn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 13px; border-radius: 11px;
  font-size: 12.5px; font-weight: 750; transition: transform .12s;
}
.cbtn:active { transform: scale(.94); }
.cbtn.yes { background: var(--ok); color: #fff; box-shadow: 0 3px 10px rgba(12,163,12,.3); }
.cbtn.no  { background: var(--surface-2); border: 1px solid var(--hairline); color: var(--ink-2); }

/* Estado "tudo comprado" + confete */
.done-state { position: relative; text-align: center; padding: 30px 12px 16px; overflow: hidden; }
.done-state .spark {
  width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 20px;
  background: var(--brand-grad); color: #fff; display: grid; place-items: center;
  font-size: 30px; box-shadow: 0 8px 26px var(--brand-glow);
  animation: bounceIn .55s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes bounceIn { from { opacity: 0; transform: scale(.3) rotate(-14deg); } to { opacity: 1; transform: none; } }
.done-state h3 { font-size: 17px; font-weight: 800; }
.done-state p { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  position: absolute; top: -12px; width: 7px; height: 11px; border-radius: 2px;
  opacity: 0; animation: fall 1.5s ease-in both; animation-delay: var(--d);
  left: var(--x); background: var(--c); transform: rotate(20deg);
}
@keyframes fall {
  0% { opacity: 0; transform: translateY(0) rotate(0); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translateY(190px) rotate(300deg); }
}

/* ============ Banner ============ */
.banner {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: var(--r-md); padding: 11px 13px; margin-bottom: 12px;
  font-size: 12.5px; line-height: 1.45;
}
.banner.warn { background: var(--warn-bg); color: var(--warn-text); }
.banner.brand { background: var(--brand-bg); color: var(--brand-600); }
.banner b { font-weight: 750; }
.banner .ic { font-size: 17px; margin-top: 1px; }

/* ============ Botões ============ */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 16px; border-radius: 14px;
  font-size: 14.5px; font-weight: 750; letter-spacing: -.01em;
  transition: transform .14s, box-shadow .2s, filter .15s;
}
.btn .ic { font-size: 17px; }
.btn:active { transform: scale(.975); }
.btn.primary { background: var(--brand-grad); color: var(--brand-ink); box-shadow: 0 6px 20px var(--brand-glow); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--surface-2); border: 1px solid var(--hairline); color: var(--ink-2); }
.btn.ok { background: var(--ok); color: #fff; box-shadow: 0 6px 18px rgba(12,163,12,.32); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.sticky-cta {
  position: sticky; bottom: 0; margin: 8px -16px -16px; padding: 12px 16px;
  background: linear-gradient(to top, var(--page) 62%, transparent);
}

/* ============ Busca & chips ============ */
.search {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 10px 13px; margin-bottom: 10px;
  box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .2s;
}
.search:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-bg); }
.search .ic { font-size: 16px; color: var(--ink-3); }
.search input { flex: 1; border: none; background: none; outline: none; font-size: 14px; min-width: 0; }
.search input::placeholder { color: var(--ink-3); }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--ink-2);
  transition: transform .12s, background .15s;
}
.chip:active { transform: scale(.95); }
.chip .ic { font-size: 14px; }
.chip.on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* ============ Linha de escolha (montar) ============ */
.pick-row {
  display: flex; flex-direction: column; align-items: stretch;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 9px 11px; margin-bottom: 7px;
  box-shadow: var(--shadow-1); min-height: 58px;
  transition: border-color .15s, background .2s, transform .12s;
}
.pick-row.sel { border-color: var(--brand-500); background: var(--brand-bg); }
.pick-main { display: flex; align-items: center; gap: 11px; min-height: 40px; }

/* Tags de urgência (na solicitação) */
.urg-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 9px 2px 3px; }
.urg {
  font-size: 10.5px; font-weight: 800; letter-spacing: .03em;
  padding: 6px 11px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--hairline); color: var(--ink-3);
  transition: transform .12s, background .15s, color .15s, border-color .15s;
}
.urg:active { transform: scale(.93); }
.urg.zerou.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.urg.hoje.on  { background: var(--warn);  border-color: var(--warn);  color: #4a3600; }
.urg.fds.on   { background: var(--ok);    border-color: var(--ok);    color: #fff; }
.urg.obsbtn { display: inline-flex; align-items: center; gap: 4px; }
.urg.obsbtn.on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.obs-inline { padding: 6px 2px 4px; }
.obs-inline input {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  font-size: 12.5px; outline: none;
}
.obs-inline input:focus { border-color: var(--brand-500); }

/* Tags e observação exibidas na lista */
.urgtag {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: .02em;
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.urgtag.zerou { background: var(--danger-bg); color: var(--danger-text); }
.urgtag.hoje  { background: var(--warn-bg);   color: var(--warn-text); }
.urgtag.fds   { background: var(--ok-bg);     color: var(--ok-text); }
.obs-line {
  font-size: 11.5px; color: var(--ink-3); font-style: italic;
  padding: 0 4px 9px 32px; margin-top: -5px;
}
.urg-summary { display: flex; gap: 6px; flex-wrap: wrap; }
.tile {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 20px;
}
.pick-row .info { flex: 1; min-width: 0; }
.pick-row .nome { font-weight: 650; font-size: 14px; }
.pick-row .un { font-size: 11.5px; color: var(--ink-3); }
.stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.stepper button {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  display: grid; place-items: center; font-size: 15px; color: var(--ink-2);
  transition: transform .12s, background .15s;
}
.stepper button:active { transform: scale(.88); }
.stepper button.add { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.stepper .q { min-width: 30px; text-align: center; font-weight: 750; font-size: 14.5px; }

.sum-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--brand-grad); color: #fff;
  border-radius: 14px; padding: 12px 16px;
  box-shadow: 0 8px 24px var(--brand-glow);
  width: 100%; text-align: left;
  transition: transform .14s;
  animation: popIn .3s cubic-bezier(.34,1.56,.64,1) both;
}
.sum-bar:active { transform: scale(.98); }
.sum-bar .n { font-size: 15px; font-weight: 780; }
.sum-bar .lbl { font-size: 11.5px; opacity: .85; }
.sum-bar .go { margin-left: auto; font-weight: 750; font-size: 14px; display: flex; align-items: center; gap: 5px; }

/* ============ Home ============ */
.home-hero { position: relative; text-align: center; padding: 36px 0 24px; }
.hero-glow {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 240px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-glow), transparent 66%);
  filter: blur(28px); pointer-events: none;
}
.home-logo {
  position: relative; width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 24px;
  background: var(--brand-grad); color: #fff; display: grid; place-items: center;
  font-size: 36px; box-shadow: 0 10px 30px var(--brand-glow);
  animation: float 4.5s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.home-hero h2 { position: relative; font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.home-hero p { position: relative; font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.role-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: 17px 16px; margin-bottom: 11px;
  box-shadow: var(--shadow-1); transition: transform .16s, box-shadow .2s, border-color .15s;
}
.role-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--brand-300); }
.role-card:active { transform: scale(.98); }
.role-card .tile { background: var(--brand-bg); color: var(--brand-600); }
.role-card .t { font-size: 15px; font-weight: 750; }
.role-card .d { font-size: 12px; color: var(--ink-3); }
.role-card .arr { margin-left: auto; color: var(--ink-3); font-size: 17px; }

/* ============ Login ============ */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 17px;
}
.avatar.lg { width: 64px; height: 64px; font-size: 24px; margin: 0 auto 10px; box-shadow: var(--shadow-2); }
.userbtn {
  width: 34px; height: 34px; border-radius: 50%; flex: none; padding: 0;
  display: grid; place-items: center; overflow: hidden;
  transition: transform .15s; border: 2px solid var(--hairline);
}
.userbtn:active { transform: scale(.9); }
.avatar-sm {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 13.5px;
}
.pin-view { text-align: center; padding-top: 14px; }
.pin-view h3 { font-size: 18px; font-weight: 780; }
.pin-view .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.pin-dots { display: flex; gap: 15px; justify-content: center; margin: 20px 0 24px; }
.pin-dots i {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--baseline); transition: background .15s, border-color .15s, transform .15s;
}
.pin-dots i.f { background: var(--brand-600); border-color: var(--brand-600); transform: scale(1.2); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 262px; margin: 0 auto; }
.pad button {
  height: 56px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--hairline);
  font-size: 20px; font-weight: 700; box-shadow: var(--shadow-1);
  display: grid; place-items: center;
  transition: transform .1s, background .15s;
}
.pad button:active { transform: scale(.9); background: var(--brand-bg); }
.pad button.mudo { background: none; border: none; box-shadow: none; }
.login-hint { text-align: center; font-size: 11.5px; color: var(--ink-3); margin-top: 18px; }
.login-troca { display: block; margin: 14px auto 0; font-size: 12.5px; font-weight: 700; color: var(--brand-600); }

/* ============ Histórico ============ */
.hist-card {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: 13px 14px; margin-bottom: 9px; box-shadow: var(--shadow-1);
  transition: transform .14s, box-shadow .2s;
}
.hist-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.ring-wrap { position: relative; width: 46px; height: 46px; flex: none; }
.ring-wrap svg { width: 46px; height: 46px; }
.ring-wrap .tr { fill: none; stroke: var(--surface-3); stroke-width: 3.6; }
.ring-wrap .pr { fill: none; stroke-width: 3.6; stroke-linecap: round; }
.ring-wrap .dt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.hist-card .info { flex: 1; min-width: 0; }
.hist-card .t { font-weight: 700; font-size: 13.5px; }
.hist-card .d { font-size: 11.5px; color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 750; border-radius: 999px; padding: 3px 9px; }
.pill .ic { font-size: 11px; }
.pill.ok { background: var(--ok-bg); color: var(--ok-text); }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); }

/* ============ Itens (catálogo) ============ */
.item-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 9px 11px; margin-bottom: 7px; box-shadow: var(--shadow-1);
}
.item-row .info { flex: 1; min-width: 0; }
.item-row .nome { font-weight: 650; font-size: 13.5px; }
.item-row .un { font-size: 11.5px; color: var(--ink-3); }
.item-row.off .nome { color: var(--ink-3); text-decoration: line-through; }
.item-row.off .tile { filter: grayscale(1); opacity: .55; }
.switch {
  width: 40px; height: 24px; border-radius: 999px; flex: none;
  background: var(--surface-3); border: 1px solid var(--hairline);
  position: relative; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-1);
  transition: left .2s cubic-bezier(.34,1.56,.64,1);
}
.switch.on { background: var(--ok); border-color: var(--ok); }
.switch.on::after { left: 18px; }

/* ============ Empty state ============ */
.empty { text-align: center; padding: 44px 20px 20px; }
.empty .big {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 24px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  display: grid; place-items: center; font-size: 34px; color: var(--ink-3);
}
.empty h3 { font-size: 16px; font-weight: 750; }
.empty p { font-size: 12.5px; color: var(--ink-3); margin: 5px 0 18px; }

/* ============ Sheet ============ */
#backdrop {
  position: fixed; inset: 0; background: rgba(10,10,14,.45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 40;
}
#backdrop.open { opacity: 1; pointer-events: auto; }
#sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 105%);
  width: 100%; max-width: 460px; z-index: 50;
  background: var(--surface); border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-3); padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  transition: transform .38s cubic-bezier(.32,1.25,.5,1);
  max-height: 82dvh; overflow-y: auto;
}
#sheet.open { transform: translate(-50%, 0); }
#sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--baseline); margin: 4px auto 14px; }
#sheet h3 { font-size: 16.5px; font-weight: 780; letter-spacing: -.01em; margin-bottom: 4px; }
#sheet .sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }
.sheet-list { margin: 10px 0 16px; }
.sheet-list li {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--hairline);
}
.sheet-list li:last-child { border-bottom: none; }
.sheet-list .ci { font-size: 15px; }
.sheet-list .q { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.sheet-list .undo-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: auto; padding: 5px 11px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
}

.f-label { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 12px 2px 5px; }
.f-input, .f-select {
  width: 100%; padding: 11px 13px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--hairline); outline: none; font-size: 14px;
  transition: border-color .15s, box-shadow .2s;
}
.f-input:focus, .f-select:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-bg); }

/* ============ Toast ============ */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px);
  max-width: 420px; width: calc(100% - 48px); z-index: 60;
  background: var(--ink); color: var(--ink-inv);
  border-radius: 14px; padding: 11px 16px; box-shadow: var(--shadow-3);
  font-size: 13.5px; font-weight: 650;
  display: flex; align-items: center; gap: 10px; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .22s, transform .25s cubic-bezier(.34,1.56,.64,1);
}
#toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#toast .t-act {
  flex: none; font-weight: 800; font-size: 12.5px; letter-spacing: .02em;
  color: var(--brand-300); text-transform: uppercase; padding: 3px 6px;
}

.obs {
  width: 100%; min-height: 74px; resize: vertical;
  padding: 11px 13px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--hairline);
  outline: none; font-size: 13.5px; transition: border-color .15s, box-shadow .2s;
}
.obs:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-bg); }

/* ============ Equipe (admin) ============ */
.chk { cursor: pointer; }
.chk input { display: none; }
.chk input:checked ~ .switch { background: var(--ok); border-color: var(--ok); }
.chk input:checked ~ .switch::after { left: 18px; }
.cat-toggle {
  font-size: 10.5px; font-weight: 750; letter-spacing: .04em;
  color: var(--brand-600); background: var(--brand-bg);
  border-radius: 999px; padding: 3px 10px;
}
.cor-opts { display: flex; gap: 10px; padding: 4px 2px; }
.cor-opt input { display: none; }
.cor-opt span {
  display: block; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid transparent; transition: transform .12s, box-shadow .15s;
}
.cor-opt input:checked + span {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand-500);
}
.pin-reset { display: flex; gap: 8px; margin-top: 14px; }
.pin-reset .f-input { flex: 1; }
.pin-reset .btn { width: auto; flex: none; padding: 11px 14px; font-size: 13px; }

/* ============ Versão ============ */
/* Marca d'água no canto inferior direito do frame. Fica sobre a faixa de
   respiro do #tabs (ou do próprio frame, nas telas sem abas) e nunca captura
   toque, então não atrapalha nenhum controle embaixo dela. */
#ver {
  position: absolute; right: 9px; bottom: calc(3px + env(safe-area-inset-bottom));
  font-size: 9px; font-weight: 650; letter-spacing: .02em;
  color: var(--ink-3); opacity: .45;
  pointer-events: none; user-select: none;
}

/* ============ Toque (celular) ============ */
/* O iPhone dá zoom ao focar campo com letra menor que 16px.
   Em tela de toque, todo campo de texto sobe para 16px. */
@media (pointer: coarse) {
  input[type="text"], input[type="search"], input:not([type]),
  select, textarea, .f-input, .f-select, .obs, .search input, .obs-inline input {
    font-size: 16px;
  }
}
