/* ══════════════════════════════════════════════════════
   Hub Católico · Agenda Editorial
   Material You (Google Calendar 2024) — claro + night vision
══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,300..700&family=Roboto:wght@300;400;500;700&display=swap');

/* ── LIGHT (default) ── */
:root {
  --primary:        #0b57d0;
  --on-primary:     #ffffff;
  --primary-cont:   #d3e3fd;
  --on-primary-cont:#041e49;

  --surface:        #ffffff;     /* área do calendário */
  --surface-tint:   #eef3fb;     /* topbar + sidebar */
  --surface-2:      #e4ebf6;     /* hover de controles */

  --on-surface:     #1d1b20;
  --on-surface-var: #44464f;
  --on-surface-dim: #70757a;

  --outline:        #dadce0;
  --outline-var:    #c4c6cf;

  --state-hover:    rgba(11,87,208,.08);
  --state-press:    rgba(11,87,208,.12);
  --cell-hover:     rgba(11,87,208,.035);

  --shadow-panel:   -4px 0 18px rgba(0,0,0,.08);
  --weekend:        #c5221f;

  /* M3 Expressive — fundo da área e cards de dia */
  --cal-bg:         #ffffff;   /* CALENDÁRIO (claro no light) */
  --chrome:         #eef3fb;   /* topbar + sidebar (tint) */
  --cal-cell:       #ffffff;   /* card de cada dia */
  --cal-cell-hover: #e7eef9;
  --cal-cell-copa:  #e3ecfb;   /* dia da Copa */
  --card-shadow:    0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.05);
}

/* ── NIGHT VISION ── */
[data-theme="dark"] {
  --primary:        #a8c7fa;
  --on-primary:     #062e6f;
  --primary-cont:   #284777;
  --on-primary-cont:#d7e3ff;

  --surface:        #1b1b1f;
  --surface-tint:   #232329;
  --surface-2:      #2f2f37;

  --on-surface:     #e4e2e6;
  --on-surface-var: #c6c6cf;
  --on-surface-dim: #8e9099;

  --outline:        #36363c;
  --outline-var:    #46464f;

  --state-hover:    rgba(168,199,250,.10);
  --state-press:    rgba(168,199,250,.16);
  --cell-hover:     rgba(168,199,250,.05);

  --shadow-panel:   -4px 0 22px rgba(0,0,0,.5);
  --weekend:        #f2b8b5;

  --cal-bg:         #121215;   /* CALENDÁRIO (escuro no dark) */
  --chrome:         #1d1d22;   /* topbar + sidebar (mais claro que o calendário) */
  --cal-cell:       #24242a;
  --cal-cell-hover: #2f2f37;
  --cal-cell-copa:  #232a3a;
  --card-shadow:    0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.35);
}

:root {
  --topbar-h:  64px;
  --sidebar-w: 268px;
  --panel-w:   384px;
  --cell-h:    118px;
  --font: 'Roboto Flex', 'Roboto', system-ui, -apple-system, sans-serif;
  --t: 220ms cubic-bezier(.2,0,0,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font); background: var(--surface); color: var(--on-surface);
  font-size: 14px; -webkit-font-smoothing: antialiased;
  transition: background var(--t), color var(--t);
}

/* ══ TOPBAR ══ */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--topbar-h);
  background: var(--chrome);
  display: flex; align-items: center; padding: 0 16px 0 8px; gap: 8px;
  transition: background var(--t);
}
.topbar-left  { display: flex; align-items: center; gap: 6px; width: calc(var(--sidebar-w) + 4px); flex-shrink: 0; }
.topbar-center{ flex: 1; display: flex; align-items: center; gap: 2px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.brand { display: flex; align-items: center; gap: 10px; padding-left: 4px; user-select: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 16px; font-weight: 500; color: var(--on-surface-var); letter-spacing: -.1px; }
.brand-sub  { font-size: 10px; color: var(--on-surface-dim); letter-spacing: .2px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--on-surface-var); transition: background var(--t);
}
.icon-btn:hover { background: var(--state-hover); }

.nav-btn {
  height: 36px; padding: 0 12px; border-radius: 18px; border: none; background: transparent;
  cursor: pointer; font-family: var(--font); font-size: 14px; font-weight: 500;
  color: var(--on-surface-var); display: flex; align-items: center; justify-content: center;
  transition: background var(--t);
}
.nav-btn:hover { background: var(--state-hover); }
.nav-btn.nav-arrow { width: 40px; padding: 0; border-radius: 50%; }
.nav-btn.today-btn { border: 1px solid var(--outline-var); color: var(--on-surface); }

.current-period { font-size: 20px; font-weight: 400; color: var(--on-surface); margin-left: 8px; white-space: nowrap; }

