/* ===== Cores ===== */
:root {
    --bg: #f3f4fc;
    --card: #fff;
    --field: #f5f6fd;
    --tx: #141a3a;
    --mu: #575e80;
    --bd: #dee1f2;
    --ac: #2f46d8;
    --ac-soft: #e5e9ff;
    --act: #fff;
    --bad: #b3261e;
    --ok: #11734f;
    --ok-soft: #dcf3e8;
    --warn: #855600;
    --warn-soft: #fff0c9;
    --gold: #ffc52e;
    --coral: #ff5a4e;
    --draw: #2f46d8;
    --pine: #0e1850;
    --pine-2: #2337b8;
    --shadow: 0 1px 2px #0e18500d, 0 6px 20px #0e18500f;
    --shadow-up: 0 2px 4px #0e185014, 0 16px 38px #0e185026;

    /* Cores dos gráficos (validadas para daltonismo nos dois modos) */
    --s1: #257de0;
    --s2: #f47230;
    --s3: #00b894;
    --s4: #f2a600;
    --s5: #ee7fac;
    --s6: #008a17;
    --s7: #6a4ce2;
    --s8: #ec4647;
    --track: #cce3fd;

    /* Desenhos do fundo */
    --art: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MjAiIGhlaWdodD0iNTIwIiB2aWV3Qm94PSIwIDAgNTIwIDUyMCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNDAgNDApIj48cGF0aCBkPSJNMTAgMzBRMTAgOCAzMiA4aDU2cTIyIDAgMjIgMjJ2MTIwSDEweiIvPjxwYXRoIGQ9Ik0yNCA0NGg3MnY0NEgyNHpNMTAgMTA0aDEwME0zMCAxMDRsNC0xNE02MCAxMjRoME04MCAxMjRoME00MCAxMjRoME00IDE1MGgxMTIiLz48L2c+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjM2IDQ0KSI+PGNpcmNsZSBjeD0iMzAiIGN5PSIyMiIgcj0iMTgiLz48cGF0aCBkPSJNMzAgNDB2NDZNMiAxMTJxMC0yNiAyOC0yNnQyOCAyNnoiLz48L2c+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzcyIDUwKSI+PGNpcmNsZSBjeD0iNDgiIGN5PSI0OCIgcj0iNDQiLz48Y2lyY2xlIGN4PSI0OCIgY3k9IjQ4IiByPSIzMCIvPjxwYXRoIGQ9Ik00OCAzMnYzMk0zOCA0MGgxNk0zOCA1NmgyMCIvPjwvZz48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNzAgMTk2KSI+PHBhdGggZD0iTTAgMGgxMzB2ODZIMHpNMTggMThoOTR2NTBIMTh6TTQwIDEwOGg1ME02NSA4NnYyMk00Mi0yMEw2NSAwbDI2LTIyIi8+PC9nPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDQwIDI1MCkiPjxwYXRoIGQ9Ik00MCA0bDEyIDI1IDI3IDQtMjAgMTkgNSAyNy0yNC0xMy0yNCAxMyA1LTI3TDEgMzNsMjctNHoiLz48L2c+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzcyIDIwOCkiPjxwYXRoIGQ9Ik0wIDBoMTA4djE1MEgwek0xNCAxNGg4MHY4NkgxNHpNNTQgMTR2MjRNMzggNjBxMC0yMiAxNi0yMnQxNiAyMk0zOCA2MGw4IDEwTTcwIDYwbC04IDEwTTI0IDEyNGgyME03MCAxMjRoMTQiLz48L2c+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNjAgMzg0KSI+PHBhdGggZD0iTTMwIDBoNjBsMzAgMzYtNjAgNjZMMCAzNnpNMCAzNmgxMjBNMzAgMGwxMiAzNiAxOCA2NiAxOC02Nkw5MCAwIi8+PC9nPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIzNiAzNzIpIj48cGF0aCBkPSJNMjggMzBoNzRxMjggMCAzMCA0NCAwIDI2LTE2IDI2LTEyIDAtMjQtMjJIMzhxLTEyIDIyLTI0IDIyLTE2IDAtMTYtMjYgMi00NCAzMC00NHpNMzIgNDZ2MjJNMjEgNTdoMjJNOTIgNTBoME0xMDQgNjRoMCIvPjwvZz48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0MzAgNDIwKSI+PHBhdGggZD0iTTMwIDBsOCAyMiAyMiA4LTIyIDgtOCAyMi04LTIyLTIyLTggMjItOHoiLz48L2c+PC9zdmc+");
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0a0d1f;
    --card: #161a33;
    --field: #0f1329;
    --tx: #e9ebfa;
    --mu: #a3a9cc;
    --bd: #2b3158;
    --ac: #8d9bff;
    --ac-soft: #252c5c;
    --act: #0a0d1f;
    --bad: #ff8a80;
    --ok: #55c596;
    --ok-soft: #173a30;
    --warn: #e5b454;
    --warn-soft: #3a2f17;
    --draw: #aab4ff;
    --pine: #0c1238;
    --pine-2: #1d2a86;
    --shadow: 0 1px 2px #0006;
    --shadow-up: 0 14px 34px #0009;
    --s1: #338ced;
    --s2: #e76624;
    --s3: #00a888;
    --s4: #d28e05;
    --s5: #e24d8b;
    --s6: #0aac23;
    --s7: #9887ef;
    --s8: #eb6263;
    --track: #0e3d7e;
}
/* ===== Base ===== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--tx);
    font: 16px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}

body.menu-open {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

h1,
h2,
h3,
.big,
.v {
    font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}

h1 {
    font-size: 1.75rem;
    line-height: 1.2;
    letter-spacing: -.015em;
    margin: 0;
    text-wrap: balance;
}

h2 {
    font-size: 1.08rem;
    margin: 0 0 14px;
}

h3 {
    font-size: 1.12rem;
    line-height: 1.3;
    margin: 0;
    overflow-wrap: anywhere;
}

.mu {
    color: var(--mu);
    font-size: .9rem;
}

.err {
    color: var(--bad);
}

.okc {
    color: var(--ok);
}

.warn {
    color: var(--warn);
}

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

main {
    max-width: 1120px;
    margin: auto;
    padding: 28px 20px 72px;
}

/* ===== Botões ===== */
button {
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--bd);
    border-radius: 9px;
    padding: 9px 16px;
    background: var(--card);
    color: var(--tx);
    transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}

