/* Oryon Mobile: o aspeto Oryon (azul-aço, claro e escuro) num ecrã estreito.
   Listas agrupadas como no telemóvel; a cor só onde há estado ou problema; a planta da fábrica é o elemento próprio. */
:root {
  --brand: #0369a1; --brand-press: #035c8e; --on-brand: #fff; --brand-soft: #e6f1f8;
  --page: #f2f2f4; --surface: #fff; --fill: #ececef; --ink: #1d1d1f; --ink-2: #5b5b62; --line: #e3e3e8;
  --ok: #137a3b; --warn: #9a5b06; --err: #c42626; --none: #6b6b73; --err-bg: #fdeeee; --on-state: #fff;
  --floor: #f8f9fb; --floor-dot: #d3dae2;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --serif: "Instrument Serif", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --r: 16px; --ease: cubic-bezier(.2, .8, .2, 1); color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #38a3d9; --brand-press: #5bb6e3; --on-brand: #0b1a24; --brand-soft: #14293a;
    --page: #0f0f10; --surface: #1c1c1e; --fill: #2a2a2d; --ink: #f5f5f7; --ink-2: #a1a1a8; --line: #2e2e31;
    --ok: #4ade80; --warn: #fbbf24; --err: #f87171; --none: #a1a1a8; --err-bg: #2c1717; --on-state: #111113;
    --floor: #161618; --floor-dot: #303236;
  }
}
@media (prefers-contrast: more) {
  :root { --ink-2: #3a3a40; --line: #b8b8c0; --floor-dot: #a9b3bd; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --ink-2: #d0d0d6; --line: #5a5a60; --floor-dot: #55585e; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--page); color: var(--ink); font: 1.0625rem/1.45 var(--font); -webkit-font-smoothing: antialiased;
  padding: 0 0 calc(88px + env(safe-area-inset-bottom)); }
main { max-width: 560px; margin: 0 auto; padding: 0 16px; }
h1 { font: 400 2rem/1.15 var(--serif); margin: 0 0 12px; }
h1.large { font-size: 2.25rem; margin: 20px 2px 2px; letter-spacing: -.005em; }
h2 { font-size: 1.25rem; font-weight: 650; line-height: 1.25; margin: 32px 0 10px; padding: 0 4px;
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
h2 .muted { font-size: .9375rem; font-weight: 400; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-2); font-weight: 400; }
.small { font-size: .8125rem; }
.note { font-size: .8125rem; color: var(--ink-2); margin: 8px 4px 0; }
.top-note { margin: 4px 4px 12px; }
b, td, .val, .kpi b { font-variant-numeric: tabular-nums; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---- barra de cima: só a marca e atualizar (o título grande fica no conteúdo) */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: calc(6px + env(safe-area-inset-top)) 6px 6px 16px; background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.top .mark img { display: block; }
.who { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.word { font-weight: 600; font-size: .75rem; letter-spacing: .24em; text-transform: uppercase; }
.factory { font-size: .9375rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- botões */
button { font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 12px 20px; min-height: 50px;
  background: var(--brand); color: var(--on-brand); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s var(--ease), background-color .15s, opacity .15s; }
button:active { background: var(--brand-press); transform: scale(.97); }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: var(--fill); color: var(--ink); }
button.ghost:active { background: color-mix(in srgb, var(--fill) 85%, var(--ink)); }
button.small { min-height: 44px; padding: 8px 16px; font-size: .9375rem; font-weight: 500; }
button.danger { color: var(--err); }
button.icon { background: transparent; color: var(--brand); padding: 0; width: 44px; min-height: 44px; border-radius: 50%; }
button.icon:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
button.icon .ic { width: 22px; height: 22px; }
button.spin .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input { font: inherit; width: 100%; min-height: 50px; padding: 12px 14px; border: 0; border-radius: 12px;
  background: var(--fill); color: var(--ink); margin: 6px 0 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- frescura: um ponto vivo, ou a caixa quando o Hub deixa de enviar */
.fresh { font-size: .875rem; color: var(--ink-2); display: flex; align-items: center; gap: 8px; margin: 0 4px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); flex: none; }
.live.off { background: var(--none); box-shadow: none; }
.fresh.stale { color: var(--err); margin: 8px 0 0; }
.fresh .box { display: flex; gap: 12px; align-items: flex-start; background: var(--err-bg); border-radius: var(--r); padding: 14px 16px; width: 100%; }
.fresh .box .ic { margin-top: 2px; }
.fresh .box b { display: block; }

/* ---- grupos: um contentor por secção, linhas separadas por um fio que começa depois do ícone */
.card, .group, .floor { background: var(--surface); border-radius: var(--r); }
.card { padding: 16px; margin: 16px 0; }
.group { overflow: hidden; }
.group > * { position: relative; }
.group > * + *::before { content: ''; position: absolute; top: 0; right: 0; left: 16px; border-top: 1px solid var(--line); }
.group > .it.mach + *::before, .group > .it.alert + *::before { left: 60px; }
details summary { cursor: pointer; color: var(--brand); padding: 10px 0; min-height: 44px; }

/* ---- ligar */
.pair-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 4px 0 16px; }
.pair-ic .ic { width: 28px; height: 28px; }
#v-pair .card, #v-lock .card { margin-top: 24px; padding: 24px 20px; }
#v-lock .row { margin: 20px 0 8px; }
#unlock { width: 100%; }
/* longe do «Desbloquear» (um toque ao lado não apaga a ligação) e com ar de ligação, não de botão */
#lock-forget { display: block; margin: 72px auto 0; background: none; text-decoration: underline; text-underline-offset: 3px; }
body.veil main, body.veil .tabs { visibility: hidden; }   /* fora da app, com o bloqueio ligado */
.wait-code { font: 700 2.75rem/1.1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .3em; font-variant-numeric: tabular-nums; margin: 20px 0 12px; }

/* ---- linhas */
.it { padding: 12px 16px; min-height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-content: center; }
.it .name { font-weight: 600; overflow-wrap: anywhere; }
.it .sub { grid-column: 1 / -1; color: var(--ink-2); font-size: .9375rem; overflow-wrap: anywhere; }
.it .val { text-align: right; font-weight: 600; white-space: nowrap; }
.it.mach, .it.alert { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.it .mid { display: grid; gap: 1px; min-width: 0; }
.it .mid .sub { grid-column: auto; }
.it.mach progress { margin-top: 8px; }
.it.mach .val { font-size: .9375rem; font-weight: 500; color: var(--ink-2); }
.empty { color: var(--ink-2); font-size: .9375rem; padding: 14px 16px; margin: 0; }
.more { color: var(--ink-2); font-size: .9375rem; padding: 12px 16px; margin: 0; }
.ok-t { color: var(--ok); } .err-t { color: var(--err); } .warn-t { color: var(--warn); } .none-t { color: var(--ink-2); }

/* ---- estado: um ícone num quadrado de cor (o mesmo da planta) */
.badge { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--none); color: var(--on-state); }
.badge.ok { background: var(--ok); } .badge.warn { background: var(--warn); } .badge.err { background: var(--err); }
.badge .ic { width: 17px; height: 17px; stroke-width: 2.1; }
.badge.ok .ic { fill: currentColor; }
progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 3px; overflow: hidden;
  background: var(--fill); color: var(--brand); }
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 3px; }