.search-wrap { position: relative; }
.search-input {
  width: 256px; height: 40px; padding: 0 16px 0 40px; border: none; border-radius: 20px;
  background: var(--surface-2); font-family: var(--font); font-size: 14px; color: var(--on-surface);
  outline: none; transition: background var(--t), box-shadow var(--t);
}
.search-input::placeholder { color: var(--on-surface-dim); }
.search-input:focus { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.1); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--on-surface-dim); }

.view-selector { display: flex; border: 1px solid var(--outline-var); border-radius: 20px; overflow: hidden; }
.view-btn {
  padding: 6px 16px; border: none; background: transparent; cursor: pointer; font-family: var(--font);
  font-size: 14px; font-weight: 500; color: var(--on-surface-var); transition: background var(--t), color var(--t);
}
.view-btn:hover { background: var(--state-hover); }
.view-btn.active { background: var(--primary-cont); color: var(--on-primary-cont); }

/* Botão de conta */
.account-btn { border: 1px solid var(--outline-var); color: var(--on-surface); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn.logged { background: var(--primary-cont); color: var(--on-primary-cont); border-color: transparent; }

/* Login / cadastro */
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.auth-tab { flex: 1; padding: 9px 4px; border: 1px solid var(--outline-var); border-radius: 10px; background: transparent; cursor: pointer; font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--on-surface-var); transition: background var(--t), color var(--t); }
.auth-tab.active { background: var(--primary-cont); color: var(--on-primary-cont); border-color: transparent; }
.auth-msg { display: none; font-size: 13px; color: #c5221f; background: rgba(217,48,37,.08); border-radius: 8px; padding: 8px 10px; margin-bottom: 4px; }
[data-theme="dark"] .auth-msg { color: #f2b8b5; }
.auth-hint { font-size: 11px; color: var(--on-surface-dim); margin-top: 14px; line-height: 1.5; }

/* ══ APP BODY ══ */
.app-body { display: flex; position: fixed; inset: var(--topbar-h) 0 0 0; background: var(--chrome); transition: background var(--t); }

/* ══ SIDEBAR ══ */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--chrome);
  display: flex; flex-direction: column;
  overflow-y: auto; transition: width var(--t), background var(--t);
  scrollbar-width: none;            /* Firefox — sem barra */
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* WebKit — sem barra */
.sidebar.collapsed { width: 0; overflow: hidden; }

/* Botão Criar (M3 — elevado, pill) */
.create-wrap { padding: 14px 12px 4px; }
.create-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px 0 18px; border: none; border-radius: 16px;
  background: var(--surface); color: var(--on-surface);
  font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 4px 10px rgba(0,0,0,.12);
  transition: box-shadow var(--t), background var(--t);
}
.create-btn:hover { box-shadow: 0 2px 6px rgba(0,0,0,.22), 0 8px 18px rgba(0,0,0,.16); background: var(--cal-cell-hover); }
.create-btn svg { color: var(--primary); }

/* Export / Import */
.sb-io { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sb-io-sep { color: var(--on-surface-dim); }

/* Mini calendar */
.mini-cal { padding: 8px 12px 8px; }
.mini-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini-cal-month { font-size: 13px; font-weight: 500; color: var(--on-surface-var); }
.mini-nav {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: transparent; cursor: pointer;
  color: var(--on-surface-dim); display: flex; align-items: center; justify-content: center; transition: background var(--t);
}
.mini-nav:hover { background: var(--state-hover); }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.mini-day-label { text-align: center; font-size: 10px; font-weight: 500; color: var(--on-surface-dim); padding: 4px 0; }
.mini-cell { display: flex; align-items: center; justify-content: center; padding: 1px 0; }
.mini-day {
  width: 28px; height: 28px; aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--on-surface-var); cursor: pointer; position: relative;
  transition: background var(--t);
}
.mini-day:hover:not(.today) { background: var(--state-hover); }
.mini-day.today { background: var(--primary); color: var(--on-primary); font-weight: 500; }
.mini-day.has-events::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
}
.mini-day.today.has-events::after { background: var(--on-primary); opacity: .7; }
.mini-day.other-month { color: var(--outline-var); pointer-events: none; }

/* Sidebar sections — sem divisórias, mais respiro */
.sb-section { padding: 10px 14px 8px; }
.sb-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 600; color: var(--on-surface-dim);
  letter-spacing: .4px; text-transform: uppercase; margin-bottom: 10px;
}
.sb-text-btn { font-size: 11px; color: var(--primary); background: none; border: none; cursor: pointer; font-family: var(--font); font-weight: 500; }