button:hover:not(:disabled) {
    border-color: var(--ac);
}

button:active:not(:disabled) {
    transform: translateY(1px);
}

button.p {
    background: var(--ac);
    border-color: var(--ac);
    color: var(--act);
    font-weight: 600;
}

button.p:hover:not(:disabled) {
    background: color-mix(in srgb, var(--ac) 88%, var(--tx));
}

button.s {
    padding: 5px 12px;
    font-size: .9rem;
}

button.del:hover:not(:disabled) {
    border-color: var(--bad);
    color: var(--bad);
}

button:disabled {
    opacity: .45;
    cursor: default;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-color: transparent;
    background: none;
    color: inherit;
}

.acts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== Topo ===== */
.top {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px 9px 10px;
    background: var(--card);
    border-bottom: 1px solid var(--bd);
}

.top strong {
    flex: 1;
    font-size: 1.05rem;
}

.top .icon-btn:hover {
    background: var(--ac-soft);
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ac-soft);
    color: var(--ac);
    font-size: .9rem;
    font-weight: 650;
}

/* ===== Menu lateral ===== */
#shade {
    position: fixed;
    inset: 0;
    z-index: 19;
    background: #070b2aad;
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s, visibility .22s;
}

#menu {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: min(300px, 86vw);
    display: flex;
    flex-direction: column;
    background: var(--pine);
    color: #eef0ff;
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform .24s cubic-bezier(.2, .8, .2, 1), visibility .24s;
}

.menu-open #menu {
    transform: none;
    visibility: visible;
    box-shadow: 0 0 60px #0008;
}

.menu-open #shade {
    opacity: 1;
    visibility: visible;
}

#menu :focus-visible {
    outline-color: #ffc52e;
}

.menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px 14px 22px;
    font-size: 1.1rem;
}

#menu .icon-btn:hover {
    background: #ffffff14;
    border-color: transparent;
}

#nav {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 16px;
}

#nav p {
    margin: 18px 10px 6px;
    color: #a9b4ea;
    font-size: .82rem;
}

#nav button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 11px 12px;
    border-color: transparent;
    background: none;
    color: #d5daf7;
    text-align: left;
}

#nav button:hover {
    background: #ffffff12;
}

#nav button.on {
    background: #eef0ff;
    color: #0e1850;
    font-weight: 650;
}

.ic {
    flex: none;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 14px 22px;
    border-top: 1px solid #ffffff1f;
}

.who {
    flex: 1;
    min-width: 0;
    font-size: .9rem;
}

.who div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.who div + div {
    color: #a9b4ea;
    font-size: .82rem;
}

#out {
    padding: 6px 14px;
    background: none;
    border-color: #ffffff3d;
    color: inherit;
}

#out:hover {
    background: #ffffff14;
}

/* ===== Cabeçalho das telas e cartões ===== */
.bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.bar p {
    margin: 4px 0 0;
    color: var(--mu);
}

.card {
    background: var(--card);
    border: 1px solid var(--bd);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 28px;
    border: 0;
    background: linear-gradient(120deg, var(--pine), var(--pine-2));
    color: #fff;
}

.hero .mu {
    color: #ccd4fb;
}

.hero button {
    background: #ffffff1a;
    border-color: #ffffff38;
    color: #fff;
}

.hero button.p {
    background: #fff;
    border-color: #fff;
    color: #0e1850;
}

.hero button:hover:not(:disabled) {
    background: #ffffff2e;
    border-color: #fff;
}

.hero button.p:hover:not(:disabled) {
    background: #e0f1e9;
}

.hero :focus-visible {
    outline-color: #fff;
}

.big {
    font-size: clamp(2.4rem, 7vw, 3.6rem);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.tiles .card {
    display: block;
    width: 100%;
    text-align: left;
    font-weight: 400;
    margin: 0;
}

.tiles .card:hover,
.box:hover {
    box-shadow: var(--shadow-up);
}

.tiles .v {
    font-size: 1.65rem;
    font-weight: 620;
    letter-spacing: -.01em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}

.box {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    transition: box-shadow .15s;
}

.box-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.box-head > div {
    flex: 1;
    min-width: 0;
}

.box .acts {
    margin-top: auto;
}

.mark {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--c) 16%, var(--card));
    color: var(--tx);
}

.facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0;
}

.facts dt {
    color: var(--mu);
    font-size: .85rem;
}

