/* ==========================================================================
   Cadence — painel de instrumento (mesma casa visual do Central do Binhara)
   Cromia é reservada para significado: ação é tinta; verde é no ar,
   âmbar é agendado/atenção, vermelho é falha.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Archivo+Narrow:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  color-scheme: light;

  --ink:        #EFEFEC;   /* papel */
  --ink-lift:   #E8E8E4;   /* barra lateral, um tom abaixo do papel */
  --panel:      #FFFFFF;   /* face do instrumento */
  --panel-hi:   #F4F4F1;
  --hairline:   #DBDBD5;   /* linha de escala */
  --hairline-hi:#BCBCB4;

  --text:       #14171A;   /* marcação principal */
  --text-dim:   #565B61;
  --text-faint: #62676D;   /* 4.5:1 no papel: legível em texto pequeno */

  --accent:     #14171A;   /* ação = tinta, não cor de marca */
  --accent-fg:  #FFFFFF;
  --amber:      #9A6400;
  --green:      #1B6B4A;
  --red:        #AE2B18;

  --rail: 224px;
  --gutter: clamp(20px, 3.2vw, 52px);
  --radius: 3px;

  --serif: 'Instrument Sans', system-ui, sans-serif;
  --sans:  'Instrument Sans', system-ui, sans-serif;
  --mono:  'Instrument Sans', system-ui, sans-serif;   /* números: tabular-nums no body */
  --code:  'IBM Plex Mono', ui-monospace, monospace;
  --cifra: 'Archivo Narrow', 'Instrument Sans', sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Voo noturno: face quase preta, marcação em off-white quente, sinais mais luminosos. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --ink: #121311; --ink-lift: #0D0E0C; --panel: #1A1C19; --panel-hi: #222420;
    --hairline: #2E312C; --hairline-hi: #454941;
    --text: #ECEAE4; --text-dim: #9B9D95; --text-faint: #8A8D85;
    --accent: #ECEAE4; --accent-fg: #121311;
    --amber: #E0A63C; --green: #5CC08D; --red: #E8705C;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --ink: #121311; --ink-lift: #0D0E0C; --panel: #1A1C19; --panel-hi: #222420;
  --hairline: #2E312C; --hairline-hi: #454941;
  --text: #ECEAE4; --text-dim: #9B9D95; --text-faint: #8A8D85;
  --accent: #ECEAE4; --accent-fg: #121311;
  --amber: #E0A63C; --green: #5CC08D; --red: #E8705C;
}

*, *::before, *::after { box-sizing: border-box; }

/* hidden sempre esconde: sem isto, qualquer display do CSS vencia o atributo
   (o convite da Equipe e o esqueleto do gráfico apareciam "escondidos"). */
[hidden] { display: none !important; }

html, body { height: 100%; }

/* Anel de foco visível em tudo que recebe teclado, sem poluir o clique de mouse. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* Evita o atraso de 300ms do duplo-toque no celular. */
button, .entry, .slot, .nav__item { touch-action: manipulation; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  border-radius: var(--radius);
  transition: top 0.2s var(--ease);
}

.skip:focus { top: 12px; text-decoration: none; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  font-feature-settings: 'tnum';
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-fg); }

/* ------------------------------------------------------------ tipografia */

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;

  color: var(--text-faint);
}

.num { font-variant-numeric: tabular-nums; }

/* Números grandes: condensada, alinhada. */
.cifra { font-family: var(--cifra); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.count { color: var(--text-dim); font-variant-numeric: tabular-nums; }

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

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: none; }

a { color: var(--text); text-decoration: underline; text-decoration-color: var(--hairline-hi); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--text); }

/* ============================================================== estrutura */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100vh;
}

/* ------------------------------------------------------------------ rail */

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--hairline-hi);
  background: var(--ink-lift);
  padding: 26px 0 18px;
}

.brand {
  padding: 0 22px 26px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 18px;
}