/* Gerenciar projetos */
.sb-title-actions { display: flex; align-items: center; gap: 8px; }
.sb-icon-btn { width: 22px; height: 22px; border-radius: 6px; border: none; background: transparent; color: var(--primary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background var(--t); }
.sb-icon-btn:hover { background: var(--state-hover); }
.proj-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; max-height: 52vh; overflow-y: auto; }
.proj-block { padding: 8px; border-radius: 12px; background: var(--surface-2); }
.proj-row, .camp-row { display: flex; align-items: center; gap: 8px; }
.camp-row { margin-top: 6px; padding-left: 18px; }
.proj-row input[type=color], .camp-row input[type=color] { width: 28px; height: 28px; border: none; border-radius: 8px; background: none; cursor: pointer; padding: 0; flex-shrink: 0; }
.camp-row input[type=color] { width: 22px; height: 22px; }
.proj-name { flex: 1; min-width: 0; font-family: var(--font); font-size: 14px; color: var(--on-surface); background: var(--surface); border: 1px solid var(--outline); border-radius: 8px; padding: 7px 10px; outline: none; }
.proj-name:focus { border-color: var(--primary); }
.proj-del { width: 28px; height: 28px; border: none; background: transparent; color: var(--on-surface-dim); border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--t), color var(--t); }
.proj-del:hover { background: rgba(217,48,37,.1); color: #d93025; }
.proj-base-tag { font-size: 10px; color: var(--on-surface-dim); padding: 0 8px; white-space: nowrap; }
.proj-add-camp { margin-top: 8px; margin-left: 18px; font-size: 12px; color: var(--primary); background: none; border: none; cursor: pointer; font-family: var(--font); font-weight: 500; padding: 2px 0; }
.proj-add-camp:hover { text-decoration: underline; }
.proj-add { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 1px dashed var(--outline-var); border-radius: 12px; background: transparent; color: var(--on-surface-var); font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; transition: background var(--t); }
.proj-add:hover { background: var(--state-hover); }
.sb-text-btn:hover { text-decoration: underline; }

/* Lente segmented */
.lens-wrap { padding: 14px 14px 4px; }
.lens-label { font-size: 11px; font-weight: 500; color: var(--on-surface-dim); letter-spacing: .6px; text-transform: uppercase; display: block; margin-bottom: 8px; }
.lens-btns { display: flex; border: 1px solid var(--outline-var); border-radius: 8px; overflow: hidden; background: var(--surface); }
.lens-btn {
  flex: 1; padding: 8px 4px; border: none; background: transparent; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--on-surface-var);
  transition: background var(--t), color var(--t);
}
.lens-btn + .lens-btn { border-left: 1px solid var(--outline-var); }
.lens-btn:hover:not(.active) { background: var(--state-hover); }
.lens-btn.active { background: var(--primary-cont); color: var(--on-primary-cont); font-weight: 600; }

/* ── Legenda (estilo "Meus calendários") — lista plana, alinhada ── */
/* Checkbox colorido = mostrador da cor (Google style) */
.cal-check {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 5px; flex-shrink: 0; cursor: pointer; margin: 0;
  border: 2px solid var(--cal-color, var(--on-surface-dim));
  background: transparent; position: relative; transition: background var(--t), border-color var(--t);
}
.cal-check:checked { background: var(--cal-color, var(--primary)); border-color: var(--cal-color, var(--primary)); }
.cal-check:checked::after {
  content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
/* night vision: tique escuro (cor do fundo) sobre a cor da agenda */
[data-theme="dark"] .cal-check:checked::after { border-color: var(--cal-bg); }

.leg-row {
  display: flex; align-items: center; gap: 11px; min-width: 0;
  padding: 6px 8px; border-radius: 9px; cursor: pointer;
  transition: background var(--t);
}
.leg-row:hover { background: var(--state-hover); }
.leg-row.parent:hover { background: var(--state-press); }   /* hierarquia maior ilumina mais */
.leg-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-row.parent .leg-label { font-size: 14px; font-weight: 600; color: var(--on-surface); }
.leg-row.child  .leg-label { font-size: 13px; font-weight: 400; color: var(--on-surface-var); }
.leg-count { font-size: 11px; color: var(--on-surface-dim); font-variant-numeric: tabular-nums; }
.leg-row.focused { background: var(--state-hover); }
.leg-row.focused .leg-label { color: var(--primary); }

/* Stats */
.stats-row { display: flex; }
.stat-cell { flex: 1; text-align: center; padding: 8px 4px; border-right: 1px solid var(--outline); }
.stat-cell:last-child { border-right: none; }
.stat-num { display: block; font-size: 20px; font-weight: 500; color: var(--primary); }
.stat-lbl { font-size: 10px; color: var(--on-surface-dim); margin-top: 1px; }

.copa-progress-wrap { padding: 8px 12px 12px; }
.copa-progress-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--on-surface-dim); margin-bottom: 4px; }
.copa-progress-track { height: 4px; background: var(--outline); border-radius: 2px; overflow: hidden; }
.copa-progress-fill { height: 100%; background: var(--primary); border-radius: 2px; width: 0; transition: width .8s var(--t); }