.facts dd {
    margin: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pill {
    flex: none;
    padding: 3px 11px;
    border-radius: 99px;
    font-size: .84rem;
    font-weight: 600;
}

.pill.okc {
    background: var(--ok-soft);
}

.pill.warn {
    background: var(--warn-soft);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 8px 0 0;
    font-size: .9rem;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.empty {
    padding: 44px 20px;
    text-align: center;
    color: var(--mu);
}

.empty button {
    margin-top: 14px;
}

.empty p {
    margin: 0 auto;
    max-width: 46ch;
}

/* ===== Tabelas ===== */
.scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--bd);
}

tr:last-child > td {
    border-bottom: 0;
}

td {
    transition: background .12s;
}

tr:hover > td {
    background: color-mix(in srgb, var(--ac) 5%, transparent);
}

th {
    color: var(--mu);
    font-size: .85rem;
    font-weight: 600;
}

.n {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tot td,
.net td {
    font-weight: 650;
    border-top: 2px solid var(--bd);
}

.note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--warn-soft);
    border-color: transparent;
}

.note p {
    margin: 0;
    flex: 1 1 320px;
}

.split {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 30px;
    margin: 14px 0;
    padding: 14px 18px;
    border-radius: 10px;
    background: var(--field);
}

.split div {
    font-size: 1.15rem;
    font-weight: 620;
    font-variant-numeric: tabular-nums;
}

.split div > span:first-child {
    display: block;
    color: var(--mu);
    font-size: .85rem;
    font-weight: 400;
}

/* Conta passo a passo */
.calcs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 16px;
    margin-bottom: 14px;
}

.calc {
    border: 1px solid var(--bd);
    border-radius: 10px;
    padding: 16px 16px 8px;
}

.calc h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.calc td {
    padding: 8px 0;
}

/* ===== Formulários ===== */
.quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.quick .chip[aria-pressed] {
    opacity: 1;
    text-decoration: none;
}

.quick .chip[aria-pressed=true] {
    background: var(--ac);
    border-color: var(--ac);
    color: var(--act);
}

.addp {
    display: flex;
    gap: 10px;
}

.addp input {
    margin: 0;
}

.addp button {
    flex: none;
}

.checks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.checks label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.checks input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ac);
}

label {
    display: block;
    margin-bottom: 14px;
    font-size: .92rem;
    font-weight: 500;
}

input,
select {
    display: block;
    width: 100%;
    margin-top: 5px;
    font: inherit;
    font-weight: 400;
    padding: 10px 12px;
    border: 1px solid var(--bd);
    border-radius: 9px;
    background: var(--field);
    color: var(--tx);
    transition: border-color .15s;
}

input:hover,
select:hover {
    border-color: color-mix(in srgb, var(--ac) 55%, var(--bd));
}

td input {
    margin: 0 0 0 auto;
    max-width: 180px;
    text-align: right;
}

td input.pc {
    width: 94px;
}

.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

fieldset {
    border: 1px solid var(--bd);
    border-radius: 10px;
    margin: 0 0 14px;
    padding: 12px 16px 0;
}

legend {
    padding: 0 6px;
    font-size: .9rem;
    font-weight: 600;
}

.month {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.month label {
    margin: 0;
}

.month button {
    padding: 10px 14px;
}

dialog {
    width: min(620px, 94vw);
    border: 1px solid var(--bd);
    border-radius: 16px;
    background: var(--card);
    color: var(--tx);
    padding: 26px;
    box-shadow: var(--shadow-up);
}

dialog h2 {
    font-size: 1.3rem;
}

dialog::backdrop {
    background: #070b2aad;
}

/* ===== Entrada (login) ===== */
body.auth main {
    max-width: none;
    padding: 0;
}

.auth-page {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: 100vh;
}

.brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: clamp(28px, 6vw, 72px);
    background: linear-gradient(150deg, var(--pine), var(--pine-2));
    color: #fff;
}

.brand h1 {
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    max-width: 12ch;
}

.brand p {
    max-width: 36ch;
    margin: 18px 0 0;
    color: #cdd5fb;
    font-size: 1.08rem;
}

.brand svg {
    width: 100%;
    max-width: 440px;
    height: auto;
}

.login {
    align-self: center;
    width: min(400px, 100%);
    margin: auto;
    padding: 32px 20px;
}

.login .mu {
    margin: 6px 0 24px;
}

.login .acts button {
    flex: 1;
}

/* ===== Filtros e gráficos ===== */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
    margin: 30px 0 18px;
}

.filters label {
    margin: 0;
}

.filters select {
    width: auto;
    min-width: 170px;
    background: var(--card);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

button.chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    border-radius: 99px;
}

.chip[aria-pressed=false] {
    opacity: .5;
    text-decoration: line-through;
}

.sw {
    display: inline-block;
    flex: none;
    width: 11px;
    height: 11px;
    border-radius: 3px;
}

.duo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 0 18px;
}

.chart {
    overflow-x: auto;
}

.chart svg {
    display: block;
}