.brand__mark {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand__mark em { font-style: normal; }

.brand__sub {
  font-family: var(--mono);
  font-size: 11.5px;

  color: var(--text-faint);
  margin-top: 2px;
}

.nav { display: flex; flex-direction: column; margin: 0 22px; }

/* Blocos do menu: cada um com sua régua; um traço fino separa um do outro. */
.nav__section + .nav__section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.nav__title { margin-bottom: 6px; font-size: 11.5px; font-weight: 500; color: var(--text-faint); }
.nav__list { display: flex; flex-direction: column; border-left: 1px solid var(--hairline); }

.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: -1px;
  padding: 5px 12px;
  border-left: 2px solid transparent;
  color: var(--text-dim);
  font-size: 13px;
  text-align: left;
  position: relative;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav__item:hover { color: var(--text); border-left-color: var(--hairline-hi); }

.nav__item[aria-current='true'] { color: var(--text); font-weight: 500; border-left-color: var(--text); }

/* Sem ícone: o nome basta, o estado ativo é a barra de tinta. */
.nav__item svg { display: none; }

.nav__badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}

.rail__foot { margin-top: auto; padding: 16px 22px 0; border-top: 1px solid var(--hairline); }

.theme-toggle {
  display: block;
  margin-top: 10px;
  padding: 2px 0;
  font-size: 12.5px;
  color: var(--text-dim);
  text-underline-offset: 4px;
}

.theme-toggle:hover { color: var(--text); text-decoration: underline; }

/* --------------------------------------------------------------- on air */

.onair {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11.5px;

  color: var(--text-faint);
}

.onair__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
}

.onair--live .onair__dot {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(74, 222, 147, 0.55);
  animation: pulse 2.4s infinite;
}

.onair--live { color: var(--green); }

@keyframes pulse {
  70%  { box-shadow: 0 0 0 9px rgba(74, 222, 147, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 147, 0); }
}

/* ------------------------------------------------------------------ main */

.main { min-width: 0; padding: 0 var(--gutter) 80px; }

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0 14px;
  border-bottom: 1px solid var(--text);
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.topbar h1 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.1; }

.topbar__meta {
  display: flex;
  gap: 26px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}

.topbar__meta b { display: block; color: var(--text); font-size: 15px; font-weight: 600; margin-top: 1px; }

.view { display: none; }
.view.is-active { display: block; animation: rise 0.5s var(--ease) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Revelação escalonada dos blocos ao entrar numa aba. */
.stagger > * { animation: rise 0.6s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0.03s; }
.stagger > *:nth-child(2) { animation-delay: 0.09s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.21s; }
.stagger > *:nth-child(5) { animation-delay: 0.27s; }

/* ============================================================== painéis */

.panel {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  position: relative;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}

.panel__body { padding: 20px; }

/* ----------------------------------------------------------- hero views */

.hero {
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) 2fr;
  gap: 0;
  margin-bottom: 22px;
  overflow: hidden;
}

