/*
 * Site dos haras · visual do painel Core Bots adaptado: superfícies quase
 * pretas, Archivo + Geist Mono, barra lateral de 254 px com grupos, cantos
 * chanfrados nos destaques. O acento é a cor do haras (core/theme.js).
 * Celular primeiro: 390 → 640 → 900 (gaveta) → 1200.
 * Toques ≥ 44 px no celular; campos com 16 px de fonte (o iPhone não dá zoom).
 */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-mono-latin.woff2") format("woff2");
}

:root {
  --ui-bg: #0b0b0e;
  --ui-surface: #0d0d12;
  --ui-raised: #121217;
  --ui-control-bg: #0c0c10;
  --ui-input: #121217;
  --ui-input-border: #353540;
  --ui-btn-border: #373740;
  --ui-border: rgba(255, 255, 255, 0.12);
  --rule-soft: rgba(255, 255, 255, 0.075);
  --ui-text: #f0f0f5;
  --ui-muted: rgba(255, 255, 255, 0.52);
  --muted-2: #8d8d9e;
  --accent: #c9a96e;
  --accent-hot: #d0b480;
  --accent-rgb: 201 169 110;
  --on-accent: #0b0b0e;
  --in: #4fd195;
  --out: #ff7a7a;
  --warn: #f2b84b;
  --ui-radius: 8px;
  --control-radius: 6px;
  --ui-control: 38px;
  --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sidebar-width: 254px;
  --page-max: 1200px;
  --page-gutter: 28px;
  --card-pad: 20px;
  --topbar-h: 50px;
  --chamfer-cut: 10px;
  --chamfer-stroke: 1px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
@media (max-width: 1200px) {
  :root {
    --sidebar-width: 224px;
  }
}
@media (max-width: 900px) {
  :root {
    --sidebar-width: 0px;
    --page-gutter: 20px;
    --ui-control: 44px;
  }
}
@media (max-width: 639px) {
  :root {
    --page-gutter: 16px;
    --card-pad: 16px;
  }
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html,
body {
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
}
body {
  font: 14px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}
body.locked,
body.drawer-locked {
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
button,
a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1,
h2,
h3,
h4 {
  margin: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.boot {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  color: var(--muted-2);
  font: 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.muted {
  color: var(--ui-muted);
}
.small {
  font-size: 13px;
}
.in {
  color: var(--in);
}
.out {
  color: var(--out);
}
.mono {
  font-family: var(--font-mono);
}
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.hidden {
  display: none !important;
}
.ico {
  flex: none;
}
/* Rótulo em mono, pequeno e em maiúsculas. */
.label-mono {
  font: 500 10px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  margin: 0;
}
.label-mono.strong {
  color: var(--ui-text);
}
h4.label-mono {
  margin: 18px 0 8px;
}

/* ---------- chanfro ---------- */
/*
 * O elemento pinta a "borda" (--cbo) e é recortado; o ::before pinta o
 * fundo (--cbf) 1 px para dentro com o mesmo polígono. O conteúdo fica acima.
 */
.chamfer,
.chamfer-lg {
  --cut: var(--chamfer-cut);
  --cbo: var(--ui-border);
  --cbf: var(--ui-surface);
  position: relative;
  isolation: isolate;
  background: var(--cbo);
  clip-path: polygon(
    var(--cut) 0,
    100% 0,
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    0 100%,
    0 var(--cut)
  );
}
.chamfer-lg {
  --cut: 13px;
}
.chamfer::before,
.chamfer-lg::before {
  --inner: calc(var(--cut) - 0.42px);
  content: "";
  position: absolute;
  inset: var(--chamfer-stroke);
  z-index: -1;
  background: var(--cbf);
  clip-path: polygon(
    var(--inner) 0,
    100% 0,
    100% calc(100% - var(--inner)),
    calc(100% - var(--inner)) 100%,
    0 100%,
    0 var(--inner)
  );
}

/* ---------- moldura: barra lateral + principal ---------- */

.shell {
  min-height: 100dvh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: #09090c;
  border-right: 1px solid var(--rule-soft);
  z-index: 50;
}
.main {
  margin-left: var(--sidebar-width);
  min-width: 0;
  min-height: 100dvh;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 64px;
  padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  object-fit: contain;
  background: var(--ui-raised);
  flex: none;
}
.brand-logo.empty {
  display: grid;
  place-items: center;
  color: var(--accent);
}
.brand-text {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 1px;
}
.brand-text .label-mono {
  font-size: 9px;
}
.brand-name {
  font-weight: 650;
  font-size: 14px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-btn.drawer-close {
  display: none;
}
.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 16px;
}
.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-group + .nav-group {
  margin-top: 14px;
}
.nav-label {
  font: 500 9.5px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  padding: 12px 10px 8px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 41px;
  padding: 0 10px;
  border-radius: var(--control-radius);
  color: rgba(255, 255, 255, 0.5);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition:
    color 0.15s,
    background 0.15s;
}
.nav-item:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.025);
}
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
}
.nav-item.active .ico {
  color: var(--accent);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.side-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 12px 14px;
  border-top: 1px solid var(--rule-soft);
}
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--ui-raised);
  border: 1px solid var(--ui-border);
  font-weight: 650;
  font-size: 13px;
}
.side-user-text {
  display: grid;
  min-width: 0;
}
.side-user-text b {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-user-text span {
  font: 10px var(--font-mono);
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-backdrop {
  display: none;
}

/* Barra do topo: caminho e estado do bot. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--page-gutter);
  border-bottom: 1px solid var(--rule-soft);
  background: rgba(11, 11, 14, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font: 500 10px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.icon-btn.menu-btn {
  display: none;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted-2);
  white-space: nowrap;
}
.crumb {
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb.now {
  color: var(--ui-text);
}
.crumb-sep {
  color: rgba(255, 255, 255, 0.2);
}
.bot-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  white-space: nowrap;
}
.bot-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--in);
  box-shadow: 0 0 0 3px rgba(79, 209, 149, 0.14);
}
.bot-status.offline {
  color: var(--warn);
}
.bot-status.offline .dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(242, 184, 75, 0.16);
}
.status-short {
  display: none;
}

.content {
  max-width: calc(var(--page-max) + var(--page-gutter) * 2);
  margin: 0 auto;
  padding: 24px var(--page-gutter) 40px;
  outline: none;
}
body.has-queue .content {
  padding-bottom: calc(110px + var(--safe-b));
}
.content > * + * {
  margin-top: 16px;
}
.content > .page-head + * {
  margin-top: 0;
}

/* Gaveta (≤ 900 px): a barra lateral sai da tela e volta pelo botão de menu. */
@media (max-width: 900px) {
  .sidebar {
    width: min(300px, 86vw);
    transform: translateX(-100%);
    visibility: hidden;
    transition:
      transform 0.22s ease,
      visibility 0s linear 0.22s;
    box-shadow: none;
  }
  .drawer-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.22s ease;
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.5);
  }
  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .drawer-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .icon-btn.drawer-close {
    display: inline-flex;
  }
  .nav-item {
    height: 44px;
    font-size: 13px;
  }
  .icon-btn.menu-btn {
    display: inline-flex;
    margin-left: -8px;
  }
}
@media (max-width: 639px) {
  .crumbs .brand-crumb,
  .crumbs .group-crumb,
  .crumbs .crumb-sep {
    display: none;
  }
  .status-long {
    display: none;
  }
  .status-short {
    display: inline;
  }
}