.chart text {
    fill: var(--mu);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.chart .cap {
    fill: var(--tx);
    font-weight: 600;
    paint-order: stroke;
    stroke: var(--card);
    stroke-width: 5px;
}

.col {
    cursor: pointer;
    outline: none;
}

.col .hit {
    fill: transparent;
}

.col:hover .hit,
.col:focus-visible .hit {
    fill: var(--tx);
    fill-opacity: .06;
}

.hb {
    display: grid;
    grid-template-columns: minmax(70px, 130px) 1fr;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    background: none;
    text-align: left;
    font-weight: 400;
}

.hb:hover,
.hb:focus-visible {
    background: color-mix(in srgb, var(--tx) 6%, transparent);
}

.hb.dim .b {
    opacity: .35;
}

.hb .nm {
    overflow-wrap: anywhere;
}

.hb .w {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.hb .t {
    flex: 1;
    min-width: 0;
    display: flex;
}

.hb .b {
    height: 20px;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
}

.hb .v {
    font-family: inherit;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.meter,
.seg {
    height: 8px;
    border-radius: 99px;
    overflow: hidden;
    background: var(--track);
}

.meter i {
    display: block;
    height: 100%;
    background: var(--s1);
}

.seg {
    display: flex;
    gap: 2px;
    min-width: 130px;
    background: var(--bd);
}

td .seg {
    margin-top: 8px;
}

.seg i {
    height: 100%;
}

details summary {
    cursor: pointer;
    margin-top: 12px;
    color: var(--mu);
    font-size: .9rem;
}

#tip {
    position: fixed;
    z-index: 30;
    pointer-events: none;
    max-width: 280px;
    padding: 10px 14px;
    border: 1px solid var(--bd);
    border-radius: 10px;
    background: var(--card);
    box-shadow: var(--shadow-up);
    font-size: .9rem;
}

#tip .r {
    display: flex;
    align-items: center;
    gap: 8px;
}

#tip .k {
    flex: none;
    width: 14px;
    height: 3px;
    border-radius: 2px;
}

#toast {
    position: fixed;
    z-index: 40;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 92vw;
    padding: 12px 22px;
    border-radius: 10px;
    background: var(--tx);
    color: var(--bg);
    box-shadow: var(--shadow-up);
}

/* ===== Animações (só se o computador permitir) ===== */
@media (prefers-reduced-motion: no-preference) {

    .hb .b,
    .meter i,
    .seg i {
        transition: width .3s;
    }

    .col path {
        animation: appear .35s ease-out;
    }

    dialog[open] {
        animation: rise .2s ease-out;
    }

    @keyframes appear {
        from {
            opacity: 0;
        }
    }

    @keyframes rise {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
    }
}

@media (prefers-reduced-motion: reduce) {

    #menu,
    #shade,
    button,
    .box {
        transition: none;
    }
}

/* ===== Celular ===== */
@media (max-width: 760px) {
    main {
        padding: 20px 14px 60px;
    }

    .two,
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-page {
        grid-template-rows: auto 1fr;
    }

    .brand svg {
        display: none;
    }

    .hero {
        padding: 22px;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   Identidade ML Games
   ========================================================== */

/* Fundo: manchas de cor suaves + desenhos de fliperama quase sumindo */
html {
    background: var(--bg);
}

body {
    background: none;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

body::before {
    background:
        radial-gradient(48vw 48vw at 100% -6%, color-mix(in srgb, var(--coral) 17%, transparent), transparent 70%),
        radial-gradient(44vw 44vw at -8% 34%, color-mix(in srgb, var(--ac) 17%, transparent), transparent 70%),
        radial-gradient(46vw 40vw at 96% 104%, color-mix(in srgb, var(--gold) 20%, transparent), transparent 70%);
}

body::after {
    background: var(--draw);
    opacity: .05;
    -webkit-mask: var(--art) 0 0 / 520px 520px;
    mask: var(--art) 0 0 / 520px 520px;
}

/* Marca */
.logo {
    flex: none;
    width: 40px;
    height: 40px;
    transition: transform .25s;
}

.top strong,
.menu-head strong {
    flex: 1;
    font-size: 1.22rem;
    font-weight: 750;
    letter-spacing: -.02em;
}

.top strong span {
    color: var(--ac);
}

.menu-head strong span {
    color: var(--gold);
}

.menu-head {
    gap: 12px;
}

.top:hover .logo,
.menu-head:hover .logo {
    transform: rotate(-7deg) scale(1.08);
}

.top {
    border-bottom: 0;
    box-shadow: 0 1px 0 var(--bd);
    background: color-mix(in srgb, var(--card) 88%, transparent);
    backdrop-filter: blur(10px);
}

.top::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ac), var(--s3), var(--gold), var(--coral));
}

main {
    max-width: 1320px;
    padding-bottom: 120px;
}

/* Menu com uma cor por área */
#nav button .ic {
    box-sizing: content-box;
    padding: 7px;
    margin: -4px 0;
    border-radius: 9px;
    background: color-mix(in srgb, var(--c) 34%, transparent);
    color: #fff;
    transition: transform .18s;
}

#nav button:hover .ic {
    transform: scale(1.12) rotate(-5deg);
}

#nav button.on .ic {
    background: var(--c);
}