.hero__left {
  padding: 26px 24px 22px;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.hero__value {
  font-family: var(--cifra);
  font-weight: 600;
  font-size: clamp(52px, 7vw, 88px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hero__delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 14px;
}

.hero__delta.up   { color: var(--green); }
.hero__delta.down { color: var(--red); }
.hero__delta.flat { color: var(--text-faint); }

.hero__foot { font-size: 12px; color: var(--text-faint); line-height: 1.45; }

/* Views que a Data API já viu mas o Analytics ainda não fechou. */
.lag {
  margin-top: 16px;
  padding: 11px 13px;
  border-left: 2px solid var(--green);
  background: color-mix(in srgb, var(--green) 7%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
}

.lag__value {
  display: block;
  color: var(--green);
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 3px;
}

.hero__right { padding: 16px 4px 6px 0; min-width: 0; }

.metrics { display: flex; gap: 3px; padding: 0 0 10px 18px; }

.metric {
  font-family: var(--mono);
  font-size: 11.5px;

  padding: 5px 11px;
  border-radius: 999px;
  color: var(--text-faint);
  border: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease),
              background 0.18s var(--ease);
}

.metric:hover { color: var(--text); }

.metric[aria-selected='true'] {
  color: var(--accent-fg);
  border-color: var(--accent);
  background: var(--accent);
}

/* --------------------------------------------------------------- gráfico */

/* Período dos gráficos: mesmas pílulas das métricas. */
.period { padding: 0; }
.hero__right { position: relative; }
.period--corner { position: absolute; top: 16px; right: 16px; }
@media (max-width: 820px) { .period--corner { position: static; padding: 0 0 10px 18px; } }

.chart { width: 100%; height: 210px; display: block; overflow: visible; }

.chart__line {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  animation: draw 1.5s var(--ease) 0.15s forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.chart__area { opacity: 0; animation: fade 0.9s var(--ease) 0.7s forwards; }

@keyframes fade { to { opacity: 1; } }

.chart__grid { stroke: var(--hairline); stroke-width: 1; }

.chart__label { font-family: var(--mono); font-size: 9px; fill: var(--text-faint); }

/* Trecho que o Analytics ainda não fechou: hachura, nunca uma linha em zero. */
/* Preenchimentos vêm inline, com ids por gráfico: Home e Painel coexistem na página. */
.chart__gap-label { fill: var(--text-faint); opacity: 0.75; letter-spacing: 0.1em; }

.chart__dot { fill: var(--panel); stroke: var(--text); stroke-width: 2; }

.chart__hit { fill: transparent; cursor: crosshair; }

/* Dica do gráfico: face do painel, número grande na condensada. */
.chart-host { position: relative; }
.chart-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  padding: 8px 11px 7px;
  background: var(--panel);
  border: 1px solid var(--hairline-hi);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(20 23 26 / 0.12);
  font-size: 11.5px;
  line-height: 1.35;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s var(--ease);
}
.chart-tip.is-on { opacity: 1; }
.chart-tip span { color: var(--text-dim); }
.chart-tip b {
  display: block;
  margin: 1px 0 0;
  font-family: var(--cifra);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.chart-tip em { display: block; margin-top: 3px; font-style: normal; color: var(--amber); }

/* Divisão por conta: uma linha por conta, número alinhado à direita. */
.chart-tip__parts { list-style: none; margin: 6px 0 0; padding: 6px 0 0; border-top: 1px solid var(--hairline); }
.chart-tip__parts li { display: flex; justify-content: space-between; gap: 18px; line-height: 1.6; }
.chart-tip__parts li span:first-child { color: var(--text-dim); }
.chart-tip__parts li span:last-child { color: var(--text); font-weight: 500; }
.chart__hit:hover + .chart__marker { opacity: 1; }
.chart__marker { opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.chart__marker line { stroke: var(--hairline-hi); stroke-dasharray: 2 3; }

/* ------------------------------------------------------------ estatística */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 22px;
}

.stat { background: var(--panel); padding: 18px 20px; transition: background 0.25s var(--ease); }
.stat:hover { background: var(--panel-hi); }

.stat__value {
  font-family: var(--cifra);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 9px;
  font-variant-numeric: tabular-nums;
}

.stat__note { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }

/* -------------------------------------------------------------- tabelas */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }

.table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;

  color: var(--text-faint);
  padding: 0 14px 11px;
  border-bottom: 1px solid var(--hairline-hi);
}

.table td { padding: 12px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tbody tr { transition: background 0.18s var(--ease); }
.table tbody tr:hover { background: var(--panel-hi); }
.table tbody tr:last-child td { border-bottom: none; }

.table__title {
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.thumb {
  width: 34px;
  height: 46px;
  object-fit: cover;
  border-radius: 2px;
  background: var(--panel-hi);
  display: block;
}

/* ------------------------------------------------------------------ tags */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;

  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--hairline-hi);
  color: var(--text-dim);
  white-space: nowrap;
}

.pill--live      { border-color: color-mix(in srgb, var(--green) 45%, transparent); color: var(--green); }
.pill--scheduled { border-color: color-mix(in srgb, var(--amber) 45%, transparent); color: var(--amber); }
.pill--private   { border-color: var(--hairline-hi); color: var(--text-faint); }
.pill--error     { border-color: color-mix(in srgb, var(--red) 45%, transparent); color: var(--red); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 17px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline-hi);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
              color 0.2s var(--ease), transform 0.12s var(--ease);
}

.btn:hover:not(:disabled) { border-color: var(--text); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}

.btn--primary:hover:not(:disabled) { background: var(--text-dim); border-color: var(--text-dim); }

.btn--danger:hover:not(:disabled) { border-color: var(--red); color: var(--red); background: color-mix(in srgb, var(--red) 7%, transparent); }

.btn--sm { padding: 6px 12px; font-size: 12px; }

/* ------------------------------------------------------------- formulário */

.field { margin-bottom: 18px; }

.field__label {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;

  color: var(--text-faint);
  margin-bottom: 8px;
}

.field__hint { font-size: 11.5px; color: var(--text-faint); margin-top: 7px; line-height: 1.5; }