/* ---------- cabeçalho de página ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--rule-soft);
}
.page-titles {
  min-width: 0;
}
.page-kicker {
  font: 500 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}
.page-title {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.page-desc {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ui-muted);
}
.page-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
@media (max-width: 639px) {
  .page-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .page-actions {
    width: 100%;
  }
  .page-actions .btn {
    flex: 1;
  }
}

/* ---------- cards ---------- */

.card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  padding: var(--card-pad);
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.card-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--control-radius);
  color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.065);
  border: 1px solid rgb(var(--accent-rgb) / 0.16);
}
.card-titles {
  min-width: 0;
  flex: 1;
  padding-top: 1px;
}
.card-titles h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.card-titles p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ui-muted);
}
.card-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.link {
  font: 500 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-decoration: none;
  padding: 8px 0;
}
.link:hover {
  color: var(--accent-hot);
}
.cols {
  display: grid;
  gap: 16px;
}
@media (min-width: 1100px) {
  .cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Faixa de resumo chanfrada. */
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.strip-cell {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px 16px 14px 18px;
  min-width: 0;
}
.strip-cell::after {
  content: "";
  position: absolute;
  left: 0;
  top: var(--cut);
  bottom: 0;
  width: 2px;
  background: var(--accent);
}
.strip-cell.out::after {
  background: var(--out);
}
.strip-cell.warn::after {
  background: var(--warn);
}
.strip-label {
  font: 500 9.5px/1.3 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.strip-value {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strip-value.warn {
  color: var(--warn);
}
.strip-hint {
  font-size: 12px;
  color: var(--ui-muted);
  min-width: 0;
}
.flow-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font: 11.5px var(--font-mono);
  letter-spacing: -0.01em;
}
.flow-hint .flow-hint {
  display: contents;
}
.pair {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0 10px;
  font-size: 15px;
}
@media (max-width: 639px) {
  .strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .strip-cell {
    padding: 12px 12px 12px 14px;
  }
  .strip-value {
    font-size: 16px;
  }
}

/* Estado vazio e linha de "nada". */
.empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 34px 20px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--ui-radius);
  font-size: 13px;
}
.empty-state b {
  font-size: 14px;
  font-weight: 600;
}
.empty-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--control-radius);
  background: var(--ui-raised);
  color: var(--muted-2);
  margin-bottom: 4px;
}
.empty {
  color: var(--ui-muted);
  font-size: 13px;
  padding: 10px 0;
}