/* Títulos */
.bar > div:first-child {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bar .mark {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: color-mix(in srgb, var(--c) 20%, var(--card));
}

.bar .mark .ic {
    width: 27px;
    height: 27px;
}

/* Painel: destaque + ranking lado a lado */
.dash {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(290px, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.dash .card {
    margin: 0;
}

.dash.one {
    grid-template-columns: 1fr;
}

.hero {
    position: relative;
    overflow: hidden;
    align-content: flex-end;
    min-height: 250px;
    background: linear-gradient(125deg, #0e1850 8%, #2337b8 64%, #4a3bd6);
}

/* Luzes de letreiro */
.hero::before {
    content: "";
    position: absolute;
    inset: 14px 16px auto;
    height: 9px;
    background: radial-gradient(circle, var(--gold) 0 3.4px, transparent 3.9px) 0 0 / 26px 9px repeat-x;
    filter: drop-shadow(0 0 5px #ffc52e99);
}

.hero > * {
    position: relative;
}

.hero .art {
    position: absolute;
    right: 18px;
    top: 34px;
    width: 250px;
    max-width: 38%;
    opacity: .95;
}

.hero .big {
    color: #fff;
}

.hero button.p {
    background: var(--gold);
    border-color: var(--gold);
    color: #1b1400;
}

.hero button.p:hover:not(:disabled) {
    background: #ffd766;
    border-color: #ffd766;
}

/* Quadros do topo */
.tiles .tile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tile .mark,
.mach .mark {
    background: var(--c);
    color: #0b0f2a;
}

.tile .mark {
    width: 50px;
    height: 50px;
    border-radius: 14px;
}

.tile > div {
    min-width: 0;
}

.card {
    transition: transform .18s, box-shadow .18s, border-color .18s;
}

.tiles .tile:hover,
.box:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--c, var(--ac)) 60%, var(--bd));
}

.tile:hover .mark,
.box:hover .mark {
    transform: rotate(-6deg) scale(1.07);
}

.mark {
    transition: transform .18s;
}

/* Cartão de máquina com faixa colorida */
.mach {
    padding-top: 0;
    overflow: hidden;
}

.mach .box-head {
    margin: 0 -20px;
    padding: 16px 20px;
    background: color-mix(in srgb, var(--c) 17%, var(--card));
}

.mach .pill {
    background: var(--card);
}

.person .avatar {
    width: 48px;
    height: 48px;
    font-size: 1.05rem;
    background: color-mix(in srgb, var(--c) 24%, var(--card));
    color: var(--tx);
}

/* Ranking */
.rank {
    display: grid;
    gap: 6px;
    align-content: start;
}

.rank button {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 4px 12px;
    align-items: center;
    width: 100%;
    padding: 10px;
    border-color: transparent;
    background: none;
    text-align: left;
}

.rank button:hover,
.rank button[aria-pressed=true] {
    background: color-mix(in srgb, var(--c) 15%, transparent);
    border-color: transparent;
}

.rank .pos {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--field);
    font-weight: 700;
}

.rank button:first-child .pos {
    background: var(--gold);
    color: #1b1400;
}

.rank .nm {
    overflow-wrap: anywhere;
}

.rank .val {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.rank .ln {
    grid-column: 2 / -1;
    height: 8px;
    border-radius: 99px;
    background: var(--field);
    overflow: hidden;
}

.rank .ln i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--c);
}

/* Ações rápidas */
#fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 6;
    display: grid;
    justify-items: end;
    gap: 12px;
}

#fab-btn {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--coral);
    color: #2a0400;
    box-shadow: 0 8px 24px #ff5a4e66;
}

#fab-btn svg {
    transition: transform .2s;
}

#fab-btn:hover {
    transform: scale(1.07);
}

#fab.open #fab-btn svg {
    transform: rotate(45deg);
}

#fab-list {
    display: grid;
    gap: 8px;
    justify-items: end;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .18s, transform .18s, visibility .18s;
}

#fab.open #fab-list {
    opacity: 1;
    visibility: visible;
    transform: none;
}

#fab-list button {
    font-weight: 600;
    box-shadow: var(--shadow-up);
}

/* Moedinhas ao salvar */
.coin {
    position: fixed;
    z-index: 50;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid #d99a00;
    background: var(--gold);
    pointer-events: none;
}

/* Entrada */
.brand {
    background: linear-gradient(150deg, #0e1850, #2337b8 70%, #4a3bd6);
    position: relative;
    overflow: hidden;
}

.brand .logo {
    width: 84px;
    height: 84px;
    margin-bottom: 22px;
}

.brand h1 span {
    color: var(--gold);
}

.brand svg.art {
    max-width: 520px;
}

.art g.cab {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    transition: transform .25s;
}

.art g.cab:hover {
    transform: scale(1.06) rotate(-1.5deg);
}

body.auth main::before {
    content: none;
}

.login {
    padding: 36px 30px;
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow-up);
}

@media (prefers-reduced-motion: no-preference) {
    .hero::before {
        animation: bulbs 1.1s steps(2) infinite;
    }

    @keyframes bulbs {
        to {
            background-position: 26px 0;
        }
    }

    .col path {
        animation: up .45s cubic-bezier(.2, .8, .2, 1);
        transform-box: fill-box;
        transform-origin: 50% 100%;
    }

    @keyframes up {
        from {
            transform: scaleY(0);
        }
    }

    .rank .ln i {
        animation: fill .7s cubic-bezier(.2, .8, .2, 1);
    }

    @keyframes fill {
        from {
            width: 0;
        }
    }
}

@media (max-width: 980px) {
    .dash {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .hero .art,
    .brand svg.art {
        display: none;
    }

    .brand {
        padding: 24px 28px;
    }

    .brand .logo {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }

    .auth-page {
        padding: 0 0 24px;
    }

    .login {
        width: calc(100% - 28px);
        margin: 20px auto;
    }
}

/* ===== Avisos, acerto, relatórios, simulador e retorno ===== */
.cnt {
    margin-left: auto;
    min-width: 24px;
    padding: 1px 7px;
    border-radius: 99px;
    background: var(--coral);
    color: #2a0400;
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
}

.icon-btn.dot {
    position: relative;
}

.icon-btn.dot::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--card);
    background: var(--coral);
}