.input, .textarea, .select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--hairline-hi);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 13.5px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}

.textarea { resize: vertical; min-height: 108px; line-height: 1.6; }

/* O select nativo precisa das duas cores explícitas para não herdar o tema do sistema. */
.select { appearance: none; cursor: pointer; padding-right: 34px;
  background-color: var(--panel);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%238B9096' stroke-width='1.5'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

/* Campos manuais do post: recolhidos, abaixo de uma régua. */
.manual { margin-top: 18px; border-top: 1px solid var(--hairline); padding-top: 14px; }
.manual summary { cursor: pointer; font-size: 13px; color: var(--text-dim); width: fit-content; }
.manual summary:hover { color: var(--text); }
.manual[open] summary { color: var(--text); margin-bottom: 16px; }

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }

/* Chips de horário. */
.slots { display: flex; flex-wrap: wrap; gap: 6px; }

.slot {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 6px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  color: var(--text-faint);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease),
              background 0.18s var(--ease);
}

.slot:hover { border-color: var(--hairline-hi); color: var(--text); }

.slot[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent-fg);
  background: var(--accent);
}

/* Interruptor. */
.switch { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }

.switch__track {
  width: 38px;
  height: 21px;
  border-radius: 999px;
  background: var(--hairline);
  border: 1px solid var(--hairline-hi);
  position: relative;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
  flex: none;
}

.switch__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch input:checked + .switch__track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(17px); background: var(--accent-fg); }

/* --------------------------------------------------------- navegador de pastas */

.browser { display: grid; grid-template-columns: 1fr 300px; gap: 1px; background: var(--hairline); }

.browser__list, .browser__side { background: var(--panel); padding: 6px; max-height: 420px; overflow-y: auto; }
.browser__side { padding: 18px 20px; }

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  min-width: 0;
}

.crumbs button { color: var(--text-dim); transition: color 0.18s; }
.crumbs button:hover { color: var(--text); }

.entry {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius);
  text-align: left;
  font-size: 13px;
  color: var(--text-dim);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.entry:hover { background: var(--panel-hi); color: var(--text); }
.entry svg { width: 15px; height: 15px; flex: none; color: var(--text-faint); }
.entry__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry__count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }

/* --------------------------------------------------------------- progresso */

.bar { height: 3px; background: var(--hairline); border-radius: 999px; overflow: hidden; }

.bar__fill {
  height: 100%;
  background: var(--text);
  border-radius: 999px;
  transition: width 0.4s var(--ease);
}

.bar__fill--done { background: var(--green); }

.job { margin-bottom: 14px; }

.job__files {
  max-height: 260px;
  overflow-y: auto;
  border-top: 1px solid var(--hairline);
}

.job__file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--hairline);
}

.job__file:last-child { border-bottom: none; }
.job__file .num { color: var(--text-faint); font-size: 11px; margin-left: auto; white-space: nowrap; }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--hairline-hi);
}

.dot--done { background: var(--green); }
.dot--uploading { background: var(--amber); animation: blink 1.1s ease-in-out infinite; }
.dot--failed { background: var(--red); }

@keyframes blink { 50% { opacity: 0.25; } }

/* -------------------------------------------------------------- conexões */

.accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

.account { padding: 22px; display: flex; flex-direction: column; gap: 16px; }

.account__top { display: flex; align-items: center; gap: 14px; }

.account__avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-hi);
  border: 1px solid var(--hairline);
  flex: none;
}

.account__avatar--text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--panel-hi);
  border-color: var(--hairline-hi);
}

.account__name { font-size: 15px; }
.account__handle { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

.account--soon { opacity: 0.55; }

/* Contas agrupadas por marca: régua de tinta com o nome e os totais. */
.brand-group { margin-bottom: 28px; }
.brand-group__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--text); padding-bottom: 6px; margin-bottom: 14px;
}
.brand-group__head h2 { font-size: 17px; }
.brand-group__totals { font-size: 12px; color: var(--text-dim); }