/* Esqueleto enquanto os dados chegam. */
.skeleton .sk {
  display: block;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton .sk + .sk {
  margin-top: 12px;
}
.sk-head .sk:first-child {
  height: 18px;
}
.skeleton .strip {
  margin-bottom: 16px;
}
.sk-cell {
  height: 84px;
  border-radius: var(--ui-radius);
  border: 1px solid var(--rule-soft);
  background: var(--ui-surface);
}
.sk-card {
  margin-bottom: 16px;
}
.sk-block {
  height: 150px !important;
  margin-top: 18px !important;
}
.sk-grid {
  display: grid;
  gap: 0 16px;
}
@media (min-width: 1100px) {
  .sk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Selos. */
.tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  font: 500 9.5px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ui-muted);
  background: rgba(255, 255, 255, 0.07);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
  white-space: nowrap;
  flex: none;
}
.tag.warn {
  color: var(--warn);
  background: rgba(242, 184, 75, 0.12);
}
.tag.out {
  color: var(--out);
  background: rgba(255, 122, 122, 0.12);
}
.tag.in {
  color: var(--in);
  background: rgba(79, 209, 149, 0.12);
}
.tag.accent {
  color: var(--accent-hot);
  background: rgb(var(--accent-rgb) / 0.14);
}

/* Avisos dentro da página. */
.hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgb(var(--accent-rgb) / 0.22);
  background: rgb(var(--accent-rgb) / 0.055);
  border-radius: var(--control-radius);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
}
.hint .ico {
  color: var(--accent);
  margin-top: 1px;
}
.warn-hint {
  border-color: rgba(242, 184, 75, 0.3);
  background: rgba(242, 184, 75, 0.06);
}
.warn-hint .ico {
  color: var(--warn);
}
form .hint,
.sheet-body .hint {
  margin-bottom: 14px;
}
.error {
  color: var(--out);
  font-size: 13px;
  margin: 2px 0 12px;
}
.error:empty {
  display: none;
}