.ntc {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 12px;
    padding: 16px 20px;
}

.ntc p {
    flex: 1 1 260px;
    margin: 0;
    overflow-wrap: anywhere;
}

.ntc.bad .pill {
    background: color-mix(in srgb, var(--bad) 15%, var(--card));
    color: var(--bad);
}

.ntc.warn {
    color: inherit;
}

.ntc.warn .pill {
    background: var(--warn-soft);
    color: var(--warn);
}

.ntc.info .pill {
    background: var(--ac-soft);
    color: var(--ac);
}

.big.mid {
    font-size: 2.1rem;
}

a.btn {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid var(--bd);
    border-radius: 9px;
    background: var(--card);
    color: var(--tx);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
}

a.btn:hover {
    border-color: var(--ac);
}

.person td {
    padding: 8px 0;
}

.simgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    gap: 18px;
    align-items: start;
}

#sim-out td {
    padding: 9px 0;
}

.two > label {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

input[type=range] {
    height: 38px;
    padding: 0;
    border: 0;
    background: none;
    accent-color: var(--ac);
}

.rep-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.rep-head h2 {
    margin: 0;
    font-size: 1.35rem;
}

#menu {
    color-scheme: dark;
}

#nav {
    scrollbar-width: thin;
}

#nav p {
    margin: 12px 10px 4px;
}

#nav button {
    padding: 8px 12px;
}

/* ===== Dashboard ===== */
.board {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.board > .w {
    margin: 0;
    min-width: 0;
}

.w4 {
    grid-column: span 4;
}

.w5 {
    grid-column: span 5;
}

.w7 {
    grid-column: span 7;
}

.w8 {
    grid-column: span 8;
}

.sub {
    margin: -8px 0 14px;
}

.tiles.kpis {
    grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr));
}

.kpi {
    position: relative;
}

.kpi > div {
    flex: 1;
}

.spark {
    flex: none;
    width: 104px;
    height: 34px;
}

.spark polyline {
    fill: none;
    stroke: color-mix(in srgb, var(--mu) 65%, transparent);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.spark circle {
    fill: var(--ac);
    stroke: var(--card);
    stroke-width: 2;
}

.dl {
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}

.chart .ln {
    fill: none;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.chart .dot {
    stroke: var(--card);
    stroke-width: 2;
}

.hair {
    stroke: var(--mu);
    opacity: 0;
}

.cross:hover .hair,
.cross:focus-visible .hair {
    opacity: 1;
}

.gauge {
    position: relative;
    display: block;
    width: min(230px, 100%);
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: none;
}

.gauge svg {
    display: block;
    width: 100%;
}

.gauge circle {
    fill: none;
    stroke-width: 18;
    stroke-linecap: round;
}

.gauge .bg {
    stroke: var(--track);
}

.gauge .fg {
    stroke: var(--s1);
}

.gt {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 22px;
}

.gt strong {
    font-size: 2.4rem;
    line-height: 1.1;
}

.donut {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
}

.ring {
    position: relative;
    flex: 0 0 190px;
    margin: 0 auto;
}

.ring svg {
    display: block;
    width: 190px;
    height: 190px;
}

.arc {
    stroke: var(--card);
    stroke-width: 3;
    cursor: pointer;
    transition: opacity .15s;
}

.arc.dim {
    opacity: .3;
}

.ring .mid {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    text-align: center;
    pointer-events: none;
    overflow-wrap: anywhere;
}

.keys {
    flex: 1 1 250px;
    display: grid;
    gap: 4px;
}

.key {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-color: transparent;
    background: none;
    text-align: left;
    font-weight: 400;
}

.key .nm {
    overflow-wrap: anywhere;
}

.key:hover {
    background: color-mix(in srgb, var(--tx) 6%, transparent);
}

.pair {
    display: flex;
    gap: 14px;
    margin-bottom: 6px;
}

.pair label {
    flex: 1;
}

.heat {
    border-collapse: separate;
    border-spacing: 3px;
    width: 100%;
}

.heat th,
.heat td {
    padding: 0;
    border: 0;
    text-align: center;
    white-space: nowrap;
}

.heat tr:hover > td {
    background: none;
}

.heat th:first-child {
    padding-right: 10px;
    text-align: left;
    color: var(--tx);
}

.hc {
    display: block;
    width: 100%;
    min-width: 46px;
    padding: 11px 4px;
    border: 0;
    border-radius: 7px;
    font-size: .88rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

button.hc:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-up);
}

.hc.none {
    background: var(--field);
    color: var(--mu);
    font-weight: 400;
}

.dlg-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -8px -8px 10px 0;
}

.dlg-head h2 {
    margin: 0;
}

dialog:has(.dlg-head) {
    width: min(900px, 95vw);
}

.tiles.small {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.tiles.small .card {
    padding: 14px;
    box-shadow: none;
}

.tiles.small .v {
    font-size: 1.3rem;
}

@media (prefers-reduced-motion: no-preference) {
    .chart .ln {
        stroke-dasharray: 3000;
        animation: draw 1s ease-out;
    }

    @keyframes draw {
        from {
            stroke-dashoffset: 3000;
        }
    }

    .gauge .fg {
        animation: gauge .9s cubic-bezier(.2, .8, .2, 1);
    }

    @keyframes gauge {
        from {
            stroke-dasharray: 0 999;
        }
    }
}

@media (max-width: 1080px) {
    .board > .w {
        grid-column: 1 / -1;
    }
}

@media (max-width: 420px) {
    .spark {
        display: none;
    }
}

/* ===== Entrada interativa e login automático ===== */
.splash {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 16px;
    min-height: 70vh;
    font-size: 1.1rem;
    font-weight: 600;
}

.splash .logo {
    width: 92px;
    height: 92px;
}

.splash p {
    margin: 0;
}

.load {
    width: 180px;
    height: 8px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--ac), var(--s3), var(--gold), var(--coral), var(--ac)) 0 0 / 200% 100%;
}