/* Onde publicar: uma linha por marca, contas lado a lado. */
.target-group { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.target-group:last-child { border-bottom: none; }
.target-group__list { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; padding-left: 24px; }
.target, .target-group__all { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.target input, .target-group__all input { accent-color: var(--text); width: 15px; height: 15px; }

/* Card da Home: o card inteiro é o botão. */
.account--link { width: 100%; text-align: left; color: var(--text); transition: border-color 0.2s var(--ease); }
.account--link:hover { border-color: var(--text); }

/* ------------------------------------------------------------------ misc */

.empty { padding: 46px 20px; text-align: center; color: var(--text-faint); font-size: 13px; }
.empty strong { display: block; color: var(--text-dim); font-size: 14px; margin-bottom: 6px; font-weight: 500; }

.notice {
  display: flex;
  gap: 11px;
  padding: 12px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline-hi);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 18px;
  line-height: 1.55;
}

.notice--warn  { border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: color-mix(in srgb, var(--amber) 6%, transparent); }
.notice--error { border-color: color-mix(in srgb, var(--red) 40%, transparent); background: color-mix(in srgb, var(--red) 6%, transparent); color: var(--red); }

.notice svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

.skeleton {
  background: linear-gradient(90deg, var(--panel-hi) 25%, var(--hairline) 50%, var(--panel-hi) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius);
  color: transparent;
}

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

/* Esqueletos no formato do conteúdo que vem: a página não pula quando chega. */
.sk { display: block; height: 12px; }
.sk[hidden] { display: none; }
/* Enquanto o esqueleto do gráfico está na tela, o gráfico vazio não ocupa espaço. */
#homeChartSk:not([hidden]) + .chart { display: none; }
.sk--title { height: 14px; width: 55%; }
.sk--text { width: 38%; height: 10px; }
.sk--num { height: 26px; width: 64px; }
.sk--avatar { width: 46px; height: 46px; border-radius: 50%; flex: none; }
.sk--thumb { width: 34px; height: 46px; }
.sk--chart { height: 210px; margin: 0 20px; }
.sk-card { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.sk-card__top { display: flex; align-items: center; gap: 14px; }
.sk-card__top > div { flex: 1; display: grid; gap: 8px; }
.sk-card__nums { display: flex; gap: 26px; }
.sk-row td { padding: 12px 14px; }

/* Avisos flutuantes. */
.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 380px;
}

.toast {
  display: flex;
  gap: 11px;
  padding: 13px 16px;
  background: var(--panel);
  border: 1px solid var(--hairline-hi);
  border-left: 2px solid var(--text);
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: 0 12px 32px rgb(20 23 26 / 0.16);
  animation: slide 0.4s var(--ease) both;
}

.toast--ok    { border-left-color: var(--green); }
.toast--error { border-left-color: var(--red); }

@keyframes slide {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- responsivo */

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .hero__left { border-right: none; border-bottom: 1px solid var(--hairline); }
  .browser { grid-template-columns: 1fr; }
}

/* Cadastro de marcas: nome, contagem e ações numa linha; no celular, quebra. */
.brand-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
             padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.brand-row:last-child { border-bottom: none; }
.brand-row .input { flex: 1 1 220px; max-width: 320px; padding: 6px 10px; }
.brand-row__count { color: var(--text-faint); font-size: 12.5px; min-width: 64px; }
.brand-row__actions { display: flex; gap: 8px; margin-left: auto; }

/* Início: atalhos para as duas coisas que se faz aqui. */
.home-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

/* Primeiros passos: aparece enquanto a conta não está pronta para publicar. */
.setup { margin-bottom: 22px; }
.setup__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
               padding: 16px 20px 6px; }
.setup__head h2 { font-size: 17px; }
.setup__progress { font-size: 12px; color: var(--text-dim); }
.setup__bar { height: 3px; margin: 8px 20px 4px; background: var(--hairline); }
.setup__bar i { display: block; height: 100%; background: var(--text); }
.setup__steps { list-style: none; margin: 0; padding: 6px 20px 14px; }
.setup__step { display: flex; align-items: center; gap: 12px; padding: 10px 0;
               border-bottom: 1px solid var(--hairline); }
.setup__step:last-child { border-bottom: none; }
.setup__check { flex: none; width: 20px; height: 20px; border-radius: 50%;
                border: 1px solid var(--hairline-hi); display: grid; place-items: center;
                font-size: 12px; }
.setup__step.is-done .setup__check { background: var(--text); border-color: var(--text); color: var(--ink); }
.setup__step.is-done .setup__text { color: var(--text-faint); text-decoration: line-through; }
.setup__text { flex: 1; min-width: 0; }
.setup__text small { display: block; color: var(--text-dim); font-size: 12px; }
.setup__foot { padding: 0 20px 14px; }
.setup__foot button { font-size: 12px; color: var(--text-dim); text-decoration: underline;
                      text-underline-offset: 3px; }

