/* Aba Agenda — a estrutura do Notion Calendar na identidade GRW.

   Três colunas, como no print: barra lateral (ícones, mini-calendário, contas e
   camadas), grade no centro, painel de evento à direita. As cores, as fontes e
   os raios são os do dash; o que veio do Notion é a disposição e o
   comportamento, não a aparência.

   As cores dos calendários são a exceção: vêm do Google e são dado, não
   decoração — é por elas que a pessoa reconhece de qual agenda é o evento, e
   repintá-las na paleta da marca tiraria a informação. Mesma regra das ligas.

   Convenção de prefixo: .agn-p-* é o painel de evento, .agn-s-* a lateral. */

#tab-agenda { padding: 0; }

.agn-shell {
  --agn-gutter: 58px;
  --agn-hora: 60px;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 0;
  height: calc(100vh - 132px);
  min-height: 520px;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: grid-template-columns .22s ease;
}
.agn-shell.painel-aberto { grid-template-columns: 292px minmax(0, 1fr) 344px; }
.agn-shell.side-fechada { grid-template-columns: 0 minmax(0, 1fr) 0; }
.agn-shell.side-fechada.painel-aberto { grid-template-columns: 0 minmax(0, 1fr) 344px; }

/* ── rolagem sem barra ─────────────────────────────────────────────────────
   Todo contêiner que rola dentro da aba esconde a barra e continua rolando —
   é o que o Notion faz, e a régua de horas já diz onde você está no dia.
   Precisa das duas declarações: `scrollbar-width` é o padrão (Firefox e
   Chrome novo) e `::-webkit-scrollbar` cobre Chrome, Edge e Safari
   anteriores. Roda, trackpad, toque e teclado continuam funcionando. */
.agn-scroll,
.agn-s-scroll,
.agn-allday,
.agn-p-scroll,
.agn-mes-grid {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.agn-scroll::-webkit-scrollbar,
.agn-s-scroll::-webkit-scrollbar,
.agn-allday::-webkit-scrollbar,
.agn-p-scroll::-webkit-scrollbar,
.agn-mes-grid::-webkit-scrollbar {
  width: 0; height: 0; display: none;
}

/* ── botões de ícone (comuns às três colunas) ─────────────────────────────── */
.agn-ib {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none;
  border: 0; border-radius: 8px; background: none;
  color: var(--text-sub); cursor: pointer;
  transition: background .14s, color .14s;
}
.agn-ib:hover { background: rgba(127,127,127,.12); color: var(--text); }
.agn-ib[aria-pressed="true"] { background: var(--neon-dim); color: var(--neon); }
.agn-ib .ms-icon { font-size: 19px; }
.agn-ib:focus-visible { outline: 2px solid var(--neon); outline-offset: 1px; }

/* ══════════════════════════════════════════════════════════════════════════
   BARRA LATERAL
   ══════════════════════════════════════════════════════════════════════════ */
/* min-height:0 não é detalhe: como item de grid, o padrão é min-height:auto e a
   coluna inflava até o conteúdo — as 24 horas, 1440px — e o overflow:hidden do
   shell cortava o resto do dia. Vale para as três colunas. */
.agn-side {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--surface2);
  overflow: hidden;
}

.agn-s-icones {
  display: flex; align-items: center; gap: 2px;
  padding: 10px 12px 6px;
}
.agn-s-icones .espaco { flex: 1; }

.agn-s-busca {
  display: flex; align-items: center; gap: 7px;
  margin: 2px 12px 8px; height: 32px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--border-bright); border-radius: 9px;
}
.agn-s-busca .ms-icon { font-size: 16px; color: var(--muted); }
.agn-s-busca input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 12.5px;
}
.agn-s-busca input::placeholder { color: var(--muted); }

.agn-s-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 18px; }

/* mini-calendário — sem título de mês: o título é o do centro, como no print.
   Só quando o mini navega para outro mês aparece um rótulo miúdo. */
.agn-mini { position: relative; padding: 2px 2px 6px; }
.agn-mini-nav {
  position: absolute; top: 0; right: 4px; display: flex; gap: 0; z-index: 2;
}
.agn-mini-nav button {
  width: 22px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; border-radius: 6px; color: var(--muted); cursor: pointer;
}
.agn-mini-nav button:hover { background: rgba(127,127,127,.12); color: var(--text); }
.agn-mini-nav .ms-icon { font-size: 15px; }
.agn-mini-rotulo {
  height: 20px; display: flex; align-items: center; padding-left: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.agn-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.agn-mini-dow {
  text-align: center; padding: 6px 0 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--muted);
}
.agn-mini-dia {
  position: relative; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: none;
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600;
  color: var(--text); cursor: pointer;
}
.agn-mini-dia span {
  width: 26px; height: 26px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.agn-mini-dia:hover span { background: rgba(127,127,127,.16); }
.agn-mini-dia.fora { color: var(--muted); font-weight: 500; }
/* A semana visível é uma faixa contínua, arredondada nas pontas — a leitura do
   print. As classes de ponta são calculadas no render, porque deslizando a
   faixa pode quebrar entre duas linhas. */
.agn-mini-dia.na-semana { background: rgba(127,127,127,.13); }
.agn-mini-dia.banda-ini { border-radius: 9px 0 0 9px; }
.agn-mini-dia.banda-fim { border-radius: 0 9px 9px 0; }
.agn-mini-dia.banda-ini.banda-fim { border-radius: 9px; }
.agn-mini-dia.hoje span { background: var(--danger); color: #fff; }
.agn-mini-dia.hoje:hover span { background: var(--danger); filter: brightness(1.1); }
/* Ponto marca dia com evento; o peso muda junto para não depender só de cor. */
.agn-mini-dia.tem-evento { font-weight: 700; }
.agn-mini-dia.tem-evento::after {
  content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 3px; border-radius: 50%; background: var(--neon);
}
.agn-mini-dia.hoje.tem-evento::after { background: #fff; bottom: 5px; }

/* seções */
.agn-s-sec { margin-top: 16px; }
.agn-s-sec + .agn-s-sec { padding-top: 14px; border-top: 1px solid var(--border); }
.agn-s-sec-titulo {
  display: flex; align-items: center; gap: 6px; min-height: 22px;
  padding: 0 6px; margin-bottom: 4px;
  font-family: 'DM Sans', sans-serif; font-size: 11.5px; font-weight: 600;
  color: var(--muted);
}
.agn-s-sec-titulo .titulo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agn-s-sec-titulo .agn-ib { width: 22px; height: 22px; opacity: 0; }
.agn-s-sec-titulo .agn-ib .ms-icon { font-size: 14px; }
.agn-s-sec:hover .agn-s-sec-titulo .agn-ib { opacity: 1; }
.agn-s-sec.reconectar .agn-s-sec-titulo { color: var(--warn); }

/* linha de calendário */
.agn-cal {
  display: flex; align-items: center; gap: 9px;
  width: 100%; min-height: 32px; padding: 4px 6px;
  border: 0; background: none; border-radius: 7px;
  cursor: pointer; text-align: left; color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
}
.agn-cal:hover { background: rgba(127,127,127,.11); }
.agn-cal-icone {
  width: 15px; height: 15px; flex: none; border-radius: 4px;
  background: var(--cal-cor, var(--neon));
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
}
.agn-cal-icone .ms-icon { font-size: 12px; color: #fff; }
/* Calendário desligado: só o contorno, e o nome apagado. */
.agn-cal[aria-pressed="false"] .agn-cal-icone {
  background: transparent; border: 1.6px solid var(--cal-cor, var(--neon));
}
.agn-cal[aria-pressed="false"] .agn-cal-icone .ms-icon { display: none; }
.agn-cal[aria-pressed="false"] .agn-cal-nome { color: var(--muted); font-weight: 500; }
.agn-cal-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agn-cal-tag {
  font-family: 'DM Sans', sans-serif; font-size: 11.5px; font-weight: 500;
  color: var(--muted); flex: none;
}
.agn-cal-acao {
  flex: none; opacity: 0; border: 0; background: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 10.5px; color: var(--text-sub);
  padding: 2px 6px; border-radius: 5px;
}
.agn-cal:hover .agn-cal-acao { opacity: 1; }
.agn-cal-acao:hover { background: var(--neon-dim); color: var(--neon); }

.agn-s-add {
  display: flex; align-items: center; gap: 9px; width: 100%;
  min-height: 32px; padding: 4px 6px; border: 0; background: none; border-radius: 7px;
  color: var(--muted); font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: left;
}
.agn-s-add:hover { background: rgba(127,127,127,.11); color: var(--text); }
.agn-s-add .ms-icon { font-size: 17px; width: 15px; text-align: center; }

/* ══════════════════════════════════════════════════════════════════════════
   CENTRO
   ══════════════════════════════════════════════════════════════════════════ */
.agn-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }

.agn-topo {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px 4px;
}
.agn-topo .espaco { flex: 1; }
.agn-avatar-topo {
  width: 30px; height: 30px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--neon); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 800;
}
.agn-avatar-topo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.agn-btn {
  height: 32px; padding: 0 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.agn-btn:hover { border-color: var(--border-bright); background: var(--neon-dim); }
.agn-btn .ms-icon { font-size: 17px; }
.agn-btn.principal { background: var(--neon); border-color: var(--neon); color: #fff; }
.agn-btn.principal:hover { filter: brightness(1.08); }
.agn-btn.perigo { color: var(--danger); border-color: rgba(239,68,68,.32); background: rgba(239,68,68,.08); }
.agn-btn.perigo:hover { background: rgba(239,68,68,.16); border-color: var(--danger); }
.agn-btn.fantasma { background: none; border-color: transparent; color: var(--text-sub); }
.agn-btn.fantasma:hover { background: rgba(127,127,127,.12); color: var(--text); }
.agn-btn:disabled { opacity: .5; cursor: default; filter: none; }

/* menu suspenso (visão, "...") */
.agn-menu-ancora { position: relative; }
.agn-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 40; min-width: 170px;
  background: var(--surface); border: 1px solid var(--border-bright); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,.35); padding: 4px;
}
.agn-menu[hidden] { display: none; }
.agn-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer;
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 12.5px; text-align: left;
}
.agn-menu button:hover { background: var(--neon-dim); }
.agn-menu button[aria-checked="true"] { color: var(--neon); font-weight: 600; }
.agn-menu button.perigo { color: var(--danger); }
.agn-menu .ms-icon { font-size: 16px; }
.agn-menu .agn-tecla { margin-left: auto; }

.agn-titulo {
  padding: 4px 22px 10px;
  font-family: 'Manrope', 'Space Grotesk', sans-serif;
  font-size: 24px; font-weight: 800; color: var(--text);
  text-transform: capitalize; letter-spacing: -.02em; line-height: 1.1;
}

/* grade */
.agn-grade { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.agn-head-row {
  display: grid; grid-template-columns: var(--agn-gutter) repeat(var(--agn-cols, 7), minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}
.agn-gutter-top {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 2px 0 4px;
}
.agn-gutter-top .agn-ib { width: 26px; height: 26px; }
.agn-gutter-top .agn-ib .ms-icon { font-size: 18px; }
.agn-tz {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--muted); letter-spacing: .08em;
}
.agn-dia-head {
  padding: 8px 6px 8px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-left: 1px solid var(--border);
}
.agn-dia-dow, .agn-dia-num {
  font-family: 'Manrope', 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--text-sub); line-height: 1;
}
.agn-dia-num {
  min-width: 24px; height: 24px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--text);
}
.agn-dia-head.hoje .agn-dia-dow { color: var(--text); }
.agn-dia-head.hoje .agn-dia-num { background: var(--danger); color: #fff; }

.agn-allday {
  display: grid; grid-template-columns: var(--agn-gutter) repeat(var(--agn-cols, 7), minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  max-height: 96px; overflow-y: auto;
}
.agn-allday-label {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--muted);
  padding: 8px 6px; text-align: right; letter-spacing: .04em;
}
.agn-allday-col {
  border-left: 1px solid var(--border); padding: 3px 3px; min-height: 26px;
  display: flex; flex-direction: column; gap: 2px;
}

.agn-scroll { flex: 1; min-height: 0; overflow-y: auto; position: relative; }
.agn-corpo {
  display: grid; grid-template-columns: var(--agn-gutter) repeat(var(--agn-cols, 7), minmax(0, 1fr));
  position: relative;
}
.agn-horas { position: relative; }
.agn-hora { height: var(--agn-hora); position: relative; }
.agn-hora span {
  position: absolute; top: -6px; right: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted);
}
.agn-col { position: relative; border-left: 1px solid var(--border); }
.agn-linha { height: var(--agn-hora); border-top: 1px solid var(--border); box-sizing: border-box; }

/* o agora: pílula na calha, linha só na coluna de hoje — como no print */
.agn-agora-pill {
  position: absolute; right: 4px; z-index: 7; transform: translateY(-50%);
  background: var(--danger); color: #fff;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  padding: 2px 5px; border-radius: 5px; pointer-events: none;
}
.agn-agora {
  position: absolute; left: 0; right: 0; height: 0; z-index: 6; pointer-events: none;
  border-top: 2px solid var(--danger);
}
.agn-agora::before {
  content: ''; position: absolute; left: -1px; top: -4px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--danger);
}

/* eventos — bloco sólido na cor da agenda, título em negrito e hora embaixo.
   Sem color-mix o fallback é o rgba; com ele, o bloco fica opaco e a grade não
   vaza por trás, que é a leitura do Notion. */
.agn-ev {
  position: absolute; z-index: 3; box-sizing: border-box;
  border-radius: 6px; padding: 4px 7px; border: 0;
  background: var(--ev-fundo, rgba(99,102,241,.4));
  background: color-mix(in srgb, var(--ev-cor, #6366f1) 52%, var(--surface));
  color: #fff;
  font-family: 'DM Sans', sans-serif; font-size: 11.5px; line-height: 1.25;
  overflow: hidden; cursor: pointer; text-align: left;
  transition: filter .12s, box-shadow .12s;
}
.agn-ev:hover { filter: brightness(1.12); z-index: 5; }
.agn-ev:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; z-index: 5; }
.agn-ev.selecionado {
  background: var(--ev-cor, #6366f1);
  box-shadow: 0 6px 18px rgba(0,0,0,.35); z-index: 5;
}
.agn-ev-titulo { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.agn-ev-hora { font-size: 10px; opacity: .82; display: block; margin-top: 1px; }
.agn-ev.curto { padding: 2px 7px; display: flex; align-items: center; gap: 5px; }
.agn-ev.curto .agn-ev-titulo { flex: none; }
.agn-ev.curto .agn-ev-hora { margin: 0; opacity: .75; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agn-ev.recusado { opacity: .5; }
.agn-ev.recusado .agn-ev-titulo { text-decoration: line-through; }
.agn-ev.arrastando { opacity: .72; cursor: grabbing; }
/* convite sem resposta: borda listrada à esquerda e o aviso no título */
.agn-ev.pendente {
  background-image: repeating-linear-gradient(135deg,
    rgba(255,255,255,.45) 0 3px, transparent 3px 7px);
  background-size: 6px 100%; background-repeat: no-repeat; background-position: 0 0;
}
.agn-ev.pendente .agn-ev-titulo::before {
  content: 'warning'; font-family: 'Material Symbols Outlined'; font-size: 12px;
  vertical-align: -2px; margin-right: 3px;
}
.agn-ev-alca { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.agn-ev-alca::after {
  content: ''; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 18px; height: 2px; border-radius: 2px; background: #fff; opacity: 0;
}
.agn-ev:hover .agn-ev-alca::after { opacity: .55; }

.agn-ev-chip {
  display: flex; align-items: center; gap: 5px; box-sizing: border-box;
  padding: 3px 7px; border-radius: 5px; cursor: pointer; border: 0;
  background: var(--ev-fundo, rgba(99,102,241,.4));
  background: color-mix(in srgb, var(--ev-cor, #6366f1) 52%, var(--surface));
  color: #fff; font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 700; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.agn-ev-chip:hover { filter: brightness(1.12); }
.agn-ev-chip.selecionado { background: var(--ev-cor, #6366f1); }

/* demanda: a camada do dash. Tracejada de propósito — é prazo, não hora marcada. */
.agn-ev.demanda, .agn-ev-chip.demanda {
  color: var(--text);
  background: repeating-linear-gradient(135deg,
    var(--ev-fundo, rgba(245,158,11,.22)) 0 6px, transparent 6px 11px);
  border-left: 3px dashed var(--ev-cor, #f59e0b);
}

.agn-fantasma {
  position: absolute; z-index: 8; pointer-events: none; box-sizing: border-box;
  border-radius: 6px; border: 1.5px dashed var(--neon); background: var(--neon-dim);
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text); padding: 3px 6px;
}

/* visão de mês */
.agn-mes-grid {
  flex: 1; min-height: 0; display: grid;
  grid-template-rows: auto repeat(var(--agn-semanas, 6), minmax(0, 1fr)); overflow-y: auto;
}
.agn-mes-dows { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.agn-mes-dow {
  padding: 6px 8px; text-align: center; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 700; color: var(--text-sub);
}
.agn-mes-semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 90px; }
.agn-mes-dia {
  border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 4px 5px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; min-width: 0;
}
.agn-mes-dia.fora { opacity: .55; }
.agn-mes-dia-num {
  align-self: flex-start; border: 0; background: none; cursor: pointer; padding: 1px 5px; border-radius: 6px;
  font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 700; color: var(--text-sub);
}
.agn-mes-dia-num:hover { background: rgba(127,127,127,.14); color: var(--text); }
.agn-mes-dia.hoje .agn-mes-dia-num { background: var(--danger); color: #fff; }
.agn-mes-mais {
  border: 0; background: none; cursor: pointer; text-align: left; padding: 1px 4px;
  font-family: 'DM Sans', sans-serif; font-size: 10.5px; color: var(--muted);
}
.agn-mes-mais:hover { color: var(--neon); }

/* ══════════════════════════════════════════════════════════════════════════
   PAINEL DE EVENTO
   ══════════════════════════════════════════════════════════════════════════ */
.agn-painel {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border-left: 1px solid var(--border); background: var(--surface2);
}
.agn-p-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.agn-p-head {
  display: flex; align-items: center; gap: 4px; padding: 10px 10px 4px 16px;
}
.agn-p-tipo {
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; color: var(--text);
  display: inline-flex; align-items: center; gap: 2px;
}
.agn-p-tipo .ms-icon { font-size: 16px; color: var(--muted); }
.agn-p-bloco { padding: 4px 16px 12px; }
.agn-p-sep { height: 1px; background: var(--border); margin: 2px 0; }

/* campos "sem caixa": parecem texto até receber foco, como no Notion */
.agn-p-input {
  width: 100%; box-sizing: border-box; border: 0; background: none; outline: none;
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 13px;
  padding: 5px 6px; border-radius: 6px;
}
.agn-p-input:hover:not(:disabled) { background: rgba(127,127,127,.08); }
.agn-p-input:focus { background: rgba(127,127,127,.12); }
.agn-p-input::placeholder { color: var(--muted); }
.agn-p-input:disabled { color: var(--text-sub); }
.agn-p-titulo {
  font-family: 'Manrope', 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 700;
  padding: 6px 6px; margin: 2px 0 6px; line-height: 1.3;
}
textarea.agn-p-input { resize: none; min-height: 60px; line-height: 1.5; }

.agn-p-linha {
  display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 2px 0;
  color: var(--text); font-size: 13px;
}
.agn-p-linha > .ms-icon { font-size: 18px; color: var(--muted); flex: none; width: 20px; text-align: center; }
.agn-p-linha .conteudo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.agn-p-linha.sub { padding-left: 30px; color: var(--text-sub); font-size: 12.5px; min-height: 26px; }
.agn-p-linha.clicavel { cursor: pointer; border-radius: 7px; margin: 0 -6px; padding-left: 6px; padding-right: 6px; }
.agn-p-linha.clicavel:hover { background: rgba(127,127,127,.09); }

/* hora: dois campos de tempo, seta e duração */
.agn-p-tempo {
  border: 0; background: none; outline: none; color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 13.5px; font-weight: 600;
  padding: 3px 5px; border-radius: 6px; width: auto;
}
.agn-p-tempo:hover:not(:disabled), .agn-p-tempo:focus { background: rgba(127,127,127,.12); }
.agn-p-tempo::-webkit-calendar-picker-indicator { display: none; }
.agn-p-tempo:disabled { color: var(--text-sub); }
input[type="date"].agn-p-tempo { font-weight: 500; }
.agn-p-seta { color: var(--muted); font-size: 16px; }
.agn-p-dur { font-size: 12px; color: var(--muted); font-weight: 500; }

.agn-p-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0 4px 30px; }
.agn-chip {
  height: 26px; padding: 0 9px; border-radius: 7px; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--text-sub);
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.agn-chip:hover { background: rgba(127,127,127,.11); color: var(--text); }
.agn-chip[aria-pressed="true"] { background: var(--neon-dim); color: var(--neon); border-color: rgba(99,102,241,.3); }
.agn-chip:disabled { opacity: .55; cursor: default; }
select.agn-chip { appearance: none; -webkit-appearance: none; padding-right: 22px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat; background-position: right 7px center; }
select.agn-chip option { background: var(--surface); color: var(--text); }

/* participantes */
.agn-part-lista { display: flex; flex-direction: column; gap: 2px; padding-left: 30px; }
.agn-part {
  display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 3px 6px 3px 2px;
  border-radius: 7px;
}
.agn-part:hover { background: rgba(127,127,127,.08); }
.agn-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: none; position: relative;
  background: var(--neon); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Manrope', sans-serif; font-size: 10.5px; font-weight: 800; text-transform: uppercase;
}
.agn-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
/* resposta do convidado: ponto no canto do avatar, com título para leitura */
.agn-avatar::after {
  content: ''; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px;
  border-radius: 50%; border: 2px solid var(--surface2); background: var(--muted);
}
.agn-avatar.accepted::after { background: var(--ok); }
.agn-avatar.declined::after { background: var(--danger); }
.agn-avatar.tentative::after { background: var(--warn); }
.agn-avatar.sem-status::after { display: none; }
.agn-part-nome { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.agn-part-nome .principal { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agn-part-nome .sub { font-size: 11px; color: var(--muted); }
.agn-part .agn-ib { width: 24px; height: 24px; opacity: 0; }
.agn-part .agn-ib .ms-icon { font-size: 15px; }
.agn-part:hover .agn-ib { opacity: 1; }
.agn-part-add { display: flex; align-items: center; gap: 9px; padding: 2px 6px 2px 2px; min-height: 32px; position: relative; }
/* sugestões: lista suspensa colada no campo, com avatar, nome e e-mail */
.agn-sug {
  position: absolute; left: 30px; right: 0; top: calc(100% + 2px); z-index: 45;
  background: var(--surface); border: 1px solid var(--border-bright); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,.35); padding: 4px; max-height: 250px; overflow-y: auto;
}
.agn-sug[hidden] { display: none; }
.agn-sug-item {
  display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 7px; cursor: pointer;
}
.agn-sug-item:hover, .agn-sug-item.ativo { background: var(--neon-dim); }
.agn-sug-item .agn-part-nome .principal { font-weight: 600; }
body.light .agn-sug { box-shadow: 0 12px 34px rgba(15,23,42,.18); }
.agn-part-add .ms-icon { font-size: 18px; color: var(--muted); width: 24px; text-align: center; }
.agn-part-add input { padding: 5px 4px; }
.agn-p-resumo { font-size: 11.5px; color: var(--muted); }

.agn-rsvp { display: flex; gap: 6px; padding: 6px 0 2px 30px; }
.agn-rsvp .agn-chip { border-color: var(--border); }
.agn-rsvp .agn-chip[aria-pressed="true"].sim { background: rgba(16,185,129,.14); color: var(--ok); border-color: rgba(16,185,129,.35); }
.agn-rsvp .agn-chip[aria-pressed="true"].talvez { background: rgba(245,158,11,.14); color: var(--warn); border-color: rgba(245,158,11,.35); }
.agn-rsvp .agn-chip[aria-pressed="true"].nao { background: rgba(239,68,68,.12); color: var(--danger); border-color: rgba(239,68,68,.35); }

/* Google Meet */
.agn-meet-icone {
  width: 18px; height: 18px; border-radius: 4px; flex: none;
  background: conic-gradient(from 90deg, #00832d 0 25%, #0066da 0 50%, #e94235 0 75%, #ffba00 0);
}
.agn-meet-codigo { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--text-sub); }

/* paleta de cor do evento: a primeira bolinha é "cor da agenda" */
.agn-cores { display: flex; flex-wrap: wrap; gap: 5px; padding: 3px 0; }
.agn-cor {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  background: var(--c, var(--neon)); padding: 0; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .1s, border-color .1s;
}
.agn-cor:hover { transform: scale(1.12); }
.agn-cor:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.agn-cor .ms-icon { font-size: 13px; color: #fff; opacity: 0; text-shadow: 0 0 2px rgba(0,0,0,.6); }
.agn-cor.ativa { border-color: var(--text); }
.agn-cor.ativa .ms-icon { opacity: 1; }
/* a primeira é a cor herdada da agenda: anel tracejado para dizer "herdada" */
.agn-cor[data-cor=""] { box-shadow: 0 0 0 1px var(--border-bright) inset; }
.agn-cor[data-cor=""]::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px dashed var(--muted); opacity: .7;
}

/* selects sem caixa */
.agn-p-select {
  border: 0; background: none; outline: none; color: var(--text); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 13px; padding: 4px 6px; border-radius: 6px;
  appearance: none; -webkit-appearance: none; padding-right: 20px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat; background-position: right 6px center;
}
.agn-p-select:hover:not(:disabled), .agn-p-select:focus { background-color: rgba(127,127,127,.11); }
.agn-p-select:disabled { color: var(--text-sub); cursor: default; }
.agn-p-select option { background: var(--surface); color: var(--text); }
.agn-p-cor { width: 14px; height: 14px; border-radius: 4px; flex: none; }

/* barra de salvar: aparece quando há mudança não gravada */
.agn-salvar-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-top: 1px solid var(--border); background: var(--surface);
}
.agn-salvar-bar[hidden] { display: none; }
.agn-salvar-bar .aviso { flex: 1; font-size: 11.5px; color: var(--text-sub); }
.agn-salvar-bar .agn-btn { min-height: 34px; }

/* painel vazio: atalhos */
.agn-p-vazio { padding: 14px 16px; }
.agn-p-vazio h4 {
  margin: 0 0 10px; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.agn-atalho {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 0; font-size: 12.5px; color: var(--text-sub);
}
.agn-tecla {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
  padding: 2px 6px; color: var(--text); white-space: nowrap;
}

/* ── estados ──────────────────────────────────────────────────────────────── */
.agn-vazio {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 40px 24px; text-align: center;
}
.agn-vazio .ms-icon { font-size: 40px; color: var(--muted); opacity: .6; }
.agn-vazio h3 { margin: 0; font-family: 'Manrope', sans-serif; font-size: 17px; font-weight: 700; color: var(--text); }
.agn-vazio p { margin: 0; max-width: 430px; font-size: 13px; line-height: 1.6; color: var(--text-sub); }
.agn-vazio code {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px;
}
.agn-erro {
  margin: 6px 14px; padding: 9px 12px; border-radius: 9px;
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);
  color: var(--danger); font-size: 12px; display: flex; align-items: center; gap: 8px;
}
.agn-erro .ms-icon { font-size: 16px; flex: none; }
.agn-aviso {
  margin: 6px 14px; padding: 9px 12px; border-radius: 9px;
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.32);
  color: var(--text); font-size: 12.5px; display: flex; align-items: center; gap: 10px;
}
.agn-aviso > .ms-icon { font-size: 18px; color: var(--warn); flex: none; }
.agn-aviso .texto { flex: 1; min-width: 0; line-height: 1.45; color: var(--text-sub); }
.agn-aviso .texto strong { color: var(--text); }
.agn-aviso .agn-btn { flex: none; }
.agn-carregando {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 9;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 12px; font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  color: var(--text-sub); letter-spacing: .08em; text-transform: uppercase;
}

/* ── mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .agn-shell.painel-aberto { grid-template-columns: 292px minmax(0, 1fr) 0; }
  .agn-shell.side-fechada.painel-aberto { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .agn-painel {
    position: absolute; top: 0; bottom: 0; right: 0; z-index: 30; width: min(88vw, 360px);
    box-shadow: 0 8px 40px rgba(0,0,0,.4); transform: translateX(100%); transition: transform .22s ease;
  }
  .agn-shell.painel-aberto .agn-painel { transform: translateX(0); }
}
@media (max-width: 860px) {
  .agn-shell, .agn-shell.painel-aberto, .agn-shell.side-fechada, .agn-shell.side-fechada.painel-aberto {
    grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 128px);
  }
  .agn-side {
    position: absolute; top: 0; bottom: 0; left: 0; z-index: 30; width: min(88vw, 320px);
    box-shadow: 0 8px 40px rgba(0,0,0,.4); transform: translateX(-100%); transition: transform .22s ease;
  }
  .agn-shell:not(.side-fechada) .agn-side { transform: translateX(0); }
  .agn-titulo { font-size: 19px; padding: 2px 16px 8px; }
  /* 16px evita o zoom automático do iOS ao focar o campo. */
  .agn-p-input, .agn-p-tempo, .agn-p-select, .agn-s-busca input { font-size: 16px; }
  .agn-btn, .agn-ib, .agn-chip { min-height: 38px; }
}

/* ── tema claro ───────────────────────────────────────────────────────────── */
body.light .agn-ev, body.light .agn-ev-chip {
  background: var(--ev-fundo, rgba(99,102,241,.2));
  background: color-mix(in srgb, var(--ev-cor, #6366f1) 20%, #fff);
  color: color-mix(in srgb, var(--ev-cor, #6366f1) 70%, #0f172a);
}
body.light .agn-ev.selecionado, body.light .agn-ev-chip.selecionado { background: var(--ev-cor, #6366f1); color: #fff; }
body.light .agn-ev.pendente { background-image: repeating-linear-gradient(135deg, rgba(15,23,42,.35) 0 3px, transparent 3px 7px); }
body.light .agn-ev-alca::after { background: #0f172a; }
body.light .agn-menu { box-shadow: 0 12px 34px rgba(15,23,42,.18); }
body.light .agn-painel, body.light .agn-side { background: #f4f6fa; }

/* ── movimento reduzido ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .agn-shell, .agn-side, .agn-painel, .agn-ev, .agn-ib { transition: none; }
}