/* ---- hoje: quatro números num só contentor */
.stats { display: grid; grid-template-columns: 1fr 1fr; }
.stats > * + *::before { content: none; }
.kpi { padding: 14px 16px 16px; min-width: 0; }
.kpi:nth-child(odd) { border-right: 1px solid var(--line); }
.kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
.kpi:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
.kpi b { display: block; font-size: 1.75rem; font-weight: 650; line-height: 1.15; letter-spacing: -.01em; }
.kpi span { display: block; font-size: .875rem; color: var(--ink-2); margin-top: 2px; line-height: 1.3; }
.kpi small { display: block; font-size: .875rem; font-weight: 600; margin-top: 6px; }
.kpi.err b { color: var(--err); } .kpi.warn b { color: var(--warn); }
.kpi.sk { height: 104px; }
.kpi.sk i { display: block; height: 24px; width: 40%; border-radius: 6px; background: var(--fill); }
.kpi.sk i + i { height: 12px; width: 70%; margin-top: 14px; }
.empty-big { grid-column: 1 / -1; display: grid; justify-items: center; text-align: center; gap: 4px; padding: 32px 16px; color: var(--ink-2); }
.empty-big .ic { width: 28px; height: 28px; margin-bottom: 6px; }
.empty-big b { color: var(--ink); }