/* ---------- botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--ui-control);
  padding: 0 14px;
  border: 1px solid var(--ui-btn-border);
  border-radius: var(--control-radius);
  background: var(--ui-raised);
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.btn:hover:not(:disabled) {
  background: #18181f;
  border-color: #45454f;
}
.btn:disabled {
  opacity: 0.5;
}
.btn.primary {
  --cut: 9px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  color: var(--on-accent);
  clip-path: polygon(
    var(--cut) 0,
    100% 0,
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    0 100%,
    0 var(--cut)
  );
}
.btn.primary:hover:not(:disabled) {
  background: var(--accent-hot);
}
/* O recorte esconde o contorno de fora: o foco vai para dentro do botão. */
.btn.primary:focus-visible {
  outline: 2px solid var(--on-accent);
  outline-offset: -5px;
}
.btn.danger {
  color: var(--out);
  border-color: rgba(255, 122, 122, 0.32);
  background: rgba(255, 122, 122, 0.06);
}
.btn.danger:hover:not(:disabled) {
  background: rgba(255, 122, 122, 0.12);
  border-color: rgba(255, 122, 122, 0.5);
}
.btn.primary.danger-fill {
  background: var(--out);
  color: #1a0b0b;
}
.btn.primary.danger-fill:hover:not(:disabled) {
  background: #ff9494;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ui-muted);
}
.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ui-text);
  border-color: transparent;
}
.btn.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}
.btn.block {
  width: 100%;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--ui-muted);
  transition:
    background 0.15s,
    color 0.15s;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ui-text);
}
@media (max-width: 900px) {
  .btn.small {
    min-height: 40px;
  }
  .icon-btn {
    width: 44px;
    height: 44px;
  }
}

/* ---------- campos ---------- */

.form {
  display: block;
}
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  min-width: 0;
}
.field-label {
  font: 500 10px/1.3 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted-2);
}
.field-hint {
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.45;
}
input,
textarea {
  width: 100%;
  min-height: var(--ui-control);
  padding: 0 12px;
  border: 1px solid var(--ui-input-border);
  border-radius: var(--control-radius);
  background: var(--ui-input);
  color: var(--ui-text);
  font-size: 16px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.45;
}
input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
input:hover,
textarea:hover {
  border-color: #44444f;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.18);
}
input[type="search"]::-webkit-search-cancel-button {
  filter: grayscale(1);
}
@media (min-width: 1024px) {
  input,
  textarea {
    font-size: 14px;
  }
}
.row {
  display: grid;
  gap: 0 12px;
  align-items: start;
}
@media (min-width: 640px) {
  .row {
    grid-template-columns: 1fr 1fr;
  }
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--rule-soft);
}
@media (max-width: 639px) {
  .form-actions .btn {
    width: 100%;
  }
}
.code-input {
  font: 600 22px var(--font-mono);
  letter-spacing: 0.4em;
  text-align: center;
  padding-left: calc(12px + 0.4em);
}

/* Abas internas. */
.tabs {
  display: flex;
  gap: 4px;
  margin: -6px 0 20px;
  border-bottom: 1px solid var(--rule-soft);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  min-height: var(--ui-control);
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.tab:hover {
  color: var(--ui-text);
}
.tab.active {
  color: var(--ui-text);
  border-bottom-color: var(--accent);
}
.tab.active.in {
  border-bottom-color: var(--in);
}
.tab.active.out {
  border-bottom-color: var(--out);
}

/* Botões segmentados. */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--ui-border);
  border-radius: var(--control-radius);
  background: var(--ui-control-bg);
}
.seg button {
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ui-muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.seg button:hover {
  color: var(--ui-text);
}
.seg button.active {
  background: var(--ui-raised);
  color: var(--ui-text);
  box-shadow: inset 0 0 0 1px var(--ui-border);
}
@media (max-width: 900px) {
  .seg button {
    min-height: 36px;
  }
}

/* Chave liga/desliga. */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--ui-control);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ui-text);
  font-size: 13px;
}
.toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: #2a2a33;
  border: 1px solid var(--ui-input-border);
  transition: background 0.15s;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d8d8e0;
  transition: transform 0.15s;
}
.toggle[aria-checked="true"] .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle[aria-checked="true"] .toggle-thumb {
  transform: translateX(14px);
  background: var(--on-accent);
}