.auth-page {
    --mx: 0;
    --my: 0;
}

.brand > * {
    position: relative;
}

.brand .bulbs {
    position: absolute;
    inset: 18px 22px auto;
    height: 10px;
    background: radial-gradient(circle, var(--gold) 0 3.8px, transparent 4.3px) 0 0 / 30px 10px repeat-x;
    filter: drop-shadow(0 0 6px #ffc52eb0);
}

.brand-in {
    margin-top: 22px;
    transform: translate(calc(var(--mx) * 6px), calc(var(--my) * 6px));
}

.brand .hint {
    margin-top: 10px;
    font-size: .95rem;
    color: var(--gold);
}

.brand .flt {
    position: absolute;
    width: 46px;
    height: 46px;
    max-width: none;
    opacity: .9;
    transform: translate(calc(var(--mx) * var(--d) * 18px), calc(var(--my) * var(--d) * 18px));
    transition: transform .25s ease-out;
}

.brand .art {
    cursor: pointer;
}

.brand .art .stick {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    transform: rotate(calc(var(--mx) * 26deg));
    transition: transform .15s ease-out;
}

.login {
    position: relative;
    overflow: hidden;
}

.login::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--ac), var(--s3), var(--gold), var(--coral));
}

.login input:not([type=checkbox]) {
    padding: 13px 14px;
}

.login input:focus {
    border-color: var(--ac);
    background: var(--card);
}

.pass {
    position: relative;
    display: block;
}

.pass input {
    padding-right: 52px !important;
}

.pass .icon-btn {
    position: absolute;
    top: 50%;
    right: 4px;
    margin-top: -21px;
    color: var(--mu);
}

.pass .icon-btn[aria-pressed=true] {
    color: var(--ac);
}

#caps {
    margin: -6px 0 12px;
    font-size: .9rem;
}

.switch {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 14px;
    cursor: pointer;
}

.switch input {
    flex: none;
    appearance: none;
    width: 46px;
    height: 26px;
    margin: 0;
    padding: 0;
    border-radius: 99px;
    background: color-mix(in srgb, var(--mu) 45%, var(--card));
    cursor: pointer;
    position: relative;
    transition: background .18s;
}

.switch input::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform .18s;
}

.switch input:checked {
    background: var(--ac);
    border-color: var(--ac);
}

.switch input:checked::after {
    transform: translateX(20px);
}

.login .acts button {
    padding: 12px 16px;
}

button.link {
    display: block;
    width: 100%;
    margin-top: 12px;
    border: 0;
    background: none;
    color: var(--ac);
}

button.link:hover {
    text-decoration: underline;
}

@media (prefers-reduced-motion: no-preference) {
    .load {
        animation: slide 1.2s linear infinite;
    }

    @keyframes slide {
        to {
            background-position: -200% 0;
        }
    }

    .splash .logo {
        animation: pop 1.2s ease-in-out infinite alternate;
    }

    @keyframes pop {
        to {
            transform: scale(1.08) rotate(-4deg);
        }
    }

    .brand .bulbs {
        animation: bulbs2 1.1s steps(2) infinite;
    }

    @keyframes bulbs2 {
        to {
            background-position: 30px 0;
        }
    }

    .login {
        animation: rise .4s ease-out;
    }
}

@media (max-width: 760px) {
    .brand .flt,
    .brand .hint {
        display: none;
    }

    .brand svg.logo {
        display: block;
        width: 60px;
        height: 60px;
        margin: 0;
    }

    .brand .art,
    .brand svg.art {
        display: block;
        max-width: 250px;
        margin: 0 auto;
    }

    .brand {
        gap: 14px;
    }

    .brand-in {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 16px;
        align-items: center;
        margin-top: 14px;
    }

    .brand-in p {
        grid-column: 1 / -1;
        margin-top: 4px;
        font-size: 1rem;
    }
}

/* ===== Tela larga e painel lateral ===== */
main {
    max-width: 1920px;
    padding-left: clamp(14px, 2.2vw, 40px);
    padding-right: clamp(14px, 2.2vw, 40px);
}

.top {
    padding-left: clamp(8px, 1.6vw, 30px);
    padding-right: clamp(14px, 2.2vw, 40px);
}

main:has(#cfg) {
    max-width: 900px;
}

body.auth main {
    max-width: none;
    padding: 0;
}

.home {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.home-main {
    min-width: 0;
}

.side {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 18px;
    align-content: start;
}

.sbox {
    margin: 0;
    padding: 18px;
}

.sh {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.sh h2 {
    flex: 1;
    margin: 0;
    font-size: 1.02rem;
}

.sh .mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--c) 22%, var(--card));
}

.sh .mark .ic {
    width: 19px;
    height: 19px;
}

.pc {
    font-size: 1.15rem;
}

button.more {
    padding: 4px 10px;
    border-color: transparent;
    background: none;
    color: var(--ac);
    font-size: .88rem;
    font-weight: 600;
}