.gancho-card { margin: 0 12px 12px; padding: 10px 12px; border-radius: 12px; background: var(--primary-cont); border-left: 3px solid var(--primary); }
.gancho-title { font-size: 11px; font-weight: 600; color: var(--on-primary-cont); margin-bottom: 4px; }
.gancho-body  { font-size: 11px; color: var(--on-primary-cont); line-height: 1.55; opacity: .92; }

.sb-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--outline); }
.sb-footer-text { font-size: 11px; color: var(--on-surface-dim); line-height: 1.6; }

/* ══ CALENDAR MAIN — frame arredondado, grid de linhas (Google Calendar web) ══ */
.calendar-main {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: var(--cal-bg); border-radius: 16px; margin: 6px 10px 10px 4px;
  box-shadow: var(--card-shadow);
  transition: margin-right var(--t), background var(--t);
}
.calendar-main.panel-open { margin-right: var(--panel-w); }

.day-headers {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--outline); flex-shrink: 0;
}
.day-header { text-align: center; padding: 12px 4px 8px; font-size: 11px; font-weight: 600; color: var(--on-surface-dim); letter-spacing: .5px; text-transform: uppercase; }

.calendar-grid {
  flex: 1; display: grid; grid-template-columns: repeat(7, 1fr);
  overflow: hidden;                 /* mês inteiro cabe — sem rolagem */
}

.day-cell {
  border-right: 1px solid var(--outline); border-bottom: 1px solid var(--outline);
  padding: 4px 5px 6px; min-height: 0; overflow: hidden; position: relative;
  transition: background var(--t);
}
.calendar-grid .day-cell:nth-child(7n) { border-right: none; }
.day-cell:hover { background: var(--cell-hover); }
.day-cell.other-month .day-num { color: var(--outline-var); }
.day-cell.copa-day { background: color-mix(in srgb, var(--primary) 6%, var(--cal-bg)); }
[data-theme="dark"] .day-cell.copa-day { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }

/* Número do dia — centralizado no topo, círculo perfeito */
.day-num {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; aspect-ratio: 1; border-radius: 50%;
  margin: 1px auto 3px; font-size: 12px; font-weight: 500; color: var(--on-surface-var);
  cursor: pointer; transition: background var(--t), color var(--t);
}
.day-cell:hover .day-num { background: var(--state-hover); }
.day-cell.today .day-num { background: var(--primary); color: var(--on-primary); font-weight: 600; }

.cell-events { display: flex; flex-direction: column; gap: 1px; }