/* Atalhos de período. */
.period {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--control-radius);
  background: var(--ui-control-bg);
  color: var(--ui-muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.chip:hover {
  color: var(--ui-text);
  border-color: rgba(255, 255, 255, 0.2);
}
.chip.active {
  color: var(--accent-hot);
  border-color: rgb(var(--accent-rgb) / 0.5);
  background: rgb(var(--accent-rgb) / 0.1);
}
@media (max-width: 639px) {
  .period {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-left: calc(var(--page-gutter) * -1);
    margin-right: calc(var(--page-gutter) * -1);
    padding: 0 var(--page-gutter);
  }
  .period::-webkit-scrollbar,
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .chip,
  .dd-chip .dd-btn {
    min-height: 44px;
  }
}

/* ---------- menu de escolha ---------- */

.dd {
  position: relative;
  min-width: 0;
}
.dd-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: var(--ui-control);
  padding: 0 10px 0 12px;
  border: 1px solid var(--ui-input-border);
  border-radius: var(--control-radius);
  background: var(--ui-input);
  color: var(--ui-text);
  font-size: 14px;
  text-align: left;
}
.dd-btn:hover:not(:disabled) {
  border-color: #44444f;
}
.dd-btn[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.18);
}
.dd-btn:disabled {
  opacity: 0.55;
}
.dd-btn .ico {
  color: var(--muted-2);
}
.dd-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dd.is-empty .dd-text {
  color: rgba(255, 255, 255, 0.36);
}
.dd-brand .dd-btn {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: none;
}
.dd-chip .dd-btn {
  min-height: 32px;
  width: auto;
  border-color: var(--ui-border);
  background: var(--ui-control-bg);
  color: var(--ui-muted);
  font-size: 12.5px;
  font-weight: 600;
}
.dd-chip.is-empty .dd-text {
  color: var(--ui-muted);
}
.dd-chip.active .dd-btn {
  color: var(--accent-hot);
  border-color: rgb(var(--accent-rgb) / 0.5);
  background: rgb(var(--accent-rgb) / 0.1);
}
.dd-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
}
.dd-pop {
  position: fixed;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #121217;
  border: 1px solid #353540;
  border-radius: var(--ui-radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  animation: pop 0.12s ease-out;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.dd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.6);
  animation: fade 0.15s ease-out;
}
.dd-sheet {
  width: 100%;
  max-height: 78dvh;
  display: flex;
  flex-direction: column;
  background: var(--ui-surface);
  border-top: 1px solid var(--ui-border);
  border-radius: 14px 14px 0 0;
  padding-bottom: var(--safe-b);
  animation: rise 0.2s ease-out;
}
.dd-title {
  font: 500 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  padding: 4px 18px 10px;
}
.dd-search {
  margin: 8px;
  width: calc(100% - 16px);
}
.dd-sheet .dd-search {
  margin: 0 12px 8px;
  width: calc(100% - 24px);
}
.dd-list {
  overflow-y: auto;
  padding: 4px;
  overscroll-behavior: contain;
}
.dd-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ui-text);
  font-size: 14px;
  text-align: left;
}
.dd-option:hover,
.dd-option:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}
.dd-option.selected {
  color: var(--accent-hot);
}
.dd-option-text {
  display: grid;
  min-width: 0;
}
.dd-option-text small {
  color: var(--muted-2);
  font: 11.5px var(--font-mono);
}
.dd-check {
  color: var(--accent);
  display: inline-flex;
}
.dd-empty {
  padding: 14px;
  color: var(--ui-muted);
  font-size: 13px;
}
.handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  margin: 8px auto 10px;
  flex: none;
}
@media (max-width: 639px) {
  .dd-option {
    min-height: 48px;
    padding: 10px 14px;
    font-size: 15px;
  }
}

/* ---------- painel ---------- */

