/* BioEx ApontaPro · estilos (mobile first, tema claro e escuro, cores da marca Aperam) */

:root {
  --brand-1: #64124f;
  --brand-2: #91397e;
  --brand-3: #d38aa1;
  --brand-4: #f66f2e;
  --grad-brand: linear-gradient(90deg, var(--brand-1) 0%, var(--brand-2) 30%, var(--brand-3) 58%, var(--brand-4) 100%);
  --grad-hero: linear-gradient(110deg, #5e1150 0%, #8f2a72 45%, #d9531f 100%);

  --bg: #f7f4f8;
  --surface: #ffffff;
  --surface-2: #f2edf4;
  --surface-3: #e8e0ec;
  --ink: #1f1723;
  --ink-2: #4a3f50;
  --muted: #6f6375;
  --line: #e7e0ea;
  --primary: #741b60;
  --primary-strong: #5a0f4c;
  --on-primary: #ffffff;
  --primary-soft: #f5e5f0;
  --on-primary-soft: #5a0f4c;
  --inverse: #2b2230;
  --on-inverse: #f7f1f9;
  --va: #2f855a;
  --waste: #d94841;
  --inc: #e3a008;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #9a6700;
  --shadow-1: 0 1px 2px rgb(31 23 35 / 5%), 0 2px 8px rgb(31 23 35 / 5%);
  --shadow-2: 0 10px 30px rgb(31 23 35 / 14%);
  --nav-bg: rgb(255 255 255 / 86%);
  --top-bg: rgb(247 244 248 / 84%);

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --nav-h: 68px;
  --top-h: calc(58px + env(safe-area-inset-top));
  --safe-b: env(safe-area-inset-bottom);
  --rail-w: 0px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141016;
    --surface: #1d1820;
    --surface-2: #28212c;
    --surface-3: #352c3a;
    --ink: #f4eef6;
    --ink-2: #d6cadb;
    --muted: #a898ae;
    --line: #342b39;
    --primary: #e8acd8;
    --primary-strong: #f3c8e6;
    --on-primary: #3a0631;
    --primary-soft: #45193f;
    --on-primary-soft: #f8daef;
    --inverse: #f1eaf3;
    --on-inverse: #221b25;
    --va: #4cc38a;
    --waste: #ff7b6f;
    --inc: #f2c14e;
    --danger: #ff8a80;
    --danger-soft: #3d1a1c;
    --warn: #f2c14e;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-2: 0 12px 32px rgb(0 0 0 / 50%);
    --nav-bg: rgb(29 24 32 / 88%);
    --top-bg: rgb(20 16 22 / 84%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141016;
  --surface: #1d1820;
  --surface-2: #28212c;
  --surface-3: #352c3a;
  --ink: #f4eef6;
  --ink-2: #d6cadb;
  --muted: #a898ae;
  --line: #342b39;
  --primary: #e8acd8;
  --primary-strong: #f3c8e6;
  --on-primary: #3a0631;
  --primary-soft: #45193f;
  --on-primary-soft: #f8daef;
  --inverse: #f1eaf3;
  --on-inverse: #221b25;
  --va: #4cc38a;
  --waste: #ff7b6f;
  --inc: #f2c14e;
  --danger: #ff8a80;
  --danger-soft: #3d1a1c;
  --warn: #f2c14e;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 30%);
  --shadow-2: 0 12px 32px rgb(0 0 0 / 50%);
  --nav-bg: rgb(29 24 32 / 88%);
  --top-bg: rgb(20 16 22 / 84%);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-left: var(--rail-w);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px);
  overscroll-behavior-y: none;
}
body.has-mini { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 96px); }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.inline-ic { width: 17px; height: 17px; vertical-align: -3px; }
.muted { color: var(--muted); }
.opt { color: var(--muted); font-weight: 400; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  padding: env(safe-area-inset-top) 16px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--top-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  transition: box-shadow .2s;
}
.topbar.scrolled { box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { height: 24px; width: auto; display: block; }
.logo-white { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-color { display: none; } :root:not([data-theme="light"]) .logo-white { display: block; } }
:root[data-theme="dark"] .logo-color { display: none; }
:root[data-theme="dark"] .logo-white { display: block; }
.brand-sep { width: 1px; height: 26px; background: var(--line); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text span { font-size: 12px; color: var(--muted); }
.net-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.net-chip .ic { width: 15px; height: 15px; }

/* ---------- navegação inferior (vira trilho lateral no desktop) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 6px 4px var(--safe-b);
  display: flex; align-items: stretch; justify-content: space-around;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid var(--line);
  transition: transform .25s var(--ease);
}
.rail-logo { display: none; }
.tab {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px;
  padding: 4px 0 0; border: 0; background: none; color: var(--muted);
}
.tab-ind {
  position: relative;
  width: 60px; height: 32px; border-radius: 999px;
  display: grid; place-items: center;
  transition: background .25s var(--ease), color .2s;
}
.tab .ic { width: 23px; height: 23px; transition: transform .25s var(--ease); }
.tab-label { font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab.active { color: var(--ink); }
.tab.active .tab-ind { background: var(--primary-soft); color: var(--on-primary-soft); }
.tab.active .ic { stroke-width: 2.4; }
.tab:active .ic { transform: scale(.88); }
.tab.active .tab-label { color: var(--primary); font-weight: 750; }
.badge { position: absolute; top: 3px; right: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--waste); box-shadow: 0 0 0 2px var(--nav-bg); }
.badge.live { background: var(--va); animation: pulse 1.6s infinite; }
body.typing .tabbar, body.typing .mini-timer { transform: translateY(150%); }

/* ---------- telas ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 4px 16px 0; }
.screen { display: none; }
.screen.active { display: block; animation: screen-in .28s var(--ease); }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.screen-head { padding: 10px 2px 16px; }
.screen-head h1 { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.025em; }
.screen-head p { margin-top: 4px; color: var(--muted); }
.screen-head.with-action { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head-actions { display: flex; gap: 8px; }

.stack { display: grid; gap: 14px; align-content: start; }
.split { display: grid; gap: 14px; }
/* itens de grid não podem crescer com o conteúdo (ex.: a planilha de 720 px), senão a página inteira desliza para o lado */
.stack, .split, .dash-grid, .settings, .kpis, .area-cards { grid-template-columns: minmax(0, 1fr); }
.stack > *, .split > *, .dash-grid > *, .settings > *, .kpis > *, .area-cards > *, .card { min-width: 0; }

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow-1);
}
.card-title { font-size: 17px; font-weight: 750; letter-spacing: -.01em; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title .ic { color: var(--primary); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head .card-title { margin-bottom: 2px; }
.card-head p { font-size: 13px; }

.notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 10px 12px 14px; margin-bottom: 14px;
  border-radius: var(--r-md);
  background: var(--primary-soft); color: var(--on-primary-soft);
  font-size: 13.5px;
}
.notice > .ic { margin-top: 1px; width: 20px; height: 20px; }
.notice p { flex: 1; }

/* ---------- campos ---------- */
.field { display: grid; gap: 7px; margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.field:last-child { margin-bottom: 0; }
label, legend, .label { font-size: 13.5px; font-weight: 650; color: var(--ink-2); padding: 0; }
legend { margin-bottom: 7px; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
input:not([type="radio"]):not([type="checkbox"]), select, textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px; /* evita zoom no iPhone */
  font-weight: 400;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
input[type="date"], input[type="datetime-local"] { min-width: 0; }
.select { position: relative; }
.select::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; pointer-events: none;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.select select { padding-right: 42px; text-overflow: ellipsis; }
.select.pill select { min-height: 42px; padding: 8px 38px 8px 14px; border-radius: 999px; font-size: 14.5px; font-weight: 600; background: var(--surface); box-shadow: var(--shadow-1); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); background: var(--danger-soft); }
.field.invalid legend, .field.invalid > label, .field.invalid .label-row label { color: var(--danger); }
.field.invalid .choice > span, .field.invalid .chip > span { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.link-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 2px; border: 0; background: none; color: var(--primary); font-size: 13.5px; font-weight: 700; }
.link-btn .ic { width: 17px; height: 17px; }

/* escolhas (rádios estilizados) */
.choice-grid { display: grid; gap: 8px; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice, .chip, .segmented label { position: relative; display: block; margin: 0; }
.choice input, .chip input, .segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; pointer-events: none; }
.choice > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 74px; padding: 10px 6px;
  border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink-2);
  font-size: 13.5px; font-weight: 650; line-height: 1.15;
  cursor: pointer; transition: all .18s var(--ease);
}
.choice > span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 20%, transparent); }
.choice input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: var(--ink); box-shadow: inset 0 0 0 1px var(--c); }
.choice input:focus-visible + span, .chip input:focus-visible + span, .segmented input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }

.chips { display: flex; gap: 8px; }
.chips.wrap { flex-wrap: wrap; }
.chips.scroll { overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; scroll-padding: 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip > span, .chip-btn, .fchip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  min-height: 40px; padding: 8px 14px;
  border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink-2);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .18s var(--ease);
}
.chip input:checked + span, .chip-btn.on { background: var(--primary-soft); border-color: transparent; color: var(--on-primary-soft); }
.chip input:checked + span::before { content: ""; width: 16px; height: 16px; margin-left: -4px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
.chip-btn:active, .chip > span:active { transform: scale(.96); }
.chips.quick { margin-top: 4px; gap: 6px; }
.chips.quick .chip-btn { flex: 1 1 0; min-width: 0; justify-content: center; min-height: 38px; padding: 6px 4px; font-size: 13.5px; }

.segmented { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-2); }
.segmented label { flex: 1 1 0; min-width: 0; }
.segmented span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 42px; padding: 6px 10px; border-radius: 11px;
  font-size: 14px; font-weight: 650; color: var(--muted); cursor: pointer;
  transition: all .2s var(--ease);
}
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.segmented.compact span { min-height: 36px; font-size: 13.5px; padding: 4px 10px; white-space: nowrap; }

.stepper { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; align-items: center; }
.stepper input { text-align: center; font-size: 26px !important; font-weight: 750; font-variant-numeric: tabular-nums; min-height: 60px !important; padding: 8px !important; }
.stepper .icon-btn { width: 52px; height: 52px; background: var(--surface-2); }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