/* Evento COM HORÁRIO = dot + hora + texto (Google Calendar atual) */
.event-item {
  display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 6px; border-radius: 6px;
  cursor: pointer; overflow: hidden; max-width: 100%; transition: background var(--t);
}
.event-item:hover { background: var(--state-hover); }
.event-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--dot, var(--primary)); }
.event-dot.stroke { background: transparent; box-shadow: inset 0 0 0 2px var(--dot); }
.event-time { font-size: 12px; color: var(--on-surface-var); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.event-text { font-size: 12px; color: var(--on-surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* publicado = recua (dessaturado, menor atenção) */
.event-item.published .event-dot { filter: grayscale(.65); opacity: .8; }
.event-item.published .event-time, .event-item.published .event-text { color: var(--on-surface-dim); }
.event-chip.published { filter: grayscale(.6) brightness(.94); }
[data-theme="dark"] .event-chip.published { filter: grayscale(.55) brightness(.72); }
/* dia inteiro incompleto = só contorno */
.event-chip.incomplete { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--cc); }
.event-chip.incomplete .chip-label { color: var(--on-surface) !important; }

/* Evento de DIA INTEIRO = barra preenchida */
.event-chip {
  display: flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; overflow: hidden;
  transition: filter var(--t); max-width: 100%;
}
.event-chip:hover { filter: brightness(1.06); }
[data-theme="dark"] .event-chip:hover { filter: brightness(1.18); }
.chip-label { overflow: hidden; text-overflow: ellipsis; flex: 1; }

.more-link { font-size: 11px; font-weight: 500; color: var(--on-surface-dim); padding: 1px 5px; cursor: pointer; border-radius: 5px; display: inline-block; transition: background var(--t); }
.more-link:hover { background: var(--state-hover); color: var(--primary); }

/* ══ WEEK VIEW — timeline por horas ══ */
.wk-gutter-w { width: 56px; }

.wk-head {
  display: grid; grid-template-columns: 56px repeat(7, 1fr);
  border-bottom: 1px solid var(--outline); flex-shrink: 0;
}
.wk-corner { }
.wk-dayhead { text-align: center; padding: 8px 2px 6px; border-left: 1px solid var(--outline); }
.wk-dow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--on-surface-dim); }
.wk-dnum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; aspect-ratio: 1; border-radius: 50%; margin-top: 3px;
  font-size: 16px; font-weight: 400; color: var(--on-surface);
}
.wk-dayhead.today .wk-dnum { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.wk-dayhead.today .wk-dow { color: var(--primary); }

.wk-allday {
  display: grid; grid-template-columns: 56px repeat(7, 1fr);
  border-bottom: 1px solid var(--outline); flex-shrink: 0; min-height: 26px;
}
.wk-liturgico { background: color-mix(in srgb, #6a4fb0 6%, transparent); }
.wk-santos { background: color-mix(in srgb, #7e6a52 7%, transparent); }
.wk-allday-label { font-size: 10px; color: var(--on-surface-dim); text-align: right; padding: 5px 6px 0 0; line-height: 1.2; align-self: start; font-weight: 600; }
.wk-allday-label.lit { color: #8a6fd0; }
.wk-allday-label.san { color: #a08763; }
/* min-width:0 + overflow impede o chip de vazar pra colunas vizinhas */
.wk-allday-col { border-left: 1px solid var(--outline); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.wk-allday-col .event-chip { max-width: 100%; min-width: 0; }

.wk-scroll { flex: 1; overflow-y: auto; display: flex; scrollbar-width: none; }
.wk-scroll::-webkit-scrollbar { width: 0; display: none; }

.wk-gutter { width: 56px; flex-shrink: 0; position: relative; }
.wk-hour { position: relative; }
.wk-hour span { position: absolute; top: -7px; right: 8px; font-size: 10px; color: var(--on-surface-dim); font-variant-numeric: tabular-nums; }

.wk-cols { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); }
.wk-col { position: relative; border-left: 1px solid var(--outline); }
.wk-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--outline); opacity: .55; }

.wk-event {
  position: absolute; border-radius: 7px; padding: 3px 7px; overflow: hidden; cursor: pointer;
  font-size: 11px; line-height: 1.25; box-shadow: 0 1px 2px rgba(0,0,0,.18);
  display: flex; flex-direction: column; gap: 1px; transition: filter var(--t);
}
.wk-event:hover { filter: brightness(1.06); z-index: 5; }
[data-theme="dark"] .wk-event:hover { filter: brightness(1.18); }
.wk-ev-time { font-weight: 600; font-variant-numeric: tabular-nums; opacity: .9; }
.wk-ev-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* estados de produção no bloco da semana */
.wk-event.published { filter: grayscale(.6) brightness(.94); }
[data-theme="dark"] .wk-event.published { filter: grayscale(.55) brightness(.72); }
.wk-event.incomplete { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--cc); color: var(--on-surface) !important; }
.wk-event.incomplete .wk-ev-time { opacity: 1; color: var(--on-surface-var); }
.wk-now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--primary); z-index: 4; }
.wk-now-line::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* ══ AGENDA VIEW ══ */
.agenda-wrap { flex: 1; overflow-y: auto; }
.agenda-daygroup { }
.agenda-day-header {
  position: sticky; top: 0; background: var(--surface); z-index: 5;
  display: flex; align-items: center; gap: 16px; padding: 14px 24px 8px; border-bottom: 1px solid var(--outline);
}
.agenda-dn { font-size: 26px; font-weight: 300; color: var(--on-surface); min-width: 44px; }
.agenda-dn.today-dn { font-size: 20px; font-weight: 500; background: var(--primary); color: var(--on-primary); border-radius: 50%; width: 44px; height: 44px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.agenda-dm { font-size: 11px; font-weight: 500; color: var(--on-surface-dim); text-transform: uppercase; }
.agenda-dy { font-size: 12px; color: var(--on-surface-dim); }
.agenda-evrow { display: flex; align-items: flex-start; padding: 10px 24px; cursor: pointer; transition: background var(--t); gap: 14px; border-bottom: 1px solid var(--outline); }
.agenda-evrow:hover { background: var(--cell-hover); }
.agenda-evtime { font-size: 12px; font-weight: 700; color: var(--on-surface-var); min-width: 46px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.agenda-evstripe { width: 4px; border-radius: 2px; align-self: stretch; min-height: 22px; flex-shrink: 0; }
.agenda-evbody { flex: 1; min-width: 0; }
.agenda-evtitle { font-size: 14px; font-weight: 400; color: var(--on-surface); }
.agenda-evmeta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.meta-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 9px; border-radius: 10px; font-size: 10px; font-weight: 500; }
.meta-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 10px; background: var(--surface-2); color: var(--on-surface-var); }

/* ══ DETAIL PANEL ══ */
.detail-panel {
  position: fixed; top: var(--topbar-h); right: calc(-1 * var(--panel-w)); width: var(--panel-w); bottom: 0; z-index: 50;
  background: var(--surface); border-left: 1px solid var(--outline); box-shadow: var(--shadow-panel);
  display: flex; flex-direction: column; overflow: hidden; transition: right var(--t);
}
.detail-panel.open { right: 0; }
.detail-topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--outline); flex-shrink: 0; }
.detail-type-chip { height: 28px; padding: 0 14px; border-radius: 14px; font-size: 12px; font-weight: 500; display: flex; align-items: center; }
.detail-scroll { flex: 1; overflow-y: auto; padding-bottom: 24px; }

.detail-bread { padding: 16px 20px 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bread-item { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500; }
.bread-dot { width: 7px; height: 7px; border-radius: 2px; }
.bread-sep { color: var(--on-surface-dim); }

.detail-title { padding: 10px 20px 4px; font-size: 20px; font-weight: 400; color: var(--on-surface); line-height: 1.3; }

/* Stepper de etapas de produção */
.stepper { display: flex; align-items: center; padding: 12px 20px 4px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.step-dot {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; border: 2px solid var(--outline-var); color: var(--on-surface-dim);
  background: transparent;
}
.step.done .step-dot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.step-lbl { font-size: 10px; color: var(--on-surface-dim); white-space: nowrap; }
.step.done .step-lbl { color: var(--on-surface-var); font-weight: 500; }
.step-line { flex: 1; height: 2px; background: var(--outline); margin: 0 4px 16px; min-width: 12px; }

/* Bloco de briefing */
.brief-block { margin: 14px 20px 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--primary); }
.brief-label { font-size: 10px; font-weight: 600; color: var(--on-surface-dim); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.brief-text { font-size: 13px; color: var(--on-surface); line-height: 1.55; white-space: pre-wrap; }

/* Toggles de produção (editor) */
.prod-toggles { display: flex; gap: 18px; }
.prod-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--on-surface); cursor: pointer; }
.prod-toggle input { accent-color: var(--primary); width: 16px; height: 16px; }
.prod-hint { font-size: 11px; color: var(--on-surface-dim); margin-top: 8px; }

/* Preview da mídia */
.media-preview { margin: 14px 20px 4px; }
.preview-frame {
  border-radius: 12px; border: 1px solid var(--outline); overflow: hidden; position: relative;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  max-height: 320px; margin: 0 auto; width: 100%;
}
.preview-frame.r-square    { aspect-ratio: 1 / 1; max-width: 280px; }
.preview-frame.r-portrait  { aspect-ratio: 9 / 16; max-width: 200px; }
.preview-frame.r-wide      { aspect-ratio: 16 / 9; max-width: 100%; }
.preview-glyph { color: var(--on-surface-dim); opacity: .5; }
.preview-badge {
  position: absolute; bottom: 8px; left: 8px; height: 22px; padding: 0 10px; border-radius: 11px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 500; display: flex; align-items: center; gap: 5px;
}
.preview-carousel-dots { position: absolute; top: 8px; right: 8px; display: flex; gap: 3px; }
.preview-carousel-dots span { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.7); }
.preview-empty-note { font-size: 11px; color: var(--on-surface-dim); text-align: center; margin-top: 6px; font-style: italic; }

/* Legenda (caption) */
.caption-block { margin: 14px 20px 4px; }
.caption-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.caption-label { font-size: 10px; font-weight: 600; color: var(--on-surface-dim); text-transform: uppercase; letter-spacing: .5px; }
.caption-copy { font-size: 11px; color: var(--primary); background: none; border: none; cursor: pointer; font-family: var(--font); font-weight: 500; }
.caption-copy:hover { text-decoration: underline; }
.caption-box {
  background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 13px;
  color: var(--on-surface); line-height: 1.55; white-space: pre-wrap; border: 1px solid var(--outline);
}
.caption-box.empty { color: var(--on-surface-dim); font-style: italic; }

.detail-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 20px 0; font-size: 13px; }
.detail-ico { width: 18px; flex-shrink: 0; color: var(--on-surface-dim); margin-top: 1px; display: flex; justify-content: center; }
.detail-val { flex: 1; color: var(--on-surface-var); line-height: 1.5; }
.detail-lbl { display: block; font-size: 10px; font-weight: 600; color: var(--on-surface-dim); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }

.detail-divider { border: none; border-top: 1px solid var(--outline); margin: 14px 20px; }