.chart-wrap {
  overflow: hidden;
}
.chart-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  min-height: 22px;
  margin-bottom: 10px;
  font-size: 13px;
}
.chart {
  display: block;
  max-width: 100%;
  height: auto;
}
.chart text {
  fill: var(--muted-2);
  font: 10px var(--font-mono);
}
.chart .grid-line {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-dasharray: 3 4;
}
.chart .axis-line {
  stroke: rgba(255, 255, 255, 0.14);
}
.chart .hit {
  fill: transparent;
  cursor: pointer;
}
.chart .col:hover .hit {
  fill: rgba(255, 255, 255, 0.025);
}
.chart .col.selected .hit {
  fill: rgb(var(--accent-rgb) / 0.08);
}
.chart .bar-in {
  fill: var(--in);
}
.chart .bar-out {
  fill: var(--out);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ui-muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend .sw {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}
.legend .sw.in {
  background: var(--in);
}
.legend .sw.out {
  background: var(--out);
}
.hint-tap {
  margin-left: auto;
}
@media (max-width: 639px) {
  .hint-tap {
    margin-left: 0;
    width: 100%;
  }
}
.bars {
  display: grid;
  gap: 12px;
}
.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 6px;
}
.bar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-head .num {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}
.bar-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}
.bar-fill.in {
  background: var(--in);
}
.bar-fill.out {
  background: var(--out);
}

/* ---------- listas de lançamentos ---------- */

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.filters .search {
  grid-column: 1 / -1;
  position: relative;
}
.filters .search .ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}
.filters .search input {
  padding-left: 36px;
}
@media (min-width: 768px) {
  .filters {
    grid-template-columns: minmax(0, 1fr) 190px 170px;
  }
  .filters .search {
    grid-column: auto;
  }
}
.day-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 8px;
  font: 500 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.day-count {
  color: rgba(255, 255, 255, 0.3);
}
.list {
  display: grid;
}
.card-list {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  overflow: hidden;
}
/* Lista dentro de card: vai de borda a borda. */
.card .list {
  margin: 0 calc(var(--card-pad) * -1) calc(var(--card-pad) * -1);
  border-top: 1px solid var(--rule-soft);
}
.item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px var(--card-pad);
  border: 0;
  border-top: 1px solid var(--rule-soft);
  background: none;
  color: var(--ui-text);
  text-align: left;
  transition: background 0.12s;
}
.list > .item:first-child {
  border-top: 0;
}
.item:hover {
  background: rgba(255, 255, 255, 0.025);
}
.item:focus-visible {
  outline-offset: -2px;
}
.item-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--control-radius);
  background: var(--ui-raised);
  color: var(--ui-muted);
}
.item-icon.in {
  color: var(--in);
  background: rgba(79, 209, 149, 0.09);
}
.item-icon.out {
  color: var(--out);
  background: rgba(255, 122, 122, 0.09);
}
.item-icon.venda {
  color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.1);
}
.item-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.item .title {
  font-size: 14px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item .meta {
  font-size: 12px;
  color: var(--ui-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item .meta .mono {
  font-size: 11px;
  color: var(--muted-2);
}
.tags {
  display: flex;
  gap: 6px;
  margin-top: 3px;
}
.item .value {
  display: grid;
  justify-items: end;
  font-size: 14px;
  font-weight: 600;
}
.item .value small {
  font: 500 9.5px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}
.item.cancelled .title,
.item.cancelled .value span {
  text-decoration: line-through;
  color: var(--ui-muted);
}
.pending-item {
  background: rgba(242, 184, 75, 0.035);
}
.more {
  margin-top: 16px;
}
@media (max-width: 639px) {
  .item {
    gap: 10px;
  }
  .item .title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* ---------- novo lançamento ---------- */

.split {
  display: grid;
  gap: 16px;
  align-items: start;
}
@media (min-width: 1100px) {
  .split {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .aside-card {
    position: sticky;
    top: calc(var(--topbar-h) + 20px);
  }
}
.mini-list {
  display: grid;
  gap: 0;
}
.mini-item {
  display: grid;
  gap: 2px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
}
.mini-item:first-child {
  padding-top: 0;
}
.mini-list .btn {
  margin-top: 12px;
}

/* ---------- escala ---------- */

.lineup-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.lineup-grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 768px) {
  .lineup-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}
.lineup-card .card-head {
  margin-bottom: 12px;
  align-items: center;
}
.count-tag {
  font: 500 10.5px var(--font-mono);
  color: var(--muted-2);
  padding: 3px 7px;
  border: 1px solid var(--ui-border);
  border-radius: 4px;
}
.count-tag.full {
  color: var(--warn);
  border-color: rgba(242, 184, 75, 0.35);
}
.lineup-list {
  list-style: none;
  margin: 0 calc(var(--card-pad) * -1);
  padding: 0;
  border-top: 1px solid var(--rule-soft);
}
.lineup-list li + li {
  border-top: 1px solid var(--rule-soft);
}
.lineup-row {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px var(--card-pad);
  border: 0;
  background: none;
  color: var(--ui-text);
  text-align: left;
}
button.lineup-row:hover {
  background: rgba(255, 255, 255, 0.025);
}
button.lineup-row:focus-visible {
  outline-offset: -2px;
}
.lineup-list li.mine .lineup-row {
  background: rgb(var(--accent-rgb) / 0.055);
}
.lineup-list li.mine .lineup-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
}
.lineup-list li.pending .lineup-row {
  background: rgba(242, 184, 75, 0.05);
}
.pos {
  font-size: 11px;
  color: var(--muted-2);
}
.lineup-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.animal {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 600;
}
.row-go {
  color: rgba(255, 255, 255, 0.25);
  display: inline-flex;
}
.who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  color: var(--ui-muted);
}
.who img,
.who-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: none;
}
.who-dot {
  display: grid;
  place-items: center;
  background: var(--ui-raised);
  border: 1px solid var(--ui-border);
  font-size: 9.5px;
  font-weight: 650;
  color: var(--ui-text);
}
.who-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.add-entry {
  margin-top: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.14) !important;
}
.timeline {
  display: grid;
  gap: 0;
  font-size: 13px;
}
.timeline > div {
  position: relative;
  padding: 0 0 12px 18px;
  border-left: 1px solid var(--rule-soft);
  margin-left: 4px;
}
.timeline > div:last-child {
  padding-bottom: 0;
}
.timeline > div::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ui-bg);
  border: 1px solid var(--accent);
}
.timeline b {
  font-weight: 600;
}
.timeline .muted {
  font-size: 12px;
}

/* ---------- folha (detalhe e formulários) ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sheet {
  width: 100%;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--ui-surface);
  border-top: 1px solid var(--ui-border);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}
.overlay.enter {
  animation: fade 0.18s ease-out;
}
.overlay.enter .sheet {
  animation: rise 0.22s ease-out;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 16px 14px 20px;
  border-bottom: 1px solid var(--rule-soft);
}
.sheet-titles {
  min-width: 0;
  flex: 1;
}
.sheet-kicker {
  font: 500 10px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  margin-bottom: 4px;
}
.sheet-head h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.sheet-amount {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 600;
}
.sheet-body {
  overflow-y: auto;
  padding: 18px 20px calc(20px + var(--safe-b));
  overscroll-behavior: contain;
}
@media (min-width: 640px) {
  .overlay {
    align-items: center;
    padding: 24px;
  }
  .sheet {
    max-width: 560px;
    max-height: min(86dvh, 760px);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
  }
  .sheet .handle {
    display: none;
  }
  .sheet-head {
    padding-top: 18px;
  }
  .overlay.enter .sheet {
    animation: pop 0.16s ease-out;
  }
}
dl.facts {
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr;
  margin: 0;
  border: 1px solid var(--rule-soft);
  border-radius: var(--control-radius);
  overflow: hidden;
}
dl.facts dt,
dl.facts dd {
  padding: 9px 12px;
  border-top: 1px solid var(--rule-soft);
}
dl.facts dt:first-of-type,
dl.facts dt:first-of-type + dd {
  border-top: 0;
}
dl.facts dt {
  font: 500 10px/1.8 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.015);
}
dl.facts dd {
  margin: 0;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.actions .btn {
  flex: 1 1 auto;
}
@media (max-width: 639px) {
  .actions .btn {
    flex-basis: 100%;
  }
}

/* ---------- fila ("Enviar tudo") e rodapé de salvar ---------- */