details.more { margin-top: 2px; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details.more > summary { display: flex; align-items: center; gap: 6px; padding: 8px 0; font-weight: 700; color: var(--primary); font-size: 14px; }
details.more > summary span { color: var(--muted); font-weight: 500; }
details.more > summary .ic { width: 18px; height: 18px; transition: transform .2s; }
details[open] > summary .ic:last-child, details[open] > summary .chev { transform: rotate(180deg); }
details.more[open] > summary { margin-bottom: 8px; }
details.help > summary { display: flex; align-items: center; gap: 10px; font-weight: 700; }
details.help > summary .ic:first-child { color: var(--primary); }
details.help > summary .chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
details.help[open] > summary { margin-bottom: 10px; }
details.help ul { margin: 6px 0 0; padding-left: 20px; color: var(--ink-2); display: grid; gap: 6px; }
details.help p { color: var(--ink-2); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px;
  border: 0; border-radius: 16px;
  font-size: 15.5px; font-weight: 700; letter-spacing: .005em;
  background: var(--surface-2); color: var(--ink);
  transition: transform .12s var(--ease), filter .15s, background .15s, opacity .15s;
  user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: 14px; border-radius: 12px; }
.btn.sm .ic { width: 18px; height: 18px; }
.btn.grow { flex: 1 1 auto; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.hero { background: var(--grad-hero); color: #fff; box-shadow: 0 8px 22px rgb(116 27 96 / 30%); }
.btn.tonal { background: var(--primary-soft); color: var(--on-primary-soft); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn.danger { color: #3d0a07; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { color: #3d0a07; } }
.btn.icon-only { width: 56px; padding: 0; flex: none; }
.btn .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 12px; display: inline-grid; place-items: center; }
.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-2);
  transition: background .15s, transform .12s;
}
.icon-btn:active { transform: scale(.92); background: var(--surface-3); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.sm .ic { width: 19px; height: 19px; }
.icon-btn.tonal { background: var(--primary-soft); color: var(--on-primary-soft); }

/* barra de ações presa acima da navegação */
.actionbar {
  position: sticky; z-index: 20;
  bottom: calc(var(--nav-h) + var(--safe-b) + 10px);
  display: flex; gap: 10px; align-items: center;
  margin: 16px -6px 0; padding: 8px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow-2);
  transition: bottom .25s var(--ease);
}
.actionbar .btn { min-height: 56px; border-radius: 18px; font-size: 16px; }
.actionbar .btn .ic { width: 22px; height: 22px; }
#wasteForm .actionbar { grid-column: 1 / -1; }
body.has-mini .actionbar { bottom: calc(var(--nav-h) + var(--safe-b) + 78px); }
#timerActions[data-state="idle"] #pauseBtn, #timerActions[data-state="idle"] #resumeBtn, #timerActions[data-state="idle"] #finishBtn { display: none; }
#timerActions[data-state="running"] #startBtn, #timerActions[data-state="running"] #resumeBtn { display: none; }
#timerActions[data-state="paused"] #startBtn, #timerActions[data-state="paused"] #pauseBtn { display: none; }
#timerActions:not([data-state="idle"]) .grow { flex: 1 1 0; }
#timerActions:not([data-state="idle"]) .btn { font-size: 15px; padding: 10px 12px; }

/* ---------- cronômetro ---------- */
.timer-card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border-radius: 28px;
  padding: 22px 16px 16px;
  box-shadow: var(--shadow-1);
  display: grid; justify-items: center; gap: 14px;
}
.timer-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad-brand); opacity: .9; }
.ring { position: relative; width: min(62vw, 240px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 9; }
.ring-prog { fill: none; stroke: url(#ringGrad); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; transition: stroke-dashoffset .3s linear; }
.ring-prog.no-anim { transition: none; }
.timer-card[data-state="idle"] .ring-prog { stroke-dashoffset: 100; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center; padding: 0 16%; }
.timer-card[data-state="idle"] .ring-prog { opacity: 0; }
.statusline { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); flex: none; }
.dot.live { background: var(--va); animation: pulse 1.6s infinite; }
.timer-card[data-state="paused"] .dot, .mini-timer.paused .dot { background: var(--inc); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--va) 55%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.timer { font-size: clamp(32px, 10.5vw, 44px); font-weight: 800; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.timer-card[data-state="paused"] .timer { animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }
.ring-task { max-width: 100%; font-size: 13.5px; color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-meta { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.timer-meta div { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.timer-meta span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.timer-meta strong { font-size: 17px; font-variant-numeric: tabular-nums; }

/* mini cronômetro flutuante (aparece nas outras abas) */
.mini-timer {
  position: fixed; z-index: 35;
  left: calc(var(--rail-w) + 12px); right: 12px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 10px);
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 8px;
  border-radius: 20px;
  background: var(--inverse); color: var(--on-inverse);
  box-shadow: var(--shadow-2);
  animation: rise .3s var(--ease);
  transition: transform .25s var(--ease);
}
.mini-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 6px 8px; border: 0; background: none; color: inherit; text-align: left; }
.mini-text { min-width: 0; display: grid; line-height: 1.2; }
.mini-text strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.mini-text span { font-size: 12.5px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-timer .icon-btn.tonal { background: color-mix(in srgb, var(--on-inverse) 14%, transparent); color: var(--on-inverse); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- painel ---------- */
.active-filters { margin-bottom: 14px; }
.fchip { background: var(--primary-soft); color: var(--on-primary-soft); border-color: transparent; }
.fchip .ic { width: 16px; height: 16px; }
.fchip.static { background: var(--surface); color: var(--muted); border-color: var(--line); cursor: default; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow-1); display: grid; gap: 4px; align-content: start; }
.kpi-ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--on-primary-soft); margin-bottom: 4px; }
.kpi-ico .ic { width: 19px; height: 19px; }
.kpi.waste .kpi-ico { background: color-mix(in srgb, var(--waste) 16%, var(--surface)); color: var(--waste); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.kpi strong { font-size: 25px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--waste); transition: width .5s var(--ease); }
.dash-grid { display: grid; gap: 14px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { position: relative; width: 148px; aspect-ratio: 1; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 6; transition: stroke-dasharray .6s var(--ease), stroke-dashoffset .6s var(--ease); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.donut-center span { font-size: 12px; color: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; min-width: 150px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; font-size: 14px; }
.legend li b { font-variant-numeric: tabular-nums; }
.legend li small { grid-column: 2 / 4; margin-top: -8px; color: var(--muted); font-size: 12.5px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.legend.inline { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend.inline span { display: inline-flex; align-items: center; gap: 6px; }

.area-cards { display: grid; gap: 10px; }
.area-card { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.area-card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.area-card b { font-size: 15px; }
.area-card .tot { font-weight: 750; font-variant-numeric: tabular-nums; }
.area-card .small { margin-top: 6px; }
.stackbar { display: flex; height: 10px; overflow: hidden; border-radius: 99px; background: var(--surface-3); margin-top: 8px; }
.stackbar span { height: 100%; transition: width .5s var(--ease); }
.small { font-size: 12.5px; color: var(--muted); }

.tablewrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.excel-table { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.excel-table th, .excel-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.excel-table th { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: center; }
.excel-table th:first-child, .excel-table td:first-child { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.excel-table thead th:first-child { background: var(--surface-2); }
.excel-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.excel-table tfoot td { font-weight: 800; background: var(--primary-soft) !important; color: var(--on-primary-soft); border-bottom: 0; }
.excel-table td:last-child { min-width: 140px; }
.excel-table .stackbar { margin: 0; }

.barrow { margin-bottom: 14px; }
.barrow:last-child { margin-bottom: 0; }
.barlabel { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.barlabel b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--waste) 70%, var(--brand-1)), var(--waste)); transition: width .5s var(--ease); }
.insights-card p { margin-bottom: 8px; color: var(--ink-2); }
.insights-card p:last-child { margin-bottom: 0; }
.foot { margin: 14px 2px 0; font-size: 12.5px; color: var(--muted); }

.empty { display: grid; justify-items: center; gap: 8px; padding: 22px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.empty .ic { width: 30px; height: 30px; padding: 10px; box-sizing: content-box; border-radius: 50%; background: var(--surface-2); color: var(--primary); }

/* ---------- registros ---------- */
.toolbar {
  position: sticky; top: var(--top-h); z-index: 15;
  display: grid; gap: 10px;
  margin: 0 -16px 6px; padding: 4px 16px 12px;
  background: var(--bg);
}
.toolbar-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.toolbar-row::-webkit-scrollbar { display: none; }
.toolbar-row .segmented { flex: 1; }
.toolbar-row .select { flex: 1 1 0; min-width: 150px; }
.search { position: relative; display: block; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.search input { padding-left: 44px !important; border-radius: 999px !important; background: var(--surface) !important; box-shadow: var(--shadow-1); }
.search input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent) !important; }
.record-list { display: grid; gap: 8px; }
.day-head { margin: 10px 4px 2px; font-size: 13px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rec {
  --c: var(--muted);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; align-items: start;
  padding: 0 8px 0 0;
  border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-1);
  animation: screen-in .25s var(--ease);
}
.rec-main {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 14px 0 14px 14px; border: 0; border-radius: 20px 0 0 20px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: opacity .15s;
}
.rec-main:active { opacity: .6; }
.rec > .icon-btn { margin-top: 12px; }
.tag.edited { background: var(--surface-2); color: var(--muted); }
.rec[data-class="valor_agregado"] { --c: var(--va); }
.rec[data-class="desperdicio"] { --c: var(--waste); }
.rec[data-class="incidental"] { --c: var(--inc); }
.rec-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--c); }
.rec-ico .ic { width: 21px; height: 21px; }
.rec-body { display: block; min-width: 0; }
.rec-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rec-title { font-size: 15.5px; font-weight: 700; overflow-wrap: anywhere; }
.rec-dur { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.rec-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: 13px; color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 750; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.rec-det { display: block; margin-top: 6px; font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.rec .icon-btn { width: 40px; height: 40px; color: var(--muted); }
.rec .icon-btn:hover { color: var(--danger); }

/* ---------- ajustes ---------- */
.settings { display: grid; gap: 14px; }
.group { background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-1); }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.group-head h2 { display: flex; align-items: center; gap: 10px; font-size: 16.5px; font-weight: 750; }
.group-head h2 .ic { color: var(--primary); width: 20px; height: 20px; }
.group-sub { margin: 4px 0 12px; font-size: 13.5px; color: var(--muted); }
.group-head + .list { margin-top: 12px; }
.list { display: grid; }
.row-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 2px;
  border: 0; border-top: 1px solid var(--line); background: none; text-align: left; width: 100%;
  font-size: 15px; font-weight: 500; color: var(--ink);
}
.list > .row-item:first-child { border-top: 0; }
.row-item.col { flex-direction: column; align-items: stretch; gap: 8px; }
.row-item.action { cursor: pointer; color: var(--primary); font-weight: 650; }
.row-item.action .ic { width: 21px; height: 21px; }
.row-title { display: block; font-weight: 650; }
.row-sub { display: block; font-size: 13px; color: var(--muted); }
.row-item .grow { flex: 1; min-width: 0; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--on-primary-soft); font-weight: 800; font-size: 14px; }
.pin-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.pin-ico .ic { width: 19px; height: 19px; }
.pill-tag { font-size: 11.5px; font-weight: 750; color: var(--muted); background: var(--surface-2); padding: 3px 9px; border-radius: 999px; }
.inline-form { display: flex; gap: 8px; margin-bottom: 4px; }
.inline-form .btn { width: 52px; min-height: 52px; padding: 0; flex: none; }
.switch-row { cursor: pointer; justify-content: space-between; }
.switch { -webkit-appearance: none; appearance: none; width: 52px; height: 32px; flex: none; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform .22s var(--ease); }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(20px); }
.install-card { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(135deg, var(--primary-soft), var(--surface) 70%); }
.install-card img { width: 56px; height: 56px; border-radius: 14px; box-shadow: var(--shadow-1); flex: none; }
.install-card .card-title { margin-bottom: 4px; }
.install-card p { font-size: 13.5px; margin-bottom: 10px; }
.danger-zone h2 .ic { color: var(--danger) !important; }
.about { display: grid; grid-template-columns: 40px 1fr; gap: 6px 14px; align-items: start; font-size: 13.5px; }
.about img { width: 40px; height: auto; grid-row: span 2; }
.about p:last-child { font-size: 12.5px; }

/* ---------- folhas (dialog) ---------- */
dialog.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh;
  margin: auto auto 0; padding: 0; border: 0;
  border-radius: 28px 28px 0 0;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-2);
  overflow: auto; overscroll-behavior: contain;
}
dialog.sheet[open] { animation: sheet-up .32s var(--ease); }
dialog.sheet.closing { animation: sheet-down .18s ease-in forwards; }
dialog.sheet::backdrop { background: rgb(20 10 24 / 45%); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: fade .25s; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-body { display: block; padding: 8px 20px calc(20px + var(--safe-b)); }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: var(--surface-3); margin: 4px auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
#confirmText { margin: 8px 0 4px; color: var(--ink-2); }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet-actions .btn { min-height: 52px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.row2 > .field:last-child { margin-bottom: 16px; }
.edit-meta { margin: -6px 0 16px; font-size: 13px; color: var(--muted); }
fieldset.edit-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.duration { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.duration label { position: relative; display: block; }
.duration input { text-align: center; font-weight: 700; padding-right: 36px !important; font-variant-numeric: tabular-nums; }
.duration span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.sheet-actions.sticky {
  position: sticky; bottom: 0; z-index: 2;
  margin: 20px -20px calc(-20px - var(--safe-b)); padding: 12px 20px calc(16px + var(--safe-b));
  background: var(--surface); box-shadow: 0 -1px 0 var(--line);
}
.card .chips.scroll { margin: 0 -16px; padding: 2px 16px; scroll-padding: 16px; }

/* ---------- avisos (toast) ---------- */
.toasts {
  position: fixed; z-index: 60;
  left: calc(var(--rail-w) + 12px); right: 12px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  display: grid; justify-items: center; gap: 8px; pointer-events: none;
}
body.has-mini .toasts { bottom: calc(var(--nav-h) + var(--safe-b) + 82px); }
body.has-actionbar .toasts { bottom: calc(var(--nav-h) + var(--safe-b) + 94px); }
body.has-actionbar.has-mini .toasts { bottom: calc(var(--nav-h) + var(--safe-b) + 162px); }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  max-width: 520px; width: max-content; max-width: 100%;
  padding: 12px 12px 12px 14px; border-radius: 16px;
  background: var(--inverse); color: var(--on-inverse);
  box-shadow: var(--shadow-2); font-size: 14.5px; font-weight: 550;
  opacity: 0; transform: translateY(12px) scale(.98);
  transition: opacity .22s, transform .22s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast .ic { width: 20px; height: 20px; color: var(--va); }
.toast.warn .ic { color: var(--inc); }
.toast.error .ic { color: var(--waste); }
.toast button { margin-left: 4px; padding: 6px 10px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--on-inverse) 14%, transparent); color: inherit; font-weight: 750; }

/* ---------- telas largas: trilho lateral ---------- */
@media (min-width: 720px) {
  main { padding: 8px 24px 0; }
  .chips.scroll { margin: 0 -24px; padding: 2px 24px; }
  .toolbar { margin: 0 -24px 6px; padding: 4px 24px 12px; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid .wide { grid-column: 1 / -1; }
  .dash-grid > .card:first-child { order: -2; }
  .dash-grid > .insights-card { order: -1; }
  .area-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .toolbar { grid-template-columns: minmax(240px, 1fr) auto auto; align-items: center; }
  .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .install-card, .about { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  :root { --rail-w: 96px; }
  body { padding-bottom: 32px; }
  .tabbar {
    top: 0; right: auto; width: var(--rail-w); height: auto;
    flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: 18px 0 18px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .rail-logo { display: block; width: 34px; height: auto; margin: 0 auto 18px; }
  .tab { flex: none; padding: 6px 0; gap: 5px; }
  .tab-ind { width: 56px; height: 34px; }
  .actionbar { bottom: 16px; }
  body.has-mini .actionbar { bottom: 92px; }
  .mini-timer { bottom: 16px; left: auto; right: 24px; width: 380px; }
  .toasts { bottom: 24px; }
  body.has-mini .toasts { bottom: 96px; }
  body.has-actionbar .toasts { bottom: 104px; }
  body.has-actionbar.has-mini .toasts { bottom: 180px; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
  #apontar .timer-card { position: sticky; top: calc(var(--top-h) + 12px); }
  #apontar .ring { width: 280px; }
  #apontar .timer { font-size: 52px; }
  #timerActions { width: calc((100% - 14px) / 2.15); }
  #wasteForm.split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actionbar { margin-left: 0; margin-right: 0; }
  dialog.sheet { margin: auto; border-radius: 28px; }
  dialog.sheet[open] { animation: pop .25s var(--ease); }
  .sheet-handle { display: none; }
  .sheet-body { padding: 22px 24px 24px; }
  .sheet-actions.sticky { margin: 20px -24px -24px; padding: 14px 24px 20px; }
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

@media (max-width: 374px) {
  .tab-label { font-size: 10.5px; letter-spacing: 0; }
  .tab-ind { width: 52px; }
  .choice > span { font-size: 12.5px; }
}

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