:root {
  --blue: #1a73e8;
  --blue-dark: #1557b0;
  --blue-soft: #eef3fe;
  --violet: #14181f;   /* acento escuro (antes roxo) */
  --green: #188038;
  --red: #d93025;
  --yellow: #f9ab00;
  --gray-900: #1c1d21;
  --gray-800: #2b2d33;
  --gray-700: #3c4043;
  --gray-600: #5f6368;
  --gray-400: #9aa0a6;
  --gray-200: #e3e6ea;
  --gray-100: #f0f2f5;
  --gray-50: #f7f9fc;
  --bg: #eef1f8;
  --card: #ffffff;
  /* Gradientes — azul para preto */
  --grad: linear-gradient(135deg, #2b8bff 0%, #1256b8 45%, #0c1116 100%);
  --grad-soft: linear-gradient(135deg, #eaf1ff 0%, #eef1f5 100%);
  --grad-text: linear-gradient(120deg, #1a73e8, #0c1116);
  --shadow-1: 0 1px 2px rgba(28,29,33,.06), 0 1px 3px rgba(28,29,33,.06);
  --shadow-2: 0 4px 14px rgba(12,17,22,.10), 0 2px 6px rgba(12,17,22,.06);
  --radius: 14px;
  --font: 'Google Sans', 'Roboto', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--gray-900);
  background:
    radial-gradient(1100px 500px at 100% -10%, #dbe7ff 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 0%, #dce9ff 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  height: 56px; padding: 0 14px;
  background: rgba(255,255,255,.6);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.5);
}
.icon-btn {
  border: 0; background: transparent; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--gray-600); font-size: 20px;
}
.icon-btn:hover { background: rgba(60,64,67,.08); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--grad); box-shadow: 0 4px 12px rgba(12,17,22,.32);
  color: #fff; font-weight: 700; font-size: 18px;
}
.brand-name {
  font-size: 18px; font-weight: 700; letter-spacing: .2px;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Environment switcher ---------- */
.env-switcher { position: relative; margin-left: 14px; }
.env-pill {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--gray-200); background: #fff; cursor: pointer;
  padding: 6px 12px 6px 8px; border-radius: 24px; font-family: var(--font);
  box-shadow: var(--shadow-1);
}
.env-pill:hover { background: var(--gray-50); }
.env-badge {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
}
.env-badge.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
.env-badge.all { background: var(--gray-400); }
.env-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.env-label { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--gray-600); }
.env-name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.env-caret { color: var(--gray-600); font-size: 12px; }

.env-menu {
  position: absolute; top: calc(100% + 8px); left: 0; width: 300px;
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-2);
  border: 1px solid var(--gray-200); padding: 8px; z-index: 40;
  display: none;
}
.env-menu.open { display: block; }
.env-menu-head { font-size: 12px; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px 6px; }
.env-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; }
.env-item:hover { background: var(--gray-100); }
.env-item.active { background: var(--blue-soft); }
.env-item-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.env-item-name { font-size: 14px; font-weight: 500; }
.env-item-role { font-size: 12px; color: var(--gray-600); }
.env-check { color: var(--blue); font-weight: 700; }
.env-item.all-envs { margin-top: 4px; border-top: 1px solid var(--gray-100); border-radius: 0 0 10px 10px; }

.env-strip { height: 4px; width: 100%; }

.search {
  flex: 1; max-width: 640px; margin-left: 20px;
  display: flex; align-items: center; gap: 10px;
  background: #eaf1fb; border-radius: 26px; padding: 0 18px; height: 46px;
  transition: background .15s, box-shadow .15s;
}
.search:focus-within { background: #fff; box-shadow: var(--shadow-1); }
.search-icon { color: var(--gray-600); }
.search input {
  border: 0; background: transparent; outline: none;
  width: 100%; font-size: 16px; color: var(--gray-900); font-family: var(--font);
}
.topbar-spacer { flex: 1; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: grid; place-items: center; font-weight: 600; cursor: pointer;
}

/* ---------- Layout ---------- */
.layout { display: flex; align-items: flex-start; }
.sidebar {
  width: 224px; flex-shrink: 0; padding: 8px 10px 24px;
  position: sticky; top: 56px; height: calc(100vh - 56px);
  overflow-y: auto;
}
.side-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--grad); color: #fff;
  padding: 11px 20px 11px 14px; border-radius: 14px;
  font-weight: 600; font-size: 13.5px; margin: 6px 4px 16px;
  box-shadow: 0 6px 16px rgba(12,17,22,.28);
}
.side-cta:hover { filter: brightness(1.06); }
.side-cta .plus { font-size: 20px; line-height: 1; }