.queue-bar {
  position: fixed;
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 10px var(--page-gutter) calc(10px + var(--safe-b));
  background: rgba(13, 13, 18, 0.95);
  border-top: 1px solid var(--ui-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: rise 0.2s ease-out;
}
.save-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--page-max);
  margin: 0 auto;
}
.save-info {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.save-info b {
  font-size: 13px;
  font-weight: 600;
}
.save-help {
  font-size: 12px;
  color: var(--ui-muted);
}
.save-blocked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--warn);
}
.save-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
@media (max-width: 479px) {
  .save-help {
    display: none;
  }
}
.queue-list {
  display: grid;
  border: 1px solid var(--rule-soft);
  border-radius: var(--control-radius);
}
.queue-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 6px 8px 12px;
  font-size: 13px;
}
.queue-item + .queue-item {
  border-top: 1px solid var(--rule-soft);
}
.queue-item.failed {
  background: rgba(255, 122, 122, 0.05);
}
.queue-item-body b {
  font-weight: 550;
  overflow-wrap: anywhere;
}

/* ---------- avisos ---------- */

#toasts {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--safe-b));
  z-index: 100;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
body.has-queue #toasts {
  bottom: calc(84px + var(--safe-b));
}
.toast {
  padding: 11px 14px;
  border: 1px solid var(--ui-border);
  border-left: 2px solid var(--accent);
  border-radius: var(--control-radius);
  background: #15151b;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  animation: pop 0.16s ease-out;
  pointer-events: auto;
}
.toast.ok {
  border-left-color: var(--in);
}
.toast.bad {
  border-left-color: var(--out);
}
@media (max-width: 639px) {
  #toasts {
    left: 16px;
    right: 16px;
    width: auto;
  }
}

/* ---------- login ---------- */

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px calc(24px + var(--safe-b));
  background:
    radial-gradient(700px 360px at 50% -8%, rgb(var(--accent-rgb) / 0.09), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 0 / 100% 48px,
    var(--ui-bg);
}
.login-card {
  width: min(420px, 100%);
  padding: 28px 26px 26px;
}
.login-card > * {
  position: relative;
}
.login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.login-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}
.login-card h1 {
  margin: 20px 0 6px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.025em;
}
.login-card > p {
  margin: 0 0 18px;
  font-size: 13.5px;
}
.login-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font: 500 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.32);
}
.login-steps .on {
  color: var(--accent-hot);
}
.login-steps .sep {
  flex: 1;
  height: 1px;
  background: var(--rule-soft);
}
.login-card .btn + .btn {
  margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- barras de rolagem: finas e discretas; escondidas onde só atrapalham ---------- */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
/* Rolagens internas só mostram a barra quando o mouse está sobre elas. */
* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
*:hover {
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
html::-webkit-scrollbar-thumb,
:hover::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.16);
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}
/* Escondidas: barra lateral, faixas horizontais de botões e abas, barra de formatação. */
.side-nav,
.sidebar,
.period,
.tabs,
.seg,
.chips,
.md-toolbar,
.at-bar .seg,
.pd-preview-head .seg,
.cf-nav,
.top-nav,
.dd-sheet .dd-list,
.dd-pop .dd-list {
  scrollbar-width: none;
}
.side-nav::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.period::-webkit-scrollbar,
.tabs::-webkit-scrollbar,
.seg::-webkit-scrollbar,
.chips::-webkit-scrollbar,
.md-toolbar::-webkit-scrollbar,
.cf-nav::-webkit-scrollbar,
.top-nav::-webkit-scrollbar,
.dd-sheet .dd-list::-webkit-scrollbar,
.dd-pop .dd-list::-webkit-scrollbar {
  display: none;
}