.santo-card { margin: 8px 20px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--outline); }
.santo-name { font-size: 14px; font-weight: 500; color: var(--on-surface); margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.santo-swatch { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.santo-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.santo-badge { padding: 3px 8px; border-radius: 8px; font-size: 11px; background: var(--surface); color: var(--on-surface-var); border: 1px solid var(--outline); }

.chip-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 8px; font-size: 11px; background: var(--surface-2); color: var(--on-surface-var); }

.status-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500; }
.status-planejado { background: color-mix(in srgb, #34a853 18%, var(--surface)); color: #1e8e3e; }
.status-rascunho  { background: color-mix(in srgb, #f9ab00 20%, var(--surface)); color: #b06000; }
.status-publicado { background: var(--primary-cont); color: var(--on-primary-cont); }
[data-theme="dark"] .status-planejado { color: #81c995; }
[data-theme="dark"] .status-rascunho  { color: #fdd663; }

.detail-desc { margin: 8px 20px 0; padding: 10px 14px; border-radius: 9px; background: var(--surface-2); font-size: 12px; color: var(--on-surface-var); line-height: 1.6; border-left: 3px solid var(--outline); }
.detail-desc.highlight { border-left-color: var(--primary); background: var(--primary-cont); color: var(--on-primary-cont); }

/* CTA "criar conteúdo" */
.detail-cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 40px); margin: 16px 20px 4px; height: 42px; border: none; border-radius: 21px; background: var(--primary); color: var(--on-primary); font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: filter var(--t); }
.detail-cta:hover { filter: brightness(1.08); }

/* Day popover */
.day-popover { position: fixed; z-index: 60; width: 280px; max-height: 420px; overflow-y: auto; background: var(--surface); border: 1px solid var(--outline); border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.22); padding: 12px; }
.day-popover-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.day-popover-date { font-size: 14px; font-weight: 500; color: var(--on-surface); }
.day-popover-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; transition: background var(--t); }
.day-popover-row:hover { background: var(--state-hover); }
.day-popover-time { font-size: 11px; font-weight: 700; color: var(--on-surface-var); min-width: 38px; font-variant-numeric: tabular-nums; }
.day-popover-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.day-popover-title { font-size: 12px; color: var(--on-surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.overlay { display: none; position: fixed; inset: 0; z-index: 55; }
.overlay.visible { display: block; }

/* ══ GATE DE LOGIN / ONBOARDING (tela cheia) ══ */
.gate {
  position: fixed; inset: 0; z-index: 400; overflow: hidden;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--chrome);
}
.gate::before {
  content: ''; position: absolute; inset: -50px; z-index: 0;
  background: url('bg-login.jpg') center/cover no-repeat;
  filter: blur(11px) brightness(.42) saturate(1.15);
  transform: translate(var(--mx, 0), var(--my, 0)) scale(1.08);
  transition: transform .35s cubic-bezier(.2,0,0,1);
  will-change: transform;
}
.gate-card { position: relative; z-index: 1; }
.gate-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--on-surface-dim); font-size: 12px; }
.gate-or::before, .gate-or::after { content: ''; flex: 1; height: 1px; background: var(--outline); }
.gate-google {
  width: 100%; height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--outline-var); border-radius: 23px; background: var(--surface);
  color: var(--on-surface); font-family: var(--font); font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background var(--t);
}
.gate-google:hover { background: var(--surface-2); }
.gate-card {
  width: min(420px, 94vw); background: var(--surface); border-radius: 28px;
  box-shadow: 0 12px 48px rgba(0,0,0,.18); padding: 32px 28px 28px; text-align: center;
}
.gate-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 500; color: var(--on-surface-var); margin-bottom: 18px; }
.gate-brand .brand-mark { width: 32px; height: 32px; }
.gate-title { font-size: 24px; font-weight: 500; color: var(--on-surface); line-height: 1.25; margin-bottom: 8px; }
.gate-sub { font-size: 14px; color: var(--on-surface-var); line-height: 1.5; margin-bottom: 20px; }
.gate-input {
  width: 100%; height: 46px; padding: 0 14px; margin-bottom: 10px; border: 1px solid var(--outline-var);
  border-radius: 12px; background: var(--surface); color: var(--on-surface); font-family: var(--font);
  font-size: 15px; outline: none; transition: border-color var(--t);
}
.gate-input:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.gate-btn { width: 100%; height: 46px; margin-top: 6px; border-radius: 23px; font-size: 15px; justify-content: center; }
.gate .auth-tabs { margin-bottom: 14px; }
.gate .auth-msg { text-align: left; }
.ob-list { text-align: left; list-style: none; margin: 6px 0 18px; padding: 0; }
.ob-list li { font-size: 14px; color: var(--on-surface-var); padding: 8px 0 8px 28px; position: relative; line-height: 1.4; }
.ob-list li::before { content: ''; position: absolute; left: 4px; top: 12px; width: 8px; height: 8px; border-radius: 3px; }
.ob-list li:nth-child(1)::before { background: #7e6a52; }
.ob-list li:nth-child(2)::before { background: #6a4fb0; }

/* dia selecionado (clique no número) */
.day-cell.selected:not(.today) .day-num { box-shadow: 0 0 0 2px var(--primary); color: var(--primary); font-weight: 600; }

/* ══ PAINEL MARTIROLÓGIO (lateral direito) ══ */
.mart-head { display: flex; flex-direction: column; line-height: 1.2; }
.mart-title { font-size: 15px; font-weight: 600; color: var(--on-surface); }
.mart-date { font-size: 12px; color: var(--on-surface-dim); margin-top: 2px; }
.mart-scroll { flex: 1; overflow-y: auto; padding: 16px 20px; }
.mart-section {
  font-size: 11px; font-weight: 600; color: var(--on-surface-dim); text-transform: uppercase;
  letter-spacing: .5px; margin: 16px 0 8px;
}
.mart-section:first-child { margin-top: 0; }
.mart-item {
  padding: 10px 12px; border-radius: 12px; background: var(--surface-2);
  border-left: 3px solid var(--primary); margin-bottom: 8px;
}
.mart-item.lit { border-left-color: #6a4fb0; }
.mart-item-name { font-size: 14px; font-weight: 500; color: var(--on-surface); line-height: 1.4; }
.mart-item-sub { font-size: 12px; color: var(--on-surface-dim); margin-top: 3px; }
.mart-empty { font-size: 13px; color: var(--on-surface-dim); font-style: italic; padding: 8px 0; }
.mart-note { font-size: 11px; color: var(--on-surface-dim); margin-top: 16px; line-height: 1.5; }
.mart-foot { flex-shrink: 0; padding: 12px 16px; border-top: 1px solid var(--outline); }
.mart-foot .btn-text { width: 100%; justify-content: center; }

/* mídia nativa contextual (não-grosseira) */
.mart-promo { display: block; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--outline); text-decoration: none; color: var(--on-surface); transition: background var(--t); }
.mart-promo:hover { background: var(--cal-cell-hover); }
.mart-promo-eyebrow { font-size: 10px; font-weight: 600; color: var(--on-surface-dim); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.mart-promo-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 1.4; }
.mart-promo-row svg { color: var(--on-surface-dim); flex-shrink: 0; }

/* slot de mídia no rodapé da sidebar */
.hub-promo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--outline); text-decoration: none; transition: background var(--t); }
.hub-promo:hover { background: var(--cal-cell-hover); }
.hub-promo-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--primary); background: var(--primary-cont); border-radius: 6px; padding: 3px 6px; flex-shrink: 0; }
.hub-promo-text { font-size: 12px; color: var(--on-surface-var); flex: 1; line-height: 1.35; }