.side-nav, .side-section { display: flex; flex-direction: column; gap: 2px; }
.side-section { margin-top: 18px; }
.side-label {
  font-size: 12px; font-weight: 600; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: .6px;
  padding: 6px 16px 4px;
}
.side-link {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 16px; border-radius: 0 24px 24px 0; margin-right: 8px;
  color: var(--gray-700); font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-link:hover { background: var(--gray-100); }
.side-link.active { background: var(--blue-soft); color: var(--blue-dark); }
.side-link .ico { color: var(--gray-600); font-size: 15px; }
.side-link.active .ico { color: var(--blue); }
.side-link.disabled { color: var(--gray-400); cursor: default; }
.side-link.disabled:hover { background: transparent; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.muted-future { opacity: .8; }

/* ---------- Content ---------- */
.content {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(6px);
  border-radius: 18px 0 0 0;
  border-left: 1px solid rgba(255,255,255,.6);
  min-height: calc(100vh - 56px);
  padding: 18px 26px 50px;
  box-shadow: var(--shadow-1);
}
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 6px; }
.page-head h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -.2px; }
.page-head .sub { color: var(--gray-600); font-size: 12.5px; margin-top: 3px; }
.breadcrumb { color: var(--gray-600); font-size: 12px; margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--blue); text-decoration: underline; }
.spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--gray-200); border-radius: 20px; cursor: pointer;
  padding: 7px 15px; font-size: 12.5px; font-weight: 600; font-family: var(--font);
  background: #fff; color: var(--gray-700); transition: all .15s;
}
.btn:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 4px 12px rgba(18,86,184,.28); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 6px 16px rgba(18,86,184,.38); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--blue-soft); }
.btn-danger { background: transparent; color: var(--red); }
.btn-danger:hover { background: #fce8e6; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ---------- Cards / grids ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 11px; margin: 14px 0 20px; }
.stat {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 12px 14px; color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); }
a.stat:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.stat .num { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.stat .lbl { color: var(--gray-600); font-size: 11.5px; margin-top: 1px; }
.stat.alert::before { background: linear-gradient(180deg, #ff5b5b, #d93025); }
.stat.alert .num { color: var(--red); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card {
  background: var(--card); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 13px 15px;
  transition: box-shadow .15s, border-color .15s, transform .15s;
  display: flex; flex-direction: column; gap: 8px;
}
.card:hover { box-shadow: var(--shadow-2); border-color: transparent; transform: translateY(-1px); }
.card h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card .muted { color: var(--gray-600); font-size: 12px; }

.org-card-top { display: flex; align-items: center; gap: 12px; }
.org-badge {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px;
}
.org-badge img, .env-badge img { width: 100%; height: 100%; object-fit: cover; }

/* progress bar */
.progress { height: 6px; border-radius: 6px; background: var(--gray-100); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 6px; }

/* section titles */
.section-title { font-size: 12.5px; font-weight: 700; color: var(--gray-700); margin: 20px 0 9px; text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 14px; height: 3px; border-radius: 3px; background: var(--grad); }

/* ---------- Kanban ---------- */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.col { background: var(--gray-50); border-radius: 14px; padding: 10px; min-height: 120px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 10px; font-size: 13px; font-weight: 600; color: var(--gray-700); }
.col-count { background: var(--gray-200); color: var(--gray-700); border-radius: 12px; padding: 1px 9px; font-size: 12px; }
.tcard {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  padding: 12px; margin-bottom: 8px; cursor: grab;
  display: flex; flex-direction: column; gap: 8px;
}
.tcard:hover { box-shadow: var(--shadow-1); }
.tcard.dragging { opacity: .5; }
.tcard .t-title { font-size: 14px; font-weight: 500; line-height: 1.35; }
.tcard .t-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.col.drop-hover { outline: 2px dashed var(--blue); outline-offset: -4px; }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  background: var(--gray-100); color: var(--gray-700); white-space: nowrap;
}
.chip.baixa { background: #e6f4ea; color: #137333; }
.chip.media { background: #e8f0fe; color: #1967d2; }
.chip.alta { background: #fef7e0; color: #b06000; }
.chip.urgente { background: #fce8e6; color: #c5221f; }
.chip.due { background: #f1f3f4; color: var(--gray-700); }
.chip.due.over { background: #fce8e6; color: #c5221f; }

/* ---------- Tables / lists ---------- */
.tlist { display: flex; flex-direction: column; }
.trow {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-bottom: 1px solid var(--gray-100); border-radius: 8px;
}
.trow:hover { background: var(--grad-soft); }
.trow .grow { flex: 1; min-width: 0; }
.trow .t-title { font-weight: 600; font-size: 13px; }
.trow .t-sub { color: var(--gray-600); font-size: 11.5px; }

/* ---------- Steps ---------- */
.steps { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; }
.step { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 8px; }
.step:hover { background: var(--gray-50); }
.step input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }
.step.done .step-title { text-decoration: line-through; color: var(--gray-400); }
.step .step-title { flex: 1; font-size: 14px; }
.step .del { opacity: 0; }
.step:hover .del { opacity: 1; }

/* ---------- Financeiro: anexo na tela ---------- */
.anexo-view { max-width: 820px; width: 100%; border: 1px solid var(--gray-200); border-radius: 12px; background: #fff; }
.anexo-view.pdf { height: 640px; }
.trow.is-done .t-title { text-decoration: line-through; color: var(--gray-400); }

/* ---------- Chat / Assistente ---------- */
.chat { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 20px; }
.bubble { max-width: 760px; padding: 12px 16px; border-radius: 16px; line-height: 1.55; font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: var(--gray-100); color: var(--gray-900); border-bottom-left-radius: 4px; }
.bot-actions { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.bot-action { background: #e6f4ea; color: #137333; border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 500; }
.chat-suggestions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; max-width: 560px; margin-left: auto; margin-right: auto; }
.chat-suggestions span { background: var(--blue-soft); color: var(--blue-dark); border-radius: 12px; padding: 10px 14px; font-size: 13px; cursor: pointer; text-align: left; }
.chat-suggestions span:hover { background: #d7e6fd; }
.chat-input { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 0; background: linear-gradient(180deg, transparent, var(--card) 30%); }
.chat-input input { flex: 1; border: 1px solid var(--gray-200); border-radius: 24px; padding: 12px 16px; font-size: 14px; font-family: var(--font); outline: none; }
.chat-input input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.mic-btn {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--gray-200);
  background: #fff; cursor: pointer; font-size: 18px; transition: all .15s;
}
.mic-btn:hover { background: var(--gray-50); }
.mic-btn.rec { background: var(--grad); border: 0; box-shadow: 0 0 0 0 rgba(217,48,37,.5); animation: micpulse 1.2s infinite; }
@keyframes micpulse { 0% { box-shadow: 0 0 0 0 rgba(26,115,232,.5); } 70% { box-shadow: 0 0 0 10px rgba(26,115,232,0); } 100% { box-shadow: 0 0 0 0 rgba(26,115,232,0); } }
.voice-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--gray-700); background: #fff; border: 1px solid var(--gray-200); border-radius: 20px; padding: 5px 12px; cursor: pointer; }
.voice-toggle input { width: auto; accent-color: var(--violet); }
.wake-hint { background: var(--grad-soft); border: 1px solid rgba(26,115,232,.20); color: #12304f; border-radius: 10px; padding: 8px 14px; font-size: 12.5px; margin: 8px 0; }
.bubble.bot { position: relative; }
.speak-btn { position: absolute; bottom: 4px; right: 6px; border: 0; background: transparent; cursor: pointer; font-size: 12px; opacity: 0; transition: opacity .15s; }
.bubble.bot:hover .speak-btn { opacity: .7; }
.speak-btn:hover { opacity: 1 !important; }

/* ---------- Leitor de e-mail ---------- */
.mail-body {
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  padding: 20px 22px; margin-top: 12px; line-height: 1.6; color: var(--gray-800, #3c4043);
  font-size: 14px; max-width: 820px;
}

/* ---------- Briefing (norte do dia, IA) ---------- */
.briefing {
  position: relative; border-radius: 16px; padding: 2px; margin: 14px 0 12px;
  background: var(--grad);
  box-shadow: 0 8px 24px rgba(12,17,22,.20);
}
.briefing-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 4px; }
.briefing-badge { color: #fff; font-weight: 700; font-size: 12.5px; letter-spacing: .3px; }
.briefing-refresh { background: rgba(255,255,255,.2); color: #fff; border: 0; padding: 4px 10px; }
.briefing-refresh:hover { background: rgba(255,255,255,.32); }
.briefing-body {
  background: #fff; border-radius: 14px; margin: 0 2px 2px; padding: 13px 16px;
  font-size: 13px; line-height: 1.6; color: var(--gray-800); white-space: pre-wrap; min-height: 40px;
}
.briefing-loading { color: var(--violet); font-weight: 600; }
.briefing-loading::after { content: "▍"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Feed de alertas ---------- */
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 11px; margin: 12px 0 6px; }
.feed-card {
  display: block; background: #fff; border: 1px solid var(--gray-200); border-left: 4px solid var(--gray-400);
  border-radius: 12px; padding: 11px 13px; transition: box-shadow .15s, transform .15s; color: inherit;
}
.feed-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.feed-top { display: flex; align-items: center; justify-content: space-between; }
.feed-icon { font-size: 18px; }
.feed-count { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.feed-title { font-size: 12px; font-weight: 700; color: var(--gray-700); margin-top: 2px; }
.feed-items { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.feed-line { font-size: 11px; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-card.red { border-left-color: #ea4335; } .feed-card.red .feed-count { color: #d93025; }
.feed-card.blue { border-left-color: var(--blue); } .feed-card.blue .feed-count { color: var(--blue-dark); }
.feed-card.amber { border-left-color: #f9ab00; } .feed-card.amber .feed-count { color: #b06000; }
.feed-card.violet { border-left-color: var(--violet); } .feed-card.violet .feed-count { color: #0d47a1; }
.feed-card.gray { border-left-color: var(--gray-400); } .feed-card.gray .feed-count { color: var(--gray-600); }
.feed-clear { background: #e6f4ea; color: #137333; border-radius: 12px; padding: 12px 16px; font-size: 13px; font-weight: 600; margin: 12px 0; }

/* ---------- Agenda (próximos dias) ---------- */
.agenda {
  background: var(--grad-soft);
  border: 1px solid rgba(26,115,232,.16); border-radius: var(--radius);
  padding: 13px 16px; margin: 14px 0 6px;
}
.agenda-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.agenda-head h2 { font-size: 14px; font-weight: 700; margin: 0; }
.agenda-block { margin-bottom: 10px; }
.agenda-day {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--gray-700);
  padding: 8px 4px 4px;
}
.agenda-day .count { background: var(--gray-100); border-radius: 10px; padding: 0 8px; font-size: 12px; color: var(--gray-600); }
.agenda-block.overdue .agenda-day { color: var(--red); }
.dot.red { background: var(--red); } .dot.blue { background: var(--blue); }

/* ---------- Tarefa row (checkbox concluir) ---------- */
.trow.tarefa .tarefa-check { width: 19px; height: 19px; accent-color: var(--green); cursor: pointer; flex-shrink: 0; }
.trow.tarefa.is-done .t-title { text-decoration: line-through; color: var(--gray-400); }
.strike { text-decoration: line-through; color: var(--gray-400); }
.muted-chip { background: var(--gray-50) !important; color: var(--gray-400) !important; }

/* ---------- Calendário ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; margin: 8px 0 16px; }
.cal-title { font-size: 20px; font-weight: 500; margin: 0; min-width: 200px; }
/* minmax(0,…) e não 1fr puro: os .cal-item têm white-space:nowrap, e o piso
   automático da coluna seria a largura do texto inteiro — um título comprido
   esticava a coluna e empurrava as outras para fora da tela. */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--gray-200); border: 1px solid var(--gray-200); border-radius: 12px; overflow: hidden; }
.cal-wd { background: var(--gray-50); text-align: center; font-size: 12px; font-weight: 600; color: var(--gray-600); padding: 8px 0; }
.cal-cell { background: #fff; min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.other { background: var(--gray-50); }
.cal-cell.today { background: #e8f0fe; }
.cal-daynum { font-size: 12px; font-weight: 600; color: var(--gray-600); align-self: flex-start; }
.cal-cell.today .cal-daynum { background: var(--blue); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.cal-item {
  font-size: 11px; line-height: 1.25; padding: 2px 6px; border-radius: 6px;
  background: var(--blue-soft); color: var(--blue-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 3px solid var(--blue);
}
.cal-item.pr-alta { border-left-color: var(--yellow); background: #fef7e0; color: #b06000; }
.cal-item.pr-urgente { border-left-color: var(--red); background: #fce8e6; color: #c5221f; }
.cal-item.over { background: #fce8e6; color: #c5221f; border-left-color: var(--red); }
.cal-item.done { text-decoration: line-through; opacity: .55; }
.cal-item.other-org { background: var(--gray-50); color: var(--gray-600); border-left-width: 3px; opacity: .9; }
.cal-item.evento { background: #eef4ff; color: #0d3c78; border-left-width: 3px; font-weight: 600; }
.cal-item b { font-weight: 700; }

@media (max-width: 900px) {
  .cal-cell { min-height: 72px; }
  .cal-item { font-size: 10px; }
}

/* ---------- Assignees / avatars ---------- */
.avatars { display: inline-flex; align-items: center; }
.mini-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600;
  background: var(--blue); border: 2px solid #fff; margin-left: -7px;
}
.avatars .mini-avatar:first-child { margin-left: 0; }
.mini-avatar.more { background: var(--gray-400); }
.assignee-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.assignee-chip { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: 12px; max-width: 480px; }
.assignee-chip .mini-avatar { width: 34px; height: 34px; font-size: 13px; margin: 0; border: 0; }
.assignee-chip span span, .assignee-chip a { display: block; }
.assignee-chip a { font-size: 12px; }
.tag-avulsa { background: #fff3e0; color: #b06000; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.field-hint { font-size: 12px; color: var(--gray-600); }
select.multi { min-height: 92px; padding: 6px; }
select.multi option { padding: 5px 8px; border-radius: 6px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.field input, .field textarea, .field select {
  font-family: var(--font); font-size: 14px; color: var(--gray-900);
  border: 1px solid var(--gray-200); border-radius: 10px; padding: 11px 13px; outline: none;
  background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.field textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inline-form { display: flex; gap: 10px; align-items: center; }
.inline-form input { flex: 1; }

/* ---------- Modal / dialog ---------- */
dialog {
  border: 0; border-radius: 20px; padding: 26px; width: min(520px, 92vw);
  box-shadow: 0 24px 48px rgba(0,0,0,.28); color: var(--gray-900);
}
dialog::backdrop { background: rgba(32,33,36,.5); }
dialog h2 { margin: 0 0 18px; font-size: 20px; font-weight: 500; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---------- Flash ---------- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash { padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.flash-success { background: #e6f4ea; color: #137333; }
.flash-error { background: #fce8e6; color: #c5221f; }

.empty { text-align: center; color: var(--gray-600); padding: 48px 20px; }
.empty .big { font-size: 46px; opacity: .5; }

/* ---------- Responsive ----------
   O comportamento de celular vive todo na seção "Celular / experiência de app",
   no fim do arquivo. Aqui ficam só os ajustes de grade em telas médias. */
@media (max-width: 900px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Documentação (/docs) ---------- */
.topbar-doc {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-size: 18px; margin-right: 6px; border: 1px solid var(--gray-200); background: #fff;
  transition: all .15s;
}
.topbar-doc:hover { background: var(--grad); border-color: transparent; transform: translateY(-1px); }
.doc-search { border: 1px solid var(--gray-200); border-radius: 20px; padding: 8px 14px; font-size: 13px; font-family: var(--font); outline: none; min-width: 230px; }
.doc-search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.doc-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 18px; }
.doc-toc a { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 16px; background: var(--gray-100); color: var(--gray-700); }
.doc-toc a:hover { background: var(--grad); color: #fff; }
.doc-h2 { font-size: 15px; font-weight: 800; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--gray-200); scroll-margin-top: 70px; }
.doc-h3 { font-size: 13.5px; font-weight: 700; margin: 0 0 6px; }
.doc-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; scroll-margin-top: 70px; }
.doc-resumo { color: var(--gray-700); margin: 0 0 8px; font-size: 13px; }
.doc-lista { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--gray-700); line-height: 1.55; }
.doc-lista.fn { list-style: none; padding-left: 0; gap: 8px; }
.doc-sub { margin-top: 10px; font-size: 12.5px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; display: block; overflow-x: auto; }
.doc-table th { text-align: left; color: var(--gray-600); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.doc-table td { padding: 6px 8px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.doc-table tbody tr:hover { background: var(--gray-50); }
.doc-table code, .fn-sig { background: var(--gray-100); border-radius: 5px; padding: 1px 6px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.fn-sig { display: inline-block; background: #0c1116; color: #eaf1ff; }
code.param { background: var(--blue-soft); color: var(--blue-dark); }
.mth { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 5px; margin-right: 3px; background: var(--gray-200); color: var(--gray-700); }
.mth.get { background: #e6f4ea; color: #137333; }
.mth.post { background: #fef7e0; color: #b06000; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; margin-right: 4px; }
.tag.pk { background: var(--blue-soft); color: var(--blue-dark); }
.tag.fk { background: #f3e8ff; color: #6b21a8; }
.tag.req { background: #fce8e6; color: #c5221f; }

/* ---------- Saúde ---------- */
.perfil-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.perfil-chip {
  display:inline-flex; align-items:center; gap:8px; padding:6px 12px; border-radius:20px;
  border:1px solid var(--gray-200); background:#fff; font-size:13px; font-weight:500;
  color:var(--gray-700);
}
.perfil-chip.active { background:var(--blue-soft); border-color:var(--blue); color:var(--blue-dark); }

/* Aviso médico — presente em toda tela do módulo */
.med-disclaimer {
  display:flex; gap:10px; align-items:flex-start; padding:10px 14px; margin:0 0 16px;
  background:#fff8e1; border:1px solid #ffe08a; border-radius:10px;
  font-size:12.5px; line-height:1.5; color:#6b5200;
}

/* Doses do dia */
.dose-row {
  display:flex; align-items:center; gap:12px; padding:11px 4px;
  border-bottom:1px solid var(--gray-100);
}
.dose-row:last-child { border-bottom:0; }
.dose-hora {
  min-width:52px; font-variant-numeric:tabular-nums; font-weight:700; font-size:14px;
  color:var(--gray-700);
}
.dose-row.taken { opacity:.55; }
.dose-row.taken .dose-nome { text-decoration:line-through; }
.dose-row.late .dose-hora { color:var(--red); }
.dose-nome { font-weight:500; font-size:14px; }
.dose-sub { font-size:12px; color:var(--gray-600); }
.dose-actions { display:flex; gap:6px; margin-left:auto; }

/* Selo de classificação — cor SEMPRE acompanhada do rótulo em texto */
.tag-class {
  display:inline-flex; align-items:center; gap:5px; padding:2px 9px; border-radius:20px;
  font-size:11.5px; font-weight:600; border:1px solid currentColor; background:#fff;
}
.tag-class .dot { width:7px; height:7px; border-radius:50%; background:currentColor; }

/* Cartão de métrica com sparkline */
.metric-card {
  background:var(--card); border:1px solid var(--gray-200); border-radius:var(--radius);
  padding:14px 16px; box-shadow:var(--shadow-1); display:flex; flex-direction:column; gap:6px;
}
.metric-head { display:flex; align-items:center; gap:8px; }
.metric-label { font-size:12.5px; color:var(--gray-600); font-weight:500; }
.metric-value { font-size:26px; font-weight:700; letter-spacing:-.5px; font-variant-numeric:tabular-nums; }
.metric-unit { font-size:13px; font-weight:500; color:var(--gray-600); }
.metric-meta { font-size:11.5px; color:var(--gray-600); }
.trend { font-size:11.5px; font-weight:600; }

/* Gráficos */
.chart-wrap { position:relative; }
.chart-wrap svg { display:block; width:100%; overflow:visible; }
.chart-grid line { stroke:var(--gray-200); stroke-width:1; }
.chart-axis { font-size:10.5px; fill:var(--gray-600); font-variant-numeric:tabular-nums; }
.chart-band { fill:#188038; opacity:.07; }
.chart-band-label { font-size:10px; fill:var(--gray-600); }
.chart-line { fill:none; stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.chart-dot { stroke:#fff; stroke-width:2; }
.chart-hit { fill:transparent; cursor:crosshair; }
.chart-cursor { stroke:var(--gray-400); stroke-width:1; stroke-dasharray:3 3; }
.chart-tip {
  position:absolute; pointer-events:none; background:var(--gray-900); color:#fff;
  padding:7px 10px; border-radius:8px; font-size:12px; line-height:1.45; white-space:nowrap;
  box-shadow:var(--shadow-2); opacity:0; transition:opacity .12s; z-index:5;
}
.chart-tip.on { opacity:1; }
.chart-legend { display:flex; gap:14px; flex-wrap:wrap; font-size:12px; color:var(--gray-700); margin-top:6px; }
.chart-legend span { display:inline-flex; align-items:center; gap:6px; }
.chart-legend i { width:11px; height:3px; border-radius:2px; display:inline-block; }
.sparkline { width:100%; height:34px; display:block; }

/* Calendário de adesão */
.adesao-grid { display:grid; grid-template-columns:repeat(15, 1fr); gap:4px; max-width:460px; }
.adesao-cell {
  aspect-ratio:1; border-radius:4px; background:var(--gray-100);
  border:1px solid var(--gray-200);
}
.adesao-legend { display:flex; gap:12px; font-size:11.5px; color:var(--gray-600); margin-top:8px; align-items:center; }

/* Painel da análise da IA */
.analise-box {
  background:var(--card); border:1px solid var(--gray-200); border-radius:var(--radius);
  padding:18px 20px; box-shadow:var(--shadow-1); margin-bottom:16px;
}
.analise-resumo { font-size:15px; line-height:1.65; }
.analise-sec { margin-top:16px; }
.analise-sec h4 {
  font-size:11.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--gray-600);
  margin:0 0 8px;
}
.acao-item {
  display:flex; gap:10px; align-items:flex-start; padding:9px 0;
  border-bottom:1px solid var(--gray-100); font-size:13.5px; line-height:1.5;
}
.acao-item:last-child { border-bottom:0; }
.prio { flex:none; padding:1px 8px; border-radius:20px; font-size:10.5px; font-weight:700;
        text-transform:uppercase; letter-spacing:.4px; }
.prio.alta { background:#fce8e6; color:#c5221f; }
.prio.media { background:#fef7e0; color:#976500; }
.prio.baixa { background:var(--gray-100); color:var(--gray-700); }

/* Itens de exame */
.exame-item { display:flex; align-items:center; gap:12px; padding:10px 4px;
              border-bottom:1px solid var(--gray-100); }
.exame-item:last-child { border-bottom:0; }
.exame-nome { font-weight:500; font-size:13.5px; }
.exame-expl { font-size:12px; color:var(--gray-600); line-height:1.45; }
.exame-valor { font-weight:700; font-variant-numeric:tabular-nums; text-align:right; }
.exame-ref { font-size:11.5px; color:var(--gray-600); font-variant-numeric:tabular-nums; }

@media (max-width: 720px) {
  .adesao-grid { grid-template-columns:repeat(10, 1fr); }
  .dose-actions { margin-left:0; width:100%; }
}

/* ---------- Documentos ---------- */
.dropzone {
  border:2px dashed var(--gray-200); border-radius:14px; background:#fff;
  padding:22px; text-align:center; margin-bottom:18px; transition:.15s;
}
.dropzone.drop-hot { border-color:var(--blue); background:var(--blue-soft); }
.dz-inner { display:flex; flex-direction:column; gap:6px; align-items:center; }
.linklike { background:none; border:0; color:var(--blue); cursor:pointer; font:inherit; padding:0; text-decoration:underline; }

.cat-card {
  position:relative; background:var(--card); border:1px solid var(--gray-200);
  border-radius:var(--radius); padding:16px 14px; box-shadow:var(--shadow-1);
  display:flex; flex-direction:column; gap:4px; align-items:flex-start; transition:.12s;
}
.cat-card:hover { box-shadow:var(--shadow-2); transform:translateY(-1px); }
.cat-card.active { border-color:var(--blue); background:var(--blue-soft); }
.cat-card.drop-hot { border-color:var(--blue); background:var(--blue-soft); border-style:dashed; }
.cat-ico { font-size:26px; }
.cat-nome { font-weight:600; font-size:14px; }
.cat-num { font-size:12px; color:var(--gray-600); }
.cat-edit {
  position:absolute; top:8px; right:8px; border:0; background:transparent; cursor:pointer;
  color:var(--gray-400); font-size:13px; opacity:0; transition:.12s;
}
.cat-card:hover .cat-edit { opacity:1; }
.cat-edit:hover { color:var(--blue); }

table.kv { width:100%; border-collapse:collapse; }
table.kv td { padding:7px 4px; border-bottom:1px solid var(--gray-100); font-size:13.5px; vertical-align:top; }
table.kv td:first-child { color:var(--gray-600); width:40%; }
table.kv tr:last-child td { border-bottom:0; }

@media (max-width: 820px) {
  main .content [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns:1fr !important; }
}

/* =====================================================================
   Celular / experiência de app
   =====================================================================
   Objetivo: instalado na tela de início, o meuAgente tem que parecer um
   aplicativo — sem barra do navegador, com abas no rodapé ao alcance do
   polegar, gaveta lateral para o resto e nada escondido sob o notch.

   Duas medidas mandam em tudo aqui:
     --topbar-h   altura real da topbar (56px), + a faixa do sistema no iPhone
     --tabbar-h   altura da barra de abas, + a faixa do gesto de home
   ------------------------------------------------------------------- */
:root {
  --topbar-h: 56px;
  --tabbar-h: 58px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* Barra de abas e gaveta são exclusivas do celular. */
.tabbar { display: none; }
.drawer-backdrop { display: none; }

@media (max-width: 900px) {

  /* ---- Toque ----
     O flash cinza do toque no Android/iOS entrega que é página web; o
     :active abaixo devolve um retorno visual próprio, mais discreto. */
  a, button, .stat, .card, .tab, .side-link, .feed-card {
    -webkit-tap-highlight-color: transparent;
  }
  .btn:active, .tab:active, .side-link:active, .stat:active, .card:active,
  .feed-card:active, .cat-card:active { transform: scale(.975); }
  .btn, .tab, .side-link, .stat, .card, .feed-card, .cat-card { transition: transform .1s ease; }

  /* Alvos de toque: o mínimo confortável é 44px. */
  .btn { padding: 10px 18px; font-size: 13.5px; }
  .btn-sm { padding: 8px 15px; }
  .icon-btn { width: 46px; height: 46px; }
  .step input[type=checkbox], .trow.tarefa .tarefa-check { width: 22px; height: 22px; }
  /* Ações que só apareciam no hover — no celular não existe hover. */
  .step .del, .cat-edit, .speak-btn { opacity: 1; }

  /* ---- Topbar ----
     Em standalone o app pinta sob a barra de status; o padding devolve o
     espaço dela. A busca sai (vira lupa) para o seletor de ambiente caber. */
  .topbar {
    height: calc(var(--topbar-h) + var(--safe-top));
    padding: var(--safe-top) calc(10px + var(--safe-right)) 0 calc(10px + var(--safe-left));
    gap: 4px;
  }
  .search { display: none; }
  .topbar-doc { display: none; }
  .brand-name { display: none; }         /* a marca fica só no quadradinho */
  .env-switcher { margin-left: 6px; min-width: 0; }
  .env-pill { padding: 5px 10px 5px 6px; gap: 7px; max-width: 46vw; }
  .env-label { display: none; }          /* "Ambiente" é redundante no celular */
  .env-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .env-badge { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
  .env-menu { width: min(300px, calc(100vw - 24px)); }
  .avatar { width: 32px; height: 32px; font-size: 13px; }

  /* ---- Gaveta lateral ---- */
  .sidebar {
    position: fixed; z-index: 30;
    left: 0; top: calc(var(--topbar-h) + var(--safe-top));
    width: min(280px, 84vw);
    height: calc(100dvh - var(--topbar-h) - var(--safe-top));
    padding: 12px 8px calc(24px + var(--tabbar-h) + var(--safe-bottom));
    background: var(--bg);
    box-shadow: var(--shadow-2);
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.2, .8, .2, 1);
    overscroll-behavior: contain;   /* rolar a gaveta não arrasta a página */
  }
  .sidebar.open { transform: translateX(0); }
  .side-link { padding: 12px 16px; font-size: 15px; }   /* mais dedo, menos mouse */
  .side-cta { padding: 13px 22px 13px 16px; font-size: 14.5px; }

  .drawer-backdrop {
    display: block; position: fixed; inset: 0; z-index: 25;
    background: rgba(12, 17, 22, .42);
    opacity: 0; transition: opacity .22s;
  }
  .drawer-backdrop.show { opacity: 1; }
  .drawer-backdrop[hidden] { display: none; }
  /* Com a gaveta aberta o fundo não rola. */
  body.drawer-open { overflow: hidden; }

  /* ---- Conteúdo ---- */
  .content {
    border-radius: 0; border-left: 0;
    padding: 16px calc(16px + var(--safe-right)) 
             calc(24px + var(--tabbar-h) + var(--safe-bottom)) calc(16px + var(--safe-left));
    min-height: calc(100dvh - var(--topbar-h) - var(--safe-top));
  }
  .page-head { flex-wrap: wrap; }
  .page-head h1 { font-size: 19px; }

  /* ---- Barra de abas ---- */
  .tabbar {
    display: flex; position: fixed; z-index: 24;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--gray-200);
  }
  .tab {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    border: 0; background: transparent; cursor: pointer;
    font-family: var(--font); font-size: 10.5px; font-weight: 600;
    color: var(--gray-600); padding: 6px 2px 4px;
    position: relative;
  }
  .tab-ico { font-size: 19px; line-height: 1; filter: grayscale(1); opacity: .62; }
  .tab-txt { letter-spacing: .1px; }
  .tab.active { color: var(--blue-dark); }
  .tab.active .tab-ico { filter: none; opacity: 1; }
  /* Traço curto no topo marca a aba atual — cor sozinha não bastaria. */
  .tab.active::before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--grad);
  }

  /* ---- Kanban: rolagem horizontal com encaixe ----
     Empilhar as 4 colunas viraria uma página quilométrica. Deslizar de lado,
     uma coluna por vez, é o gesto que se espera de um quadro. */
  .board {
    grid-template-columns: none;
    grid-auto-flow: column; grid-auto-columns: 84%;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-inline: -16px; padding-inline: 16px;   /* sangra até a borda da tela */
    scrollbar-width: none;
  }
  .board::-webkit-scrollbar { display: none; }
  .col { scroll-snap-align: center; }
  .tcard { cursor: default; }   /* não há arrastar-e-soltar com o dedo */

  /* ---- Formulários ----
     Fonte < 16px faz o Safari do iPhone dar zoom ao focar o campo e a página
     nunca mais volta ao lugar. 16px em tudo que recebe digitação. */
  .field input, .field textarea, .field select,
  .chat-input input, .doc-search, .search input, input[type=text],
  input[type=search], input[type=email], input[type=number],
  input[type=date], input[type=password], textarea, select {
    font-size: 16px;
  }
  .field input, .field textarea, .field select { padding: 12px 14px; }
  .inline-form { flex-wrap: wrap; }

  /* ---- Diálogos como folha de baixo ----
     Caixa flutuante no meio da tela é gesto de desktop; app abre de baixo. */
  dialog {
    width: 100%; max-width: none;
    margin: auto auto 0; padding: 22px 18px calc(22px + var(--safe-bottom));
    border-radius: 22px 22px 0 0;
    animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1);
  }
  dialog h2 { font-size: 18px; margin-bottom: 14px; }
  .dialog-actions { gap: 8px; }
  .dialog-actions .btn { flex: 1; justify-content: center; }
  @keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

  /* ---- Ajustes finos por tela ---- */
  .stat .num, .feed-count { font-size: 23px; }
  .cal-toolbar { flex-wrap: wrap; }
  .cal-title { font-size: 17px; min-width: 0; }
  .chat-input { padding-bottom: 8px; }
  .bubble { max-width: 88%; }
  .assignee-chip { max-width: none; }
  .anexo-view.pdf { height: 70dvh; }
  .adesao-grid { max-width: none; }
  table.kv td:first-child { width: 44%; }

  /* ---- Calendário: o mês vira agenda ----
     Sete colunas em 390px dá ~50px por dia — não cabe nem a hora. Em vez de
     encolher até virar ilegível, os dias viram uma lista vertical e só
     aparecem os que têm alguma coisa. Os itens continuam sendo os mesmos
     links, agora com área de toque de gente. */
  .cal-grid {
    display: block; gap: 0;
    background: transparent; border: 0; border-radius: 0; overflow: visible;
  }
  .cal-wd { display: none; }                       /* cabeçalho Dom..Sáb não serve numa lista */
  .cal-cell { display: none; }                     /* dia vazio não ocupa espaço */
  .cal-cell:has(.cal-item) {
    display: block; min-height: 0;
    background: transparent; padding: 0; margin-bottom: 14px;
  }
  .cal-cell.today:has(.cal-item) { background: transparent; }

  .cal-daynum {
    align-self: stretch; width: auto; height: auto;
    display: flex; align-items: baseline; gap: 7px;
    font-size: 12px; font-weight: 700; color: var(--gray-600);
    text-transform: uppercase; letter-spacing: .5px;
    padding: 0 2px 6px; margin-bottom: 2px;
    border-bottom: 1px solid var(--gray-200);
  }
  .cal-daynum::before { content: attr(data-wd); color: var(--gray-400); }
  .cal-cell.today .cal-daynum {
    width: auto; height: auto; border-radius: 0; display: flex;
    background: transparent; color: var(--blue-dark); border-bottom-color: var(--blue);
  }
  .cal-cell.today .cal-daynum::before { color: var(--blue); }
  .cal-cell.today .cal-daynum::after { content: "· hoje"; color: var(--blue); }

  .cal-item {
    display: block; font-size: 13.5px; line-height: 1.35;
    padding: 10px 12px; margin-top: 5px; border-radius: 8px;
    white-space: normal;                           /* deixa quebrar; não há mais coluna estreita */
  }
  .cal-cell.other:has(.cal-item) { opacity: .75; } /* dias do mês vizinho, discretos */
}

/* Telas bem estreitas: os rótulos das abas competem por espaço. */
@media (max-width: 360px) {
  .tab-txt { font-size: 9.5px; }
  .env-pill { max-width: 40vw; }
}

/* ---- Já instalado na tela de início ----
   Aqui não existe barra de endereço para "puxar e recarregar", e o arrasto
   elástico nas pontas só denuncia que por baixo é uma página. */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}

/* Quem prefere menos animação não leva nenhuma. */
@media (prefers-reduced-motion: reduce) {
  .sidebar, .drawer-backdrop, .btn, .tab, .side-link, .stat, .card, .feed-card { transition: none; }
  dialog { animation: none; }
}