/* ---- a planta: o chão em ponteado, uma casa por máquina. Casas neutras; só a avaria acende.
   O estado vai no ícone, no texto e na legenda (nunca só a cor). */
.floor { overflow: hidden; }
.plan { padding: 6px 4px; background-color: var(--floor); border-bottom: 1px solid var(--line);
  background-image: radial-gradient(var(--floor-dot) 1px, transparent 1.3px); background-size: 14px 14px; background-position: 7px 7px; }
.plan svg { display: block; overflow: visible; }
.plan .spot { fill: none; stroke: var(--floor-dot); stroke-width: 1.25; stroke-dasharray: 3 4; }
.plan .m { cursor: pointer; outline: none; }
.plan .m .b { fill: var(--surface); stroke: var(--line); stroke-width: 1; transition: stroke .15s, fill .15s; }
.plan .m.err .b { fill: var(--err-bg); stroke: var(--err); stroke-width: 1.5; }
.plan .m .dot { fill: var(--none); }
.plan .m.ok .dot { fill: var(--ok); } .plan .m.warn .dot { fill: var(--warn); } .plan .m.err .dot { fill: var(--err); }
.plan .m .gl { color: var(--on-state); fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.plan .m.ok .gl { fill: currentColor; }
.plan .m.sel .b, .plan .m:focus-visible .b { stroke: var(--brand); stroke-width: 2.5; }
.plan .m:active .b { fill: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.plan text { fill: var(--ink); font-family: var(--font); pointer-events: none; }
.plan .nm { font-size: 13px; font-weight: 600; }
.plan .nm.sm { font-size: 12px; }
.plan .st { font-size: 12px; font-weight: 500; fill: var(--ink-2); }
.plan .m.warn .st { fill: var(--warn); } .plan .m.err .st { fill: var(--err); }
.plan .pct { font-size: 12px; font-weight: 600; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.plan .track { fill: var(--fill); } .plan .fill { fill: var(--brand); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px; font-size: .875rem; color: var(--ink-2); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg .ic { width: 16px; height: 16px; color: var(--none); }
.lg.ok .ic { color: var(--ok); fill: currentColor; } .lg.warn .ic { color: var(--warn); } .lg.err .ic { color: var(--err); }
.lg b { color: var(--ink); }
.detail { border-top: 1px solid var(--line); padding: 14px 16px 16px; }
.d-top { display: flex; align-items: center; gap: 12px; }
.d-top .icon { color: var(--ink-2); margin: -6px -8px -6px 0; }
.d-name { flex: 1; min-width: 0; }
.d-name b { display: block; overflow-wrap: anywhere; }
.d-name span { font-size: .9375rem; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 14px 0 0; font-size: .9375rem; }
.detail dt { color: var(--ink-2); }
.detail dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.d-bar { display: grid; gap: 6px; }
.d-bar progress { margin-top: 8px; }
.d-bar span { font-size: .8125rem; color: var(--ink-2); }
.detail p { margin: 12px 0 0; }
.d-h { font-size: .9375rem; font-weight: 600; margin: 18px 0 8px; }
.day { display: block; overflow: visible; }
.day .track { fill: var(--fill); }
.day .ok { fill: var(--ok); } .day .warn { fill: var(--warn); } .day .err { fill: var(--err); }
.day .now { fill: var(--ink); }
.day text { font: 500 12px var(--font); fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.d-sum { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .875rem; color: var(--ink-2); }
.d-stops { list-style: none; margin: 10px 0 0; padding: 0; font-size: .9375rem; }
.d-stops li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.d-stops li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- semana */
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8125rem; font-weight: 500; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--ink-2); }
td:not(:first-child), th:not(:first-child) { text-align: right; }
.app { margin: 0 0 12px; }
.app h3 { font-size: 1rem; margin: 0 0 8px; }
.app .rows { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9375rem; }
.app .rows b { text-align: right; min-width: 2ch; }
.app .rows span { color: var(--ink-2); }

.foot { margin-top: 36px; }
.foot .danger { margin-top: 12px; }

/* ---- separadores em baixo: ícone + uma palavra; o atual na cor da marca */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.tabs button { background: transparent; color: var(--ink-2); font-size: .75rem; font-weight: 500; padding: 6px 4px; display: grid;
  justify-items: center; align-content: center; gap: 2px; min-height: 54px; border-radius: 12px; }
.tabs button:active { background: transparent; transform: scale(.94); }
.tabs button .ic { width: 26px; height: 26px; }
.tabs button[aria-current="page"] { color: var(--brand); font-weight: 600; }
.tabs button[aria-current="page"] .ic { stroke-width: 2.1; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30; max-width: 528px;
  margin: 0 auto; background: var(--ink); color: var(--page); padding: 12px 16px; border-radius: 14px; font-size: .9375rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / .18); }

@media (prefers-reduced-motion: no-preference) {
  .detail:not([hidden]) { animation: up .22s var(--ease-out); }
  .toast:not([hidden]) { animation: o-toast .26s var(--spring); }
  @keyframes up { from { transform: translateY(6px); opacity: 0; } }
  @keyframes o-toast { from { opacity: 0; translate: 0 .75rem; scale: .96; } }
  .kpi.sk i { background: linear-gradient(90deg, var(--fill) 0%, color-mix(in srgb, var(--fill) 40%, var(--surface)) 50%, var(--fill) 100%);
    background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
  @keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .top { background: var(--page); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabs { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
#floor, #machines { scroll-margin-top: 64px; }   /* abaixo da barra de cima, ao abrir pelo aviso */

/* ---- a identidade Oryon (05/11), a mesma das apps da fábrica e do Portal ----
   - no claro, o papel ligeiramente quente do Oryon Quote; os contentores com um fio fino;
   - por trás do título grande, a grelha milimétrica do papel técnico a desvanecer; por baixo, uma cota com o ponto da cor
     Oryon, que se desenha de novo a cada separador;
   - os números de «Hoje» com marcas de canto de desenho; quando um muda sozinho, o traço da cor Oryon passa por cima
     dele e o número conta até ao novo (motion.js).
   Movimento: ao abrir um separador, o conteúdo entra em cascata; na planta, as máquinas acendem uma a uma e as barras
   crescem até onde a obra vai; o separador escolhido dá um pequeno salto. Com «reduzir movimento», nada se mexe. */
:root { --edge: #8a867e; --spring: cubic-bezier(.34, 1.3, .64, 1);
  --bp-minor: color-mix(in srgb, var(--ink) 3.5%, transparent); --bp-major: color-mix(in srgb, var(--ink) 7%, transparent); }
@media (prefers-color-scheme: light) { :root { --page: #f5f4f1; --fill: #edece8; --line: #e7e5e0; } }
@media (prefers-color-scheme: dark) { :root { --edge: #75757d; } }
main { position: relative; isolation: isolate; }
#v-app::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 200px; z-index: -1; pointer-events: none;
  background:
    linear-gradient(var(--bp-major) 1px, transparent 1px) 0 0 / 50px 50px,
    linear-gradient(90deg, var(--bp-major) 1px, transparent 1px) 0 0 / 50px 50px,
    linear-gradient(var(--bp-minor) 1px, transparent 1px) 0 0 / 10px 10px,
    linear-gradient(90deg, var(--bp-minor) 1px, transparent 1px) 0 0 / 10px 10px;
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 10% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 100% at 10% 0%, #000 0%, transparent 75%); }
h1.large { width: fit-content; max-width: 100%; }
h1.large::after { content: ""; display: block; height: 7px; margin-top: .45rem; opacity: .6; min-width: 3rem;
  background:
    linear-gradient(var(--edge), var(--edge)) 0 50% / 100% 1px no-repeat,
    linear-gradient(var(--edge), var(--edge)) 0 0 / 1px 100% no-repeat,
    linear-gradient(var(--edge), var(--edge)) 100% 0 / 1px 100% no-repeat,
    linear-gradient(var(--brand), var(--brand)) 50% 50% / 5px 5px no-repeat; }
.card, .group, .floor { border: 1px solid var(--line); }
.stats { position: relative; }
.stats::after { content: ""; position: absolute; inset: 5px; pointer-events: none; opacity: .55; --m: var(--edge);
  background:
    linear-gradient(var(--m), var(--m)) 0 0 / 8px 1px no-repeat, linear-gradient(var(--m), var(--m)) 0 0 / 1px 8px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 0 / 8px 1px no-repeat, linear-gradient(var(--m), var(--m)) 100% 0 / 1px 8px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 100% / 8px 1px no-repeat, linear-gradient(var(--m), var(--m)) 0 100% / 1px 8px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 8px 1px no-repeat, linear-gradient(var(--m), var(--m)) 100% 100% / 1px 8px no-repeat; }
.kpi { position: relative; }
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--brand);
  transform: scaleX(0); transform-origin: left center; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .top .mark { animation: o-settle .6s var(--spring) .05s both; }
  /* 1.ª vez em cada separador (main.enter, motion.js): tudo assente em ~0,7 s; nas seguintes aparece logo */
  main.enter h1.large::after { transform-origin: 50% 50%; animation: o-dim .45s var(--ease) .06s both; }
  main.enter > section:not([hidden]) > :nth-child(-n+4) { animation: o-rise .3s var(--ease) both; }
  main.enter > section:not([hidden]) > :nth-child(2) { animation-delay: 40ms; } main.enter > section:not([hidden]) > :nth-child(3) { animation-delay: 80ms; }
  main.enter > section:not([hidden]) > :nth-child(4) { animation-delay: 120ms; }
  main.enter :is(.group > .it, .stats > .kpi):nth-child(-n+8) { animation: o-fade .26s var(--ease) both; animation-delay: 60ms; }
  main.enter :is(.group > .it, .stats > .kpi):nth-child(2) { animation-delay: 85ms; } main.enter :is(.group > .it, .stats > .kpi):nth-child(3) { animation-delay: 110ms; }
  main.enter :is(.group > .it, .stats > .kpi):nth-child(4) { animation-delay: 135ms; } main.enter :is(.group > .it, .stats > .kpi):nth-child(n+5) { animation-delay: 160ms; }
  main.enter .plan .m { animation: o-light .3s ease-out both; animation-delay: calc(min(sibling-index(), 16) * 20ms + 80ms); }
  main.enter :is(.plan .fill, .it progress, .d-bar progress) { transform-box: fill-box; transform-origin: 0 50%; animation: o-grow-x .5s var(--ease) .15s both; }
  .kpi.changed::before { animation: o-sweep .9s var(--ease) both; }
  .tabs button[aria-current="page"] .ic { animation: o-tab .3s var(--spring); }
}
@keyframes o-rise { from { transform: translateY(6px); } }
@keyframes o-fade { from { opacity: .001; transform: translateY(6px); } }
@keyframes o-light { from { opacity: .001; } }
@keyframes o-grow-x { from { transform: scaleX(0); } }
@keyframes o-dim { from { transform: scaleX(0); } }
@keyframes o-sweep { 0% { transform: scaleX(0); opacity: 1; } 40% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes o-settle { from { transform: scale(.82) rotate(-14deg); } }
@keyframes o-tab { 40% { transform: translateY(-3px) scale(1.12); } }

/* ---------- movimento v3 (14/11): o mesmo das apps do escritório ----------
   - carregar num botão encolhe-o logo (60 ms); ao largar volta devagar (o dedo sente que carregou);
   - o aviso de baixo entra com um pequeno ressalto e sai a desvanecer, em vez de desaparecer de repente;
   - o detalhe de uma máquina, ao fechar, desvanece em 140 ms (mais curto do que a entrada). */
:root { --ease-out: cubic-bezier(.23, 1, .32, 1); }
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .15s var(--ease-out), color .15s var(--ease-out), opacity .15s var(--ease-out), transform .2s var(--ease-out); }
  button:not(:disabled):active { transform: scale(.97); transition-duration: .06s; }
  .tabs button:not(:disabled):active { transform: scale(.94); }
  .toast { transition: opacity .16s var(--ease-out), translate .16s var(--ease-out), display .16s allow-discrete; }
  .toast[hidden] { opacity: 0; translate: 0 4px; }
  .detail { transition: opacity .14s var(--ease-out), display .14s allow-discrete; }
  .detail[hidden] { opacity: 0; }
}