/* ══ EDITOR DE EVENTO (modal M3) ══ */
.editor-back {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: edfade var(--t);
}
@keyframes edfade { from { opacity: 0; } to { opacity: 1; } }
.editor {
  width: min(580px, 94vw); max-height: 90vh; overflow-y: auto;
  background: var(--surface); color: var(--on-surface); border-radius: 28px;
  box-shadow: 0 8px 40px rgba(0,0,0,.4); padding: 22px 24px 18px;
  scrollbar-width: none;
}
.editor::-webkit-scrollbar { display: none; }
.ed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ed-head h2 { font-size: 20px; font-weight: 500; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 11px; font-weight: 600; color: var(--on-surface-dim); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--font); font-size: 14px; color: var(--on-surface);
  background: var(--surface); border: 1px solid var(--outline-var); border-radius: 12px;
  padding: 10px 12px; outline: none; transition: border-color var(--t), box-shadow var(--t);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.field textarea { resize: vertical; line-height: 1.5; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-surface-var); align-self: flex-end; padding-bottom: 12px; white-space: nowrap; }
.field-check input { accent-color: var(--primary); width: 16px; height: 16px; }
.ed-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.btn-filled {
  height: 40px; padding: 0 24px; border: none; border-radius: 20px;
  background: var(--primary); color: var(--on-primary); font-family: var(--font);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: filter var(--t);
}
.btn-filled:hover { filter: brightness(1.08); }
.btn-text {
  height: 40px; padding: 0 16px; border: none; border-radius: 20px; background: transparent;
  color: var(--primary); font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background var(--t);
}
.btn-text:hover { background: var(--state-hover); }
.btn-text.danger { color: #d93025; }
[data-theme="dark"] .btn-text.danger { color: #f2b8b5; }
.btn-text.danger:hover { background: rgba(217,48,37,.1); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--outline-var); border-radius: 3px; }