button.more:hover {
    background: var(--ac-soft);
    border-color: transparent;
}

.steps,
.alist,
.plist {
    display: grid;
    gap: 4px;
}

.steps {
    margin-top: 12px;
}

.steps button,
.alist button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 8px;
    border-color: transparent;
    background: none;
    text-align: left;
    font-weight: 400;
    font-size: .94rem;
}

.steps button:hover,
.alist button:hover {
    background: color-mix(in srgb, var(--ac) 8%, transparent);
    border-color: transparent;
}

.steps button > span:nth-child(2),
.alist button > span:last-child {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.ck {
    display: grid;
    place-items: center;
    flex: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--bd);
    border-radius: 50%;
    font-size: .85rem;
    font-weight: 700;
}

.steps .ok .ck {
    background: var(--ok);
    border-color: var(--ok);
    color: var(--card);
}

.alist button {
    align-items: flex-start;
}

.bl {
    flex: none;
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--ac);
}

.bl.bad {
    background: var(--bad);
}

.bl.warn {
    background: var(--gold);
}

.kv {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.kv strong {
    font-size: 1.6rem;
}

.plist > div {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--bd);
}

.plist > div:last-child {
    border-bottom: 0;
}

.plist .nm {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.plist .nm > .mu {
    display: block;
}

.plist .nm > .mu.err {
    color: var(--bad);
}

.plist .rv {
    display: grid;
    justify-items: end;
    font-variant-numeric: tabular-nums;
}

.quickgrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.quickgrid button {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 12px 4px;
    font-size: .84rem;
    line-height: 1.25;
    background: var(--field);
}

.quickgrid button:hover .mark {
    transform: rotate(-6deg) scale(1.08);
}

.quickgrid .mark {
    background: var(--c);
    color: #0b0f2a;
}

.hstats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.hstats > div {
    min-width: 150px;
    padding: 10px 16px;
    border: 1px solid #ffffff2b;
    border-radius: 12px;
    background: #ffffff14;
}

.hstats span {
    display: block;
    color: #ccd4fb;
    font-size: .84rem;
}

.hstats strong {
    font-size: 1.15rem;
    margin-right: 8px;
}

.hstats em {
    color: var(--gold);
    font-style: normal;
    font-size: .88rem;
    font-weight: 600;
}

.hero > div:not(.acts) {
    max-width: 100%;
}

.card.hero {
    padding-top: 44px;
}

.home .side {
    padding-bottom: 70px;
}

@media (min-width: 1280px) {
    .home {
        grid-template-columns: minmax(0, 1fr) 350px;
    }

    .side {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1280px) and (max-width: 1499px) {
    .dash {
        grid-template-columns: 1fr;
    }

    .home .tiles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1700px) {
    .home {
        grid-template-columns: minmax(0, 1fr) 390px;
    }

    #an {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px;
    }

    #an > .card {
        margin: 0;
        grid-column: span 2;
    }

    #an > .duo {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    #an > .duo > .card,
    #an > .card:last-child:not(:first-child) {
        margin: 0;
    }

    #an > .card:nth-child(4) {
        grid-column: span 1;
    }
}

.bar > div + label:has(#ret-who) {
    margin-left: auto !important;
}

/* Meses lançados sem o total */
.fix {
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--warn-soft);
}

.fix p {
    margin: 0 0 12px;
    font-size: .94rem;
}

button.mchip {
    padding: 2px 10px;
    border-radius: 99px;
    font-size: .85rem;
}

/* Conta de cada máquina no Retorno */
.path td,
.path th {
    padding: 7px 0;
}

.path .n {
    padding-left: 12px;
}

.scroll .path {
    font-size: .9rem;
}

.path td .mu {
    font-size: .8rem;
}

.grid:has(.path) {
    grid-template-columns: repeat(auto-fill, minmax(min(430px, 100%), 1fr));
}

/* ===== Plano de quitação (tela Retorno) ===== */
.queue {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.queue li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--c) 9%, var(--card));
}

.queue .pos {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--c);
    color: #0b0f2a;
    font-weight: 700;
}

.queue .q {
    flex: 1;
    min-width: 0;
}

.qh {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 12px;
    margin-bottom: 8px;
}

.qb {
    display: grid;
    grid-template-columns: 100px minmax(60px, 1fr) 230px;
    gap: 12px;
    align-items: center;
    padding: 3px 0;
}

.qb i {
    height: 12px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--mu) 18%, transparent);
    overflow: hidden;
}

.qb b {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--c);
}

.qb.alone {
    color: var(--mu);
}

.qb.alone b {
    opacity: .4;
}

.qb b.no {
    background: repeating-linear-gradient(45deg, var(--mu) 0 4px, transparent 4px 9px);
}

.mv {
    display: grid;
    gap: 6px;
    flex: none;
}

@media (max-width: 620px) {
    .queue li {
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }

    .qb {
        grid-template-columns: 1fr auto;
    }

    .qb i {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media print {
    body::before,
    body::after,
    .top,
    #menu,
    #shade,
    #fab,
    #toast,
    #tip,
    .noprint {
        display: none !important;
    }

    :root,
    :root[data-theme="dark"] {
        --bg: #fff;
        --card: #fff;
        --tx: #000;
        --mu: #444;
        --bd: #bbb;
        --bad: #b3261e;
    }

    main {
        max-width: none;
        padding: 0;
    }

    .card {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .scroll {
        overflow: visible;
    }

    .report table {
        font-size: 10pt;
    }
}