/* Área de arrastar arquivos no Publicar (no lugar do "Choose Files" do navegador). */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px;
            border: 1px dashed var(--hairline-hi); border-radius: var(--radius); background: var(--panel-hi);
            text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--text); border-style: solid; }
.dropzone strong { font-size: 14px; font-weight: 500; }
.dropzone span { font-size: 12px; color: var(--text-dim); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Barra do Publicar: resumo e "Criar lote" sempre à vista. */
.publish-bar { position: sticky; bottom: 12px; z-index: 5; box-shadow: 0 8px 24px rgb(20 23 26 / 0.10); }
@media (max-width: 820px) {
  .publish-bar { bottom: 8px; }
  .publish-bar .panel__body { padding: 10px 12px !important; flex-wrap: nowrap !important; gap: 10px !important; }
  .publish-bar #planSummary { font-size: 11.5px; line-height: 1.35; display: -webkit-box;
                               -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .publish-bar .btn { flex: none; }
}

/* Conectar conta: um cartão, uma escolha por rede. */
.connect__buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Login: o produto se apresenta antes de pedir senha. */
.gate__wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 56px; align-items: center;
              width: 100%; max-width: 920px; }
.gate__intro h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 14px; }
.gate__intro p { color: var(--text-dim); margin: 0 0 22px; max-width: 42ch; }
.gate__intro ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.gate__intro li { padding-left: 16px; border-left: 2px solid var(--text); }
.gate__intro li b { display: block; font-weight: 600; }
.gate__intro li span { color: var(--text-dim); font-size: 13px; }
@media (max-width: 820px) {
  .gate__wrap { grid-template-columns: 1fr; gap: 28px; }
  .gate__intro h1 { font-size: 24px; }
  .gate__intro ul { display: none; }
}

/* Configurações: abas no topo, formulários estreitos como nos SaaS. */
.config-tabs { margin-bottom: 20px; }
.settings-form { display: grid; gap: 14px; max-width: 420px; }
.settings-form .field { margin: 0; display: grid; gap: 6px; }
.settings-form .btn { justify-self: start; }
.settings-form__title { font-size: 14px; font-weight: 600; margin: 0; }
.invite { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap;
          border-bottom: 1px solid var(--hairline); background: var(--panel-hi); }

/* Botão do menu: só existe no celular. */
.rail__toggle { display: none; }

/* Celular e tablet em pé: a lateral vira uma barra fixa no topo; o menu abre
   por um botão, com os mesmos blocos da lateral e alvos maiores para o dedo. */
@media (max-width: 820px) {
  :root { --rail: 100%; }
  .shell { grid-template-columns: 1fr; }
  .rail { position: sticky; top: 0; z-index: 50; height: auto; flex-direction: row;
          flex-wrap: wrap; align-items: center; padding: 10px 16px;
          border-right: none; border-bottom: 1px solid var(--hairline-hi); }
  .brand { flex: 1; padding: 0; margin: 0; border-bottom: none; }
  .brand__sub { display: none; }
  .rail__toggle { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
                  border: 1px solid var(--hairline-hi); border-radius: var(--radius);
                  background: var(--panel); font-size: 13px; }
  .rail__toggle[aria-expanded='true'] { background: var(--accent); color: var(--accent-fg);
                                        border-color: var(--accent); }
  .rail > #brandSwitcher, .rail > .nav, .rail > .rail__foot { display: none; flex-basis: 100%; }
  .rail.is-open { max-height: 100dvh; overflow-y: auto; }
  .rail.is-open > #brandSwitcher { display: block; margin-top: 12px; }
  .rail.is-open > .nav { display: flex; margin: 12px 0 0; }
  .rail.is-open > .rail__foot { display: block; margin-top: 16px; padding: 12px 0 4px; }
  .chan { margin: 0; }
  .nav__item { padding: 10px 12px; }
  .main { padding: 0 16px 60px; }
  .topbar { padding-top: 18px; }
}

/* Tabelas largas rolam dentro do próprio painel, nunca a página. */
.scroll-x { overflow-x: auto; }

/* Listas longas rolam dentro do painel para a página não virar um rolo infinito. */
.scroll-y {
  max-height: 440px;
  overflow-y: auto;
  /* Sem "contain" de propósito: ao chegar no fim da lista a rolagem segue para
     a página, senão o cursor fica preso e o usuário acha que travou. */
}

/* O cabeçalho acompanha a rolagem — sem ele, quem desce perde as colunas. */
.scroll-y .table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  padding-top: 13px;
}

/* Barra discreta, para não competir com os dados. */
.scroll-y::-webkit-scrollbar { width: 9px; }
.scroll-y::-webkit-scrollbar-track { background: transparent; }
.scroll-y::-webkit-scrollbar-thumb {
  background: var(--hairline-hi);
  border-radius: 999px;
  border: 3px solid var(--panel);
}
.scroll-y::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

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


/* ------------------------------------------------------------- canal ativo */

.chan {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 22px 16px;
  padding: 9px 11px;
  border: 1px solid var(--hairline-hi);
  border-radius: var(--radius);
  background: var(--panel);
}

.chan__pic {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-hi);
  flex: none;
}

.chan__name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Com um canal só não há o que escolher: vira rótulo. */
.chan--solo { background: transparent; border-color: transparent; padding-left: 12px; }

.chan__pick {
  flex: 1;
  min-width: 0;
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 20px 2px 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%238B9096' stroke-width='1.5'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}

.chan__pick:focus { outline: none; }

/* Rótulo de grupo no menu (Criação): discreto, sem caixa alta. */

/* Prontos para publicar: no topo da Criação, recolhido até alguém abrir. */
.prontos { margin-bottom: 18px; }
.prontos__head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; cursor: pointer; font-weight: 500; list-style: none; }
.prontos__head::-webkit-details-marker { display: none; }
.prontos__head::after { content: '▸'; color: var(--text-faint); margin-left: 8px; }
.prontos[open] .prontos__head::after { content: '▾'; }
.prontos__count { margin-left: auto; font-size: 12px; color: var(--text-dim); }
.prontos__body { border-top: 1px solid var(--hairline); padding: 14px 18px 16px; }
.prontos__lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 14px; max-height: 360px; overflow-y: auto; padding: 2px; }
.pronto { position: relative; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; }
.pronto input { position: absolute; top: 8px; left: 8px; z-index: 1; width: 18px; height: 18px;
  accent-color: var(--text); }
.pronto__capa { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius);
  background: var(--panel-hi); border: 1px solid var(--hairline); }
.pronto__capa img, .pronto__capa video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pronto__capa b { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; font-size: 11px;
  background: var(--panel); border-radius: var(--radius); }
.pronto:has(input:checked) .pronto__capa { outline: 2px solid var(--text); outline-offset: 1px; }
.pronto__nome { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pronto__meta { font-size: 11px; color: var(--text-faint); }
.prontos__acoes { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 14px; }

/* Marca no seletor: inicial em tinta, no lugar da foto do canal. */
.chan__pic--brand {
  display: flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--ink); font-weight: 600; font-size: 13px;
}

/* Abas do Painel: as contas da marca, a ativa sublinhada em tinta. */
.account-tabs { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 18px; }
.account-tabs:empty { display: none; }
.account-tab {
  padding: 4px 0; font-size: 13px; color: var(--text-dim);
  border-bottom: 2px solid transparent;
}
.account-tab:hover { color: var(--text); }
.account-tab[aria-current='true'] { color: var(--text); font-weight: 500; border-bottom-color: var(--text); }
.chan__pick option { background: var(--panel); color: var(--text); }


/* ------------------------------------------------------------------ acesso */

.gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ink);
}

.gate[hidden] { display: none; }

.gate__card {
  width: 100%;
  max-width: 380px;
  padding: 38px 34px 34px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 24px 60px rgb(20 23 26 / 0.18);
}

.gate__card .brand__mark { font-size: 22px; margin-bottom: 4px; }

.gate__sub {
  font-family: var(--mono);
  font-size: 11.5px;

  color: var(--text-faint);
  margin-bottom: 30px;
}

.gate__error {
  margin-bottom: 16px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--red) 40%, transparent);
  background: color-mix(in srgb, var(--red) 6%, transparent);
  color: var(--red);
  font-size: 12.5px;
}

.gate__error[hidden] { display: none; }
