/* Agendado: sistema visual.
   Poucos padrões repetidos: raio 8/12/16, espaçamento 4/8/12/16/24, texto 12/13/14/15/22. */

:root {
  --accent: #2563EB;
  --accent-ink: #FFFFFF;
  --accent-strong: #1D4ED8;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-softer: color-mix(in srgb, var(--accent) 6%, transparent);

  --bg: #EEF2F8;
  --rail: #E7ECF5;
  --surface: #FFFFFF;
  --surface-2: #F5F7FB;
  --hover: #F1F4F9;
  --selected: #EAF0FD;
  --line: #E9EDF4;
  --line-strong: #D9E0EB;
  --text: #121A2C;
  --text-2: #4A5568;
  --text-3: #8792A6;
  --shadow: 0 1px 2px rgba(16, 32, 72, .05), 0 10px 30px rgba(16, 32, 72, .07);
  --shadow-pop: 0 2px 6px rgba(16, 32, 72, .08), 0 18px 50px rgba(16, 32, 72, .18);

  --high: #EF233C;
  --medium: #F59E0B;
  --low: #2563EB;
  --none: #A0AABB;
  --overdue: #EF233C;
  --future: var(--accent);
  --ok: #12B76A;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --rail-w: 60px;
  --side-w: 252px;
  --detail-w: clamp(360px, 34vw, 480px);
  --row-h: 40px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  color-scheme: light;
}

/* O tema "automático" é resolvido no JS (segue o sistema) e grava data-theme. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090E1A;
  --rail: #070B15;
  --surface: #111829;
  --surface-2: #161E31;
  --hover: #19223A;
  --selected: #17284D;
  --line: #1F2840;
  --line-strong: #2A3552;
  --text: #E8EDF7;
  --text-2: #A3AEC4;
  --text-3: #6B7791;
  --none: #5D6985;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .3);
  --shadow-pop: 0 2px 8px rgba(0, 0, 0, .45), 0 20px 56px rgba(0, 0, 0, .55);
  --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
  --accent-softer: color-mix(in srgb, var(--accent) 12%, transparent);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 13px/1.4 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  font-feature-settings: "tnum" 0;
}
input, textarea, [contenteditable] { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }
input, textarea { font: inherit; color: inherit; background: none; border: 0; outline: none; padding: 0; }
.ic { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--accent-soft); }

/* ---------- estrutura ---------- */
#app { display: grid; grid-template-columns: var(--rail-w) var(--side-w) 1fr; height: 100vh; }
#app.side-collapsed { grid-template-columns: var(--rail-w) 0 1fr; }
#app.side-collapsed .sidebar { visibility: hidden; }

.rail {
  background: var(--rail);
  display: flex; flex-direction: column; align-items: center;
  padding: 44px 0 12px; gap: 4px;
}
.rail .logo { width: 34px; height: 34px; border-radius: 10px; margin-bottom: 12px; display: grid; place-items: center; }
.rail-btn {
  width: 40px; height: 40px; border-radius: var(--r-m);
  display: grid; place-items: center; color: var(--text-3);
  transition: background .15s, color .15s;
}
.rail-btn:hover { background: var(--hover); color: var(--text-2); }
.rail-btn.on { color: var(--accent); background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.rail .spacer { flex: 1; }
.sync-dot { position: relative; }
.sync-dot::after { content: ""; position: absolute; right: 9px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--state, transparent); box-shadow: 0 0 0 2px var(--rail); }

.sidebar {
  background: var(--rail);
  display: flex; flex-direction: column; min-width: 0;
  padding: 40px 10px 10px 4px;
  overflow: hidden;
}
.side-scroll { overflow-y: auto; flex: 1; padding-right: 2px; scrollbar-width: none; }
.side-scroll::-webkit-scrollbar { display: none; }
.side-sep { height: 1px; background: var(--line-strong); margin: 10px 8px; opacity: .6; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 10px 6px; color: var(--text-3); font-size: 12px; font-weight: 600;
}
.side-head .add { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.sidebar:hover .side-head .add { opacity: 1; }
.side-head .add:hover { background: var(--hover); color: var(--text); }
.nav {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 10px; border-radius: var(--r-s);
  color: var(--text); font-size: 13.5px;
  position: relative;
}
.nav .ic { color: var(--text-2); }
.nav:hover { background: var(--hover); }
.nav.on { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.05); font-weight: 500; }
.nav.on .ic { color: var(--accent); }
.nav .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .count { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.nav .swatch { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.nav .twisty { width: 16px; height: 16px; margin-left: -6px; margin-right: -6px; display: grid; place-items: center; color: var(--text-3); transition: transform .15s; }
.nav .twisty.open { transform: rotate(90deg); }
.nav.indent { padding-left: 28px; }
.nav.drop { background: var(--accent-soft); }
.nav .emoji { width: 18px; text-align: center; font-size: 15px; line-height: 1; }
.side-empty { margin: 2px 6px 4px; padding: 10px 12px; border-radius: var(--r-s); background: var(--hover); color: var(--text-3); font-size: 12px; }

/* ---------- área principal ---------- */
.main {
  margin: 8px 8px 8px 0;
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
  display: flex; min-width: 0; overflow: hidden;
}
#app.side-collapsed .main { margin-left: 8px; }
.listpane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.detailpane { width: var(--detail-w); flex: none; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.detailpane.empty { display: grid; place-items: center; color: var(--text-3); }

.head {
  display: flex; align-items: center; gap: 8px;
  height: 64px; padding: 0 16px 0 20px; flex: none;
}
.head h1 { font: 600 22px/1.2 var(--font-display); margin: 0; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head .sub { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 3px; }
.head .grow { flex: 1; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-s);
  display: grid; place-items: center; color: var(--text-2); flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--accent); background: var(--accent-softer); }

.addbar {
  margin: 0 16px 8px 20px;
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 12px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  transition: background .15s, box-shadow .15s;
}
.addbar .ic { color: var(--text-3); }
.addbar:focus-within { background: var(--surface); box-shadow: 0 0 0 1.5px var(--accent), 0 4px 16px var(--accent-softer); }
.addbar input { flex: 1; font-size: 14px; height: 100%; }
.addbar input::placeholder { color: var(--text-3); }
.parse-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -2px 16px 8px 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 500;
}
.chip.muted { background: var(--hover); color: var(--text-2); }
.chip .ic { width: 13px; height: 13px; }

.scroller { flex: 1; overflow-y: auto; padding: 0 8px 80px 12px; }
.group-head {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 8px; margin-top: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.group-head .count { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.group-head .twisty { color: var(--text-3); transition: transform .15s; }
.group-head.closed .twisty { transform: rotate(-90deg); }
.group-head.overdue { color: var(--overdue); }
.group-head .grow { flex: 1; }
.group-head .act { opacity: 0; }
.group-head:hover .act { opacity: 1; }

/* ---------- linha da tarefa ---------- */
.row {
  display: flex; align-items: flex-start; gap: 10px;
  min-height: var(--row-h); padding: 9px 10px 9px calc(10px + var(--depth, 0) * 24px);
  border-radius: var(--r-s);
  position: relative;
  transition: background .12s, opacity .35s, transform .35s;
}
.row:hover { background: var(--hover); }
.row.sel { background: var(--selected); }
.row.multi { background: var(--accent-soft); }
.row.drag-over-top::before, .row.drag-over-bottom::after {
  content: ""; position: absolute; left: 8px; right: 8px; height: 2px; background: var(--accent); border-radius: 2px;
}
.row.drag-over-top::before { top: -1px; }
.row.drag-over-bottom::after { bottom: -1px; }
.row.drag-into { background: var(--accent-soft); }
.row.leaving { opacity: 0; transform: translateX(8px); }
.row .kid-toggle { position: absolute; left: calc(var(--depth, 0) * 24px - 8px); top: 11px; width: 16px; height: 16px; color: var(--text-3); display: grid; place-items: center; opacity: 0; transition: transform .15s, opacity .15s; }
.row:hover .kid-toggle, .row .kid-toggle.closed { opacity: 1; }
.row .kid-toggle.closed { transform: rotate(-90deg); }

.check {
  --c: var(--none);
  width: 18px; height: 18px; border-radius: 50%; flex: none; margin-top: 2px;
  border: 1.6px solid var(--c);
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 0%, transparent);
  transition: background .2s, border-color .2s, transform .12s;
  position: relative;
}
.check:hover { background: color-mix(in srgb, var(--c) 12%, transparent); }
.check:active { transform: scale(.9); }
.check.p-high { --c: var(--high); }
.check.p-medium { --c: var(--medium); }
.check.p-low { --c: var(--low); }
.check .ic { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .2s; stroke-width: 3; }
.check.done { background: var(--c); border-color: var(--c); }
.check.done.p-none { --c: var(--text-3); }
.check.done .ic { opacity: 1; transform: scale(1); }
.check.wont { border-color: var(--text-3); }
.check.wont .ic { opacity: 1; transform: none; color: var(--text-3); }
.check.note { border: 0; color: var(--text-3); }
.check .ring { position: absolute; inset: -1.6px; border-radius: 50%; }

.row .body { flex: 1; min-width: 0; }
.row .title { font-size: 14px; line-height: 20px; word-break: break-word; }
.row .title.empty { color: var(--text-3); }
.row.is-done .title { color: var(--text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-3) 60%, transparent); }
.row .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; color: var(--text-3); font-size: 12px; }
.row .meta .ic { width: 13px; height: 13px; }
.row .meta span { display: inline-flex; align-items: center; gap: 4px; }
.row .snippet { color: var(--text-3); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-chip { height: 20px; padding: 0 7px; border-radius: 6px; background: var(--hover); color: var(--text-2); font-size: 11.5px; display: inline-flex; align-items: center; }
.row:hover .tag-chip { background: var(--surface); }
.row .right { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12px; margin-top: 1px; flex: none; height: 20px; }
.row .right .ic { width: 14px; height: 14px; }
.date { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--future); font-size: 12px; }
.date.overdue { color: var(--overdue); }
.date.past { color: var(--text-3); }
.list-badge { display: inline-flex; align-items: center; gap: 5px; max-width: 140px; }
.list-badge i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.list-badge b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { display: grid; place-items: center; text-align: center; padding: 80px 24px; color: var(--text-3); }
.empty-state .art { width: 120px; height: 120px; margin-bottom: 16px; }
.empty-state h3 { margin: 0 0 6px; color: var(--text-2); font: 600 15px var(--font-display); }
.empty-state p { margin: 0; max-width: 300px; }

/* ---------- detalhe ---------- */
.d-top { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.d-top .sep { width: 1px; height: 18px; background: var(--line-strong); }
.date-btn { height: 30px; padding: 0 10px; border-radius: var(--r-s); display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13px; }
.date-btn:hover { background: var(--hover); }
.date-btn.set { color: var(--future); }
.date-btn.overdue { color: var(--overdue); }
.d-body { flex: 1; overflow-y: auto; padding: 18px 22px 24px; }
.d-title { width: 100%; resize: none; font: 600 19px/1.35 var(--font-display); letter-spacing: -.005em; overflow: hidden; }
.d-title::placeholder, .d-notes::placeholder { color: var(--text-3); }
.d-notes { width: 100%; resize: none; font-size: 14px; line-height: 1.6; margin-top: 10px; min-height: 80px; overflow: hidden; color: var(--text); }
.d-parent { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; margin-bottom: 8px; border-radius: 6px; padding: 2px 6px 2px 2px; }
.d-parent:hover { color: var(--text-2); background: var(--hover); }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.d-tags .tag-chip { height: 24px; padding: 0 9px; font-size: 12px; gap: 6px; }
.d-tags .tag-chip button { width: 14px; height: 14px; display: grid; place-items: center; color: var(--text-3); }
.d-tags .add-tag { height: 24px; padding: 0 9px; border-radius: 6px; color: var(--text-3); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.d-tags .add-tag:hover { background: var(--hover); color: var(--text-2); }
.d-section { margin-top: 22px; }
.d-section h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.d-section h4 .grow { flex: 1; }
.citem { display: flex; align-items: flex-start; gap: 10px; padding: 5px 6px; border-radius: var(--r-s); }
.citem:hover { background: var(--hover); }
.citem .check { width: 16px; height: 16px; margin-top: 2px; }
.citem input { flex: 1; font-size: 14px; line-height: 20px; }
.citem.done input { color: var(--text-3); text-decoration: line-through; }
.citem .x { opacity: 0; color: var(--text-3); }
.citem:hover .x { opacity: 1; }
.add-line { display: flex; align-items: center; gap: 10px; padding: 5px 6px; color: var(--text-3); border-radius: var(--r-s); }
.add-line input { flex: 1; font-size: 14px; }
.add-line input::placeholder { color: var(--text-3); }
.progress { height: 4px; border-radius: 4px; background: var(--hover); overflow: hidden; margin: 2px 6px 8px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.d-foot { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 12px 0 14px; border-top: 1px solid var(--line); flex: none; color: var(--text-2); }
.d-foot .grow { flex: 1; }
.pill-btn { height: 30px; padding: 0 10px; border-radius: var(--r-s); display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); max-width: 220px; }
.pill-btn:hover { background: var(--hover); color: var(--text); }
.pill-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio-flag.p-high { color: var(--high); } .prio-flag.p-medium { color: var(--medium); } .prio-flag.p-low { color: var(--low); }
.d-meta { margin-top: 28px; color: var(--text-3); font-size: 11.5px; }

/* ---------- popovers, menus, modais ---------- */
.layer { position: fixed; inset: 0; z-index: 50; }
.pop {
  position: fixed; z-index: 51;
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-pop), 0 0 0 1px var(--line);
  padding: 6px;
  min-width: 200px; max-height: calc(100vh - 24px); overflow-y: auto;
  animation: pop-in .14s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 34px; padding: 0 10px; border-radius: var(--r-s);
  font-size: 13.5px; text-align: left; color: var(--text);
}
.menu-item .ic { color: var(--text-2); }
.menu-item:hover, .menu-item.hl { background: var(--hover); }
.menu-item.danger, .menu-item.danger .ic { color: var(--high); }
.menu-item .kbd { margin-left: auto; color: var(--text-3); font-size: 12px; }
.menu-item .check-mark { margin-left: auto; color: var(--accent); }
.menu-item .sw { width: 10px; height: 10px; border-radius: 50%; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-label { padding: 8px 10px 4px; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.menu-row { display: flex; gap: 4px; padding: 2px 4px 6px; }
.seg { display: flex; background: var(--hover); border-radius: var(--r-s); padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 30px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--text-2); padding: 0 10px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500; }
.menu-search { width: 100%; height: 34px; padding: 0 10px; margin-bottom: 4px; border-radius: var(--r-s); background: var(--surface-2); font-size: 13.5px; }

/* seletor de data */
.dp { width: 300px; padding: 12px; }
.dp .quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 8px; }
.dp .quick button { height: 50px; border-radius: var(--r-s); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; color: var(--text-2); }
.dp .quick button:hover { background: var(--hover); color: var(--text); }
.dp .quick .ic { color: var(--text-2); }
.dp .mhead { display: flex; align-items: center; height: 32px; padding: 0 2px 0 6px; }
.dp .mhead b { flex: 1; font-size: 13.5px; font-weight: 600; }
.dp .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp .grid .wd { height: 24px; display: grid; place-items: center; font-size: 11px; color: var(--text-3); }
.dp .grid button { height: 34px; border-radius: 50%; font-size: 13px; font-variant-numeric: tabular-nums; display: grid; place-items: center; position: relative; }
.dp .grid button:hover { background: var(--hover); }
.dp .grid button.out { color: var(--text-3); opacity: .55; }
.dp .grid button.today { color: var(--accent); font-weight: 600; }
.dp .grid button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.dp .rows { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.dp .opt { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px; border-radius: var(--r-s); font-size: 13.5px; color: var(--text-2); width: 100%; }
.dp .opt:hover { background: var(--hover); }
.dp .opt.set { color: var(--accent); }
.dp .opt .val { margin-left: auto; color: var(--text-3); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; max-width: 160px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dp .opt.set .val { color: var(--accent); }
.dp .opt input[type="time"] { margin-left: auto; color: var(--accent); font-variant-numeric: tabular-nums; }
.dp .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.btn { height: 36px; border-radius: var(--r-s); padding: 0 14px; font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--hover); color: var(--text); }
.btn:hover { background: var(--line-strong); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.danger { background: color-mix(in srgb, var(--high) 12%, transparent); color: var(--high); }

.modal-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(15, 15, 25, .28); display: grid; place-items: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-pop); padding: 22px; animation: pop-in .16s ease-out; }
.modal.wide { width: min(720px, calc(100vw - 32px)); padding: 0; display: flex; min-height: 480px; }
.modal h2 { margin: 0 0 16px; font: 600 17px var(--font-display); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 6px; }
.input { width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-s); background: var(--surface-2); font-size: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--surface); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.swatches button.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.swatches button.none { background: var(--hover); color: var(--text-3); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal .actions .left { margin-right: auto; }
.error-text { color: var(--high); font-size: 12.5px; margin-top: 8px; }
.hint { color: var(--text-3); font-size: 12.5px; line-height: 1.5; }

.set-nav { width: 200px; background: var(--surface-2); padding: 18px 8px; border-radius: var(--r-l) 0 0 var(--r-l); flex: none; }
.set-nav h2 { padding: 0 10px; margin-bottom: 12px; }
.set-body { flex: 1; padding: 24px 28px; overflow-y: auto; }
.set-body h3 { margin: 0 0 14px; font: 600 16px var(--font-display); }
.set-card { background: var(--surface-2); border-radius: var(--r-m); padding: 4px 14px; margin-bottom: 16px; }
.set-line { display: flex; align-items: center; gap: 12px; min-height: 46px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.set-line:last-child { border-bottom: 0; }
.set-line .grow { flex: 1; }
.set-line .v { color: var(--text-3); }
.switch { width: 36px; height: 22px; border-radius: 11px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(14px); }
.select { height: 30px; border-radius: var(--r-s); background: var(--surface); padding: 0 8px; font-size: 13px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.accents { display: flex; gap: 10px; padding: 12px 0; flex-wrap: wrap; }
.accents button { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); }
.accents button.on { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--sw); }
.kbd-table { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 13px; }
.kbd-table kbd { font: 500 12px var(--font); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); border-radius: 6px; padding: 2px 7px; color: var(--text-2); }

/* busca e comandos */
.palette { position: fixed; z-index: 70; left: 50%; top: 14vh; transform: translateX(-50%); width: min(600px, calc(100vw - 32px)); background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-pop), 0 0 0 1px var(--line); overflow: hidden; animation: pop-in .14s ease-out; }
.palette .q { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.palette .q input { flex: 1; font-size: 16px; }
.palette .res { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette .res .menu-item { height: 40px; }
.palette .res .menu-item .sub { color: var(--text-3); font-size: 12px; margin-left: auto; }
.palette .empty { padding: 28px; text-align: center; color: var(--text-3); }

/* toast */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { display: flex; align-items: center; gap: 14px; height: 42px; padding: 0 8px 0 16px; border-radius: var(--r-m); background: #1F1F25; color: #F1F1F4; box-shadow: var(--shadow-pop); font-size: 13.5px; animation: pop-in .18s ease-out; }
.toast button { height: 30px; padding: 0 10px; border-radius: 6px; color: color-mix(in srgb, var(--accent) 55%, #fff); font-weight: 600; }
.toast button:hover { background: rgba(255,255,255,.08); }

/* ---------- celular ---------- */
.mtop { display: none; }
.mobile-only { display: none; }
@media (max-width: 760px) {
  body { font-size: 13px; }
  .mobile-only { display: block; }
  #app, #app.side-collapsed { grid-template-columns: 1fr; }
  .rail { display: none; }
  .sidebar { position: fixed; inset: 0; z-index: 40; padding: calc(env(safe-area-inset-top) + 56px) 12px 12px; transform: translateY(-100%); transition: transform .25s ease, visibility 0s .25s; visibility: hidden; }
  #app.drawer .sidebar { transform: none; visibility: visible; transition: transform .25s ease; }
  .main { margin: 0; border-radius: 0; box-shadow: none; flex-direction: column; height: 100vh; }
  #app.side-collapsed .main { margin: 0; }
  .mtop { display: flex; align-items: center; gap: 4px; height: calc(env(safe-area-inset-top) + 50px); padding: env(safe-area-inset-top) 8px 0; position: relative; z-index: 45; background: var(--surface); flex: none; }
  .mtop h1 { flex: 1; font: 600 17px var(--font-display); margin: 0 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mtop .icon-btn { width: 38px; height: 38px; }
  #app.drawer .mtop { background: var(--rail); }
  .head { display: none; }
  .addbar { margin: 4px 12px 8px; height: 40px; }
  .parse-chips { margin: -2px 12px 8px; }
  .scroller { padding: 0 6px 120px; }
  .row { min-height: 44px; padding-top: 11px; padding-bottom: 11px; }
  .row .title { font-size: 14px; }
  .detailpane { position: fixed; inset: 0; z-index: 46; width: auto; border: 0; background: var(--surface); padding-top: env(safe-area-inset-top); transform: translateY(100%); transition: transform .25s ease; }
  .detailpane.open { transform: none; }
  .detailpane.empty { display: none; }
  .d-body { padding: 16px 16px 40px; }
  .d-foot { padding-bottom: env(safe-area-inset-bottom); height: calc(48px + env(safe-area-inset-bottom)); }
  .pop { max-width: calc(100vw - 16px); }
  .modal.wide { flex-direction: column; min-height: 0; }
  .set-nav { width: auto; border-radius: var(--r-l) var(--r-l) 0 0; display: flex; overflow-x: auto; gap: 4px; padding: 10px; }
  .set-nav h2 { display: none; }
  .set-nav .nav { flex: none; }
}

/* ---------- detalhe organizado (propriedades) ---------- */
.d-top .crumb { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; color: var(--text-3); }
.d-top .crumb button { height: 28px; padding: 0 8px; border-radius: var(--r-s); display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); min-width: 0; }
.d-top .crumb button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-top .crumb button:hover { background: var(--hover); color: var(--text); }
.d-top .crumb i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.d-title.is-done { color: var(--text-3); text-decoration: line-through; }
.props { margin: 14px 0 6px; padding: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prop { display: grid; grid-template-columns: 120px 1fr; align-items: center; min-height: 38px; }
.prop .k { display: inline-flex; align-items: center; gap: 9px; color: var(--text-3); font-size: 13px; }
.prop .v { justify-self: start; min-height: 30px; padding: 0 9px; margin-left: -9px; border-radius: var(--r-s); display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text); }
.prop button.v:hover { background: var(--hover); }
.prop .v.empty { color: var(--text-3); }
.prop .v.set { color: var(--accent); font-weight: 500; }
.prop .v.overdue { color: var(--overdue); }
.prop .v.tags { flex-wrap: wrap; gap: 6px; padding-top: 4px; padding-bottom: 4px; }
.prio-badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 600; background: var(--none); }
.prio-badge.p-high { background: var(--high); } .prio-badge.p-medium { background: var(--medium); } .prio-badge.p-low { background: var(--low); }
.tag-chip.solid { background: var(--tc) !important; color: #fff !important; }
.tag-chip button { width: 14px; height: 14px; display: grid; place-items: center; color: inherit; opacity: .7; margin-left: 4px; }
.add-tag { height: 24px; padding: 0 8px; border-radius: 6px; color: var(--text-3); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.add-tag:hover { background: var(--hover); color: var(--text-2); }
.d-section h4 { font-size: 12.5px; color: var(--text-2); }
.pill { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; background: var(--line); color: var(--text-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.d-foot .meta { color: var(--text-3); font-size: 12px; padding-left: 4px; }

/* formas sólidas (sem cor sobre cor) */
.chip { background: var(--accent); color: #fff; }
.chip.muted { background: var(--text-2); color: #fff; }
.icon-btn.on { background: var(--accent); color: #fff; }
.icon-btn.on .prio-flag { color: #fff !important; }
.btn.danger { background: var(--high); color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--high) 88%, #000); }

/* cabeçalho com subtítulo e lista com divisórias */
.head h1 + .date-sub { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.head .sub { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--line); color: var(--text-2); font-size: 12px; font-weight: 600; margin-top: 0; }
.head .sub:empty { display: none; }
.group-head .count { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; background: var(--line); color: var(--text-2); font-size: 11px; font-weight: 600; }
.group-head.overdue .count { background: var(--overdue); color: #fff; }
.row + .row::after { content: none; }
.row:not(:last-child) { box-shadow: inset 0 -1px 0 var(--line); border-radius: 0; }
.row:hover, .row.sel, .row.multi { box-shadow: none; border-radius: var(--r-s); }
.side-head { text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.nav .count { min-width: 20px; text-align: right; }

/* ---------- agenda ---------- */
#app.mod-agenda .listpane { display: none; }
#app:not(.mod-agenda) .agendapane { display: none; }
#app.mod-agenda .detailpane.empty { display: none; }
.agendapane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-head { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 16px 0 14px; flex: none; }
.cal-head h1 { font: 600 22px/1.2 var(--font-display); margin: 0 4px 0 2px; letter-spacing: -.01em; white-space: nowrap; }
.cal-head .grow { flex: 1; }
.nav-arrows { display: flex; align-items: center; gap: 2px; }
.nav-arrows .btn { height: 32px; padding: 0 12px; }
.cal-views button { padding: 0 12px; }
.cal-mobile-views { display: none; }
.cal-body-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.cal-grid { display: flex; flex-direction: column; height: 100%; min-height: 0; --gut: 56px; }
.cal-days, .cal-allday { display: grid; grid-template-columns: var(--gut) repeat(var(--cols), 1fr); flex: none; }
.cal-days { border-bottom: 1px solid var(--line); padding-right: 8px; }
.cal-day-h { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: var(--r-s); margin: 2px; }
.cal-day-h:hover { background: var(--hover); }
.cal-day-h .dw { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.cal-day-h .dn { font: 600 18px/1 var(--font-display); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-day-h.today .dn { background: var(--accent); color: #fff; }
.cal-day-h.today .dw { color: var(--accent); font-weight: 600; }
.cal-allday { border-bottom: 1px solid var(--line); min-height: 30px; padding: 3px 8px 3px 0; }
.cal-allday .gutter { font-size: 10.5px; color: var(--text-3); text-align: right; padding: 7px 8px 0 0; }
.cal-allday.empty .gutter { visibility: hidden; }
.ad-col { display: flex; flex-direction: column; gap: 2px; padding: 0 3px; min-width: 0; }
.cal-scroll { flex: 1; overflow-y: auto; position: relative; }
.cal-body { display: grid; grid-template-columns: var(--gut) repeat(var(--cols), 1fr); position: relative; padding-right: 8px;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 48px; background-position: 0 0; }
.cal-body .gutter { position: relative; background: var(--surface); }
.cal-body .gutter span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.col { position: relative; border-left: 1px solid var(--line); }
.col.weekend { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.col.today { background: color-mix(in srgb, var(--accent) 3%, transparent); }
.now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--high); z-index: 3; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--high); }

.ev { position: absolute; z-index: 2; border-radius: 8px; background: var(--ec); color: #fff; overflow: hidden; cursor: default; box-shadow: 0 0 0 1px var(--surface); transition: box-shadow .15s; }
.ev:hover { box-shadow: 0 0 0 1px var(--surface), 0 4px 14px rgba(16, 32, 72, .18); z-index: 4; }
.ev.dragging { opacity: .9; box-shadow: 0 8px 24px rgba(16, 32, 72, .28); z-index: 5; }
.ev-in { padding: 4px 7px; display: flex; flex-direction: column; gap: 1px; height: 100%; }
.ev .n { font-size: 12.5px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.ev .t { font-size: 11px; opacity: .9; font-variant-numeric: tabular-nums; }
.ev .meet { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; margin-top: 2px; }
.ev.short .ev-in { flex-direction: row; align-items: center; gap: 6px; padding: 1px 7px; }
.ev.short .n { white-space: nowrap; }
.ev.task .ev-in { flex-direction: row; align-items: flex-start; gap: 6px; }
.ev.task .n { flex: 1; }
.ev.task .t { order: 3; }
.ev .tc, .cal-chip .tc { width: 14px; height: 14px; border-radius: 50%; border: 1.6px solid #fff; display: grid; place-items: center; flex: none; margin-top: 1px; }
.ev.done, .cal-chip.done { opacity: .55; }
.ev.done .n, .cal-chip.done .n { text-decoration: line-through; }
.ev.done .tc, .cal-chip.done .tc { background: #fff; color: var(--ec); }
.ev .tc .ic { width: 9px; height: 9px; stroke-width: 3.5; }
.ev:not(.done) .tc .ic, .cal-chip:not(.done) .tc .ic { opacity: 0; }
.ev.pending { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.14) 0 6px, transparent 6px 12px); }
.ev .rs { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.ev.ghost { background: var(--accent); opacity: .85; left: 2px; width: calc(100% - 4px); pointer-events: none; }

.cal-chip { display: flex; align-items: center; gap: 5px; width: 100%; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--ec); color: #fff; font-size: 12px; min-width: 0; text-align: left; }
.cal-chip .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cal-chip .t { font-variant-numeric: tabular-nums; opacity: .9; flex: none; }
.cal-chip .ic { flex: none; }
.cal-chip:hover { filter: brightness(1.06); }

.cal-month { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: 30px repeat(6, 1fr); border-top: 1px solid var(--line); min-height: 0; }
.cal-month .mh { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.mc { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: hidden; }
.mc:nth-child(7n + 7) { border-right: 0; }
.mc.out { background: var(--surface-2); }
.mc.out .mn { color: var(--text-3); }
.mc .mn { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mc .mn:hover { background: var(--hover); }
.mc.today .mn { background: var(--accent); color: #fff; }
.mc .more { font-size: 11.5px; color: var(--text-3); text-align: left; padding: 0 6px; }

.cal-list { overflow-y: auto; padding: 4px 24px 60px; }
.cl-day { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cl-date { display: flex; align-items: baseline; gap: 8px; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.cl-date .dn { font: 600 22px var(--font-display); color: var(--text); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.cl-date.today .dn { background: var(--accent); color: #fff; }
.cl-items { display: flex; flex-direction: column; gap: 4px; }
.cl-item { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 10px; border-radius: var(--r-s); }
.cl-item:hover { background: var(--hover); }
.cl-item .sq, .ecard .sq { width: 14px; height: 14px; border-radius: 4px; background: var(--ec); flex: none; display: grid; place-items: center; color: #fff; }
.cl-item .tm { width: 112px; color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; flex: none; }
.cl-item .n { flex: 1; font-size: 14px; }
.cl-item.done .n { color: var(--text-3); text-decoration: line-through; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }

/* barra lateral da agenda */
.new-btn-wrap { padding: 2px 6px 12px; }
.new-btn { width: 100%; height: 40px; border-radius: var(--r-m); font-size: 14px; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.mini { padding: 4px 6px 8px; }
.mini-head { display: flex; align-items: center; padding: 0 0 4px 4px; }
.mini-head b { flex: 1; font-size: 13px; }
.mini-head .icon-btn { width: 26px; height: 26px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mini-grid .wd { font-size: 10.5px; color: var(--text-3); text-align: center; height: 22px; line-height: 22px; }
.mini-grid button { height: 30px; border-radius: 50%; font-size: 12px; font-variant-numeric: tabular-nums; position: relative; }
.mini-grid button:hover { background: var(--hover); }
.mini-grid button.out { color: var(--text-3); }
.mini-grid button.inrange { background: var(--surface); }
.mini-grid button.today { background: var(--accent); color: #fff; font-weight: 600; }
.mini-grid button i { position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.mini-grid button.today i { background: #fff; }
.cal-item { height: 34px; }
.cal-check { width: 18px; height: 18px; border-radius: 50%; border: 1.8px solid var(--cc); display: grid; place-items: center; color: #fff; flex: none; }
.cal-check.on { background: var(--cc); }
.nav .cal-check .ic, .cal-check .ic { width: 11px; height: 11px; stroke-width: 3.2; color: #fff; opacity: 0; }
.cal-check.on .ic { opacity: 1; }
.cal-item .src { font-size: 10.5px; color: var(--text-3); }
.g-card { margin: 14px 6px 6px; padding: 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: 0 1px 2px rgba(16,32,72,.05); }
.g-card b { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 4px; }
.g-card p { margin: 0 0 10px; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.g-card .btn { width: 100%; }
.g-status { display: flex; align-items: center; gap: 6px; padding: 8px 10px; color: var(--text-3); font-size: 11.5px; }
.g-status .err { color: var(--high); }

/* criação rápida e cartão do evento */
.qc { display: flex; flex-direction: column; gap: 10px; padding: 6px; }
.qc-title { font: 600 17px var(--font-display); height: 34px; border-bottom: 1.5px solid var(--line); }
.qc-title:focus { border-color: var(--accent); }
.qc-line { display: flex; align-items: center; gap: 10px; min-height: 30px; color: var(--text-2); font-size: 13px; }
.qc-line input { flex: 1; height: 30px; font-size: 13px; border-bottom: 1px solid var(--line); }
.qc-line.toggle { cursor: default; }
.qc-line.toggle span { flex: 1; }
.sw-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.qc-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.ecard { padding: 8px; display: flex; flex-direction: column; gap: 10px; }
.ec-title { display: flex; align-items: flex-start; gap: 10px; }
.ec-title .sq { margin-top: 5px; }
.ec-title h3 { margin: 0; font: 600 17px/1.3 var(--font-display); }
.ec-line { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.ec-line .ic { margin-top: 1px; }
.ec-line.muted { color: var(--text-3); }
.ec-join { width: 100%; height: 38px; }
.ec-desc { color: var(--text-2); font-size: 13px; white-space: pre-wrap; max-height: 120px; overflow: auto; background: var(--surface-2); padding: 10px; border-radius: var(--r-s); }
.ec-actions { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.ec-actions .grow { flex: 1; }

/* janela do evento */
.ee-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ee-head h2 { margin: 0; }
.input.big { height: 46px; font: 600 17px var(--font-display); }
.input.area { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.ee-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
.ee-row.line { display: flex; align-items: center; gap: 10px; min-height: 40px; margin-bottom: 12px; color: var(--text); font-size: 13.5px; }
.ee-row.line .grow { flex: 1; }
.ee-row.line.disabled { color: var(--text-3); }
.ee-row.line a { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guests { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: var(--r-s); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); min-height: 40px; align-items: center; }
.guests input { flex: 1; min-width: 160px; height: 28px; font-size: 13.5px; padding: 0 6px; }
.guest { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--text-2); color: #fff; font-size: 12.5px; }
.guest button { color: #fff; opacity: .8; width: 16px; height: 16px; display: grid; place-items: center; }
.switch:disabled { opacity: .4; }

@media (max-width: 760px) {
  .cal-head { display: none; }
  .cal-mobile-views { display: flex; margin: 4px 12px 8px; }
  .cal-grid { --gut: 40px; }
  .cal-day-h .dn { font-size: 15px; width: 28px; height: 28px; }
  .cal-list { padding: 0 12px 80px; }
  .cl-day { grid-template-columns: 1fr; gap: 6px; }
  .cl-item .tm { width: 92px; }
  .cal-month .mc { padding: 2px; }
  .cal-chip { height: 18px; font-size: 10.5px; padding: 0 4px; }
  .cal-chip .t { display: none; }
}
.ev-in > * { flex: none; }
.ev:not(.short) .n { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.ev.task:not(.short) .n { flex: 1; }
.seg button { white-space: nowrap; }
.agendapane, .listpane { min-height: 0; } .cal-body-wrap, .cal-grid { min-height: 0; overflow: hidden; }
.agendapane { overflow: hidden; }
#app.mod-agenda .detailpane { width: clamp(320px, 28vw, 400px); }
.cal-head { min-width: 0; }
.cal-head h1 { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-views { flex-shrink: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.d-top [data-close-detail] { display: none; }
#app.mod-agenda .d-top [data-close-detail] { display: grid; }

/* ---------- responsividade: janelas médias e pequenas ---------- */
.main { position: relative; }
@media (max-width: 1180px) and (min-width: 761px) {
  /* o detalhe vira um painel flutuante, sem espremer a lista/agenda */
  .detailpane, #app.mod-agenda .detailpane {
    position: absolute; right: 10px; top: 10px; bottom: 10px; width: min(400px, 48vw); z-index: 30;
    background: var(--surface); border: 0; border-radius: var(--r-l); box-shadow: var(--shadow-pop);
  }
  .detailpane.empty { display: none; }
  .d-top [data-close-detail] { display: grid; }
}
@media (max-width: 1040px) and (min-width: 761px) {
  /* barra lateral recolhida por padrão; abre por cima */
  #app, #app.side-collapsed { grid-template-columns: var(--rail-w) 0 1fr; }
  .sidebar { visibility: hidden; }
  .main, #app.side-collapsed .main { margin-left: 8px; }
  #app.side-open .sidebar {
    visibility: visible; position: fixed; left: var(--rail-w); top: 0; bottom: 0; width: var(--side-w); z-index: 35;
    box-shadow: var(--shadow-pop); animation: slide-in .18s ease-out;
  }
  .cal-views button { padding: 0 9px; }
}
@keyframes slide-in { from { transform: translateX(-12px); opacity: 0; } }
.side-scrim { display: none; }
#app.side-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 34; }

/* minimalismo: menos ruído visual na agenda */
.col.weekend { background: transparent; }
.cal-body .gutter span { color: color-mix(in srgb, var(--text-3) 85%, transparent); }
.cal-allday.empty { min-height: 10px; padding: 0; }
.cal-allday.empty .gutter { display: none; }
.head-new { display: none; height: 34px; padding: 0 12px; }
#app.side-collapsed .head-new { display: inline-flex; }
@media (max-width: 1040px) and (min-width: 761px) { .head-new { display: inline-flex; } }
.rail { grid-column: 1; grid-row: 1; }
.sidebar { grid-column: 2; grid-row: 1; }
.main { grid-column: 3; grid-row: 1; }
@media (max-width: 760px) { .main, .sidebar { grid-column: 1; } }
.ev.mid .n { -webkit-line-clamp: 1 !important; }

/* ---------- emojis ---------- */
.em { margin-right: 4px; }
.cal-emoji { margin-right: 6px; }
.emoji-btn { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; font-size: 18px; color: var(--text-3); flex: none; }
.emoji-btn:hover { background: var(--hover); }
.emoji-btn.big { width: 46px; height: 46px; font-size: 22px; border-radius: 12px; }
.emoji-pick .ep-body { max-height: 300px; overflow-y: auto; }
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 2px; }
.ep-grid button { height: 34px; border-radius: 8px; font-size: 20px; display: grid; place-items: center; }
.ep-grid button:hover { background: var(--hover); }
.ep-grid button.on { background: var(--accent); }
.ep-foot:empty { display: none; }
.ep-foot { padding: 6px 2px 0; border-top: 1px solid var(--line); margin-top: 4px; }
.emoji-float .layer { z-index: 55; }
.emoji-float .pop { z-index: 56; }
.qc-top { display: flex; align-items: center; gap: 10px; }
.qc-top .qc-title { flex: 1; min-width: 0; }
.ee-title { display: flex; gap: 10px; align-items: center; }
.ee-title .input { flex: 1; }

/* ---------- calendários personalizáveis ---------- */
.cal-item .cal-more { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--text-3); opacity: 0; margin-left: -2px; }
.cal-item:hover .cal-more { opacity: 1; }
.cal-item:hover .src { display: none; }
.cal-item .cal-more:hover { background: var(--surface); color: var(--text); }
.calmenu .cm-row { display: flex; gap: 8px; align-items: center; padding: 2px 4px 4px; }
.calmenu .cm-row .menu-search { margin: 0; }
.cm-sw { padding: 4px 6px 8px; gap: 7px; }
.cm-sw button { width: 24px; height: 24px; }

/* ---------- cartão da reunião ---------- */
.ec-title .ec-emoji { font-size: 22px; line-height: 1; margin-top: 1px; }
.ec-meet { background: var(--surface-2); border-radius: var(--r-m); padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.ec-meet-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ec-meet-top > div { display: flex; flex-direction: column; min-width: 0; }
.ec-meet-top b { font-size: 13px; }
.ec-url { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meet-badge { width: 34px; height: 34px; border-radius: 10px; background: #0F9D58; color: #fff; display: grid; place-items: center; flex: none; }
.meet-badge.other { background: var(--text-2); }
.ec-meet-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ec-meet-actions .btn { height: 36px; }
.ec-meet.loading { flex-direction: row; align-items: center; color: var(--text-2); font-size: 13px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- mês mais limpo ---------- */
.cal-month { border-top: 0; gap: 0; padding: 0 8px 8px; }
.cal-month .mh { border-bottom: 1px solid var(--line); font-weight: 600; }
.mc { padding: 6px 5px 4px; gap: 3px; transition: background .12s; }
.mc:hover { background: var(--surface-2); }
.mc.out { background: transparent; }
.mc.out .mn, .mc.out .cal-chip { opacity: .45; }
.mc .mn { margin-left: 1px; font-size: 13px; }
.mc-items { display: flex; flex-direction: column; gap: 3px; min-height: 0; }
.mc .cal-chip { height: 21px; border-radius: 6px; font-size: 11.5px; }
.mc .more { align-self: flex-start; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--line); color: var(--text-2); font-size: 11px; font-weight: 600; }
.mc .more:hover { background: var(--line-strong); }
.daypop { padding: 4px; }
.daypop .dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 10px; }
.daypop .dp-head b { font-size: 14px; }
.daypop .dp-items { display: flex; flex-direction: column; gap: 4px; }
.daypop .cal-chip { height: 28px; font-size: 12.5px; }
.ec-actions .btn { white-space: nowrap; } .ecard { gap: 12px; }

/* ---------- seletor de aparência, ícones e paleta ---------- */
.ap-host .layer { z-index: 65; }
.ap-host .pop { z-index: 66; }
.ap { display: flex; flex-direction: column; gap: 6px; }
.ap-tabs { margin-bottom: 2px; }
.ap-body { max-height: 260px; overflow-y: auto; }
.ic-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 2px; }
.ic-grid button { height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); }
.ic-grid button:hover { background: var(--hover); color: var(--text); }
.ic-grid button.on { background: var(--accent); color: #fff; }
.ap-colors { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; padding: 2px 4px 6px; }
.ap-colors button, .ap-colors label { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; justify-self: center; }
.ap-colors button.on, .ap-colors label.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw, var(--text-3)); }
.ap-colors .none { background: var(--hover); color: var(--text-3); font-size: 11px; font-weight: 700; }
.ap-colors .custom, .custom-sw { position: relative; background: conic-gradient(#DC2626, #CA8A04, #16A34A, #0891B2, #2563EB, #9333EA, #DB2777, #DC2626); color: #fff; font-weight: 700; font-size: 15px; overflow: hidden; cursor: default; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.custom-sw { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.custom-sw.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw, var(--text-3)); }
.ap-colors .custom input, .custom-sw input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.swatches { gap: 7px; }
.badge-ic { display: inline-grid; place-items: center; vertical-align: -3px; margin-right: 6px; }
.badge-em { margin-right: 6px; }
.row .title .badge-ic { vertical-align: -2px; }
.em .glyph { display: inline-block; vertical-align: -2px; }
.ec-icon { width: 24px; height: 24px; border-radius: 7px; background: var(--ec); color: #fff; display: grid; place-items: center; flex: none; margin-top: 1px; }
.cal-emoji .badge-ic, .cal-emoji .badge-em { margin-right: 0; }

/* durações e lembretes em chips */
.dchips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.field .dchips { margin: 0; }
.dchip { height: 28px; padding: 0 11px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.dchip:hover { background: var(--hover); color: var(--text); }
.dchip.on { background: var(--accent); color: #fff; box-shadow: none; }
.prop .v.chips { flex-wrap: wrap; gap: 5px; padding-top: 4px; padding-bottom: 4px; }
.prop .v.chips:hover { background: none; }
.prop .dchip { height: 26px; padding: 0 9px; font-size: 12px; }
.ev.virtual, .cal-chip.virtual { opacity: .86; }

/* ---------- marca ---------- */
.rail .logo { width: 40px; height: 40px; border-radius: 11px; margin-bottom: 14px; box-shadow: 0 4px 12px color-mix(in srgb, #2563EB 35%, transparent); }
.rail .logo img { border-radius: 11px; }

/* ---------- tela de entrada (iPhone / navegador) ---------- */
.login-screen { position: fixed; inset: 0; z-index: 90; background: #2563EB; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
.login-card { width: min(360px, 100%); background: var(--surface); border-radius: 26px; padding: 30px 22px 22px; display: flex; flex-direction: column; gap: 10px; text-align: center; box-shadow: 0 24px 60px rgba(8, 20, 60, .35); }
.login-logo { width: 76px; height: 76px; margin: 0 auto 6px; border-radius: 20px; box-shadow: 0 8px 20px rgba(37, 99, 235, .35); }
.login-card h1 { margin: 0; font: 700 26px var(--font-display); letter-spacing: -.01em; }
.login-card > p { margin: 0 0 10px; color: var(--text-2); }
.login-card .input { height: 48px; font-size: 16px; }
.login-card .btn { height: 48px; font-size: 16px; margin-top: 4px; }
.login-card .hint { margin-top: 6px; }

/* ---------- jeito de app de iPhone ---------- */
@keyframes sheet-up { from { transform: translateY(28px); opacity: .5; } }
@media (max-width: 760px) {
  html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
  body { background: var(--surface); }
  input, textarea, select, .input, .menu-search, .addbar input, .qc-title { font-size: 16px !important; } /* o iOS dá zoom em campos menores que 16px */
  button, .nav, .row, .cl-item { touch-action: manipulation; }
  .mtop { height: calc(env(safe-area-inset-top) + 54px); }
  .mtop h1 { font: 700 21px/1.2 var(--font-display); letter-spacing: -.01em; }
  #app.drawer .mtop h1::before { content: ""; }
  .layer { background: rgba(10, 16, 32, .32); animation: fade .15s; }
  .modal-wrap { align-items: end; place-items: end center; }
  .modal, .modal.wide { width: 100%; max-width: none; border-radius: 22px 22px 0 0; padding: 12px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; animation: sheet-up .24s ease-out; }
  .modal.wide { padding: 0 0 env(safe-area-inset-bottom); }
  .modal::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 12px; flex: none; }
  .modal.wide::before { margin: 10px auto 6px; }
  .pop:not(.drop), .ap-host .pop { left: 8px !important; right: 8px !important; width: auto !important; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)) !important; max-height: 78vh; border-radius: 20px; padding: 10px; animation: sheet-up .22s ease-out; }
  .menu-item { height: 44px; font-size: 15px; }
  .ep-grid button, .ic-grid button { height: 40px; }
  .ap-colors { grid-template-columns: repeat(9, 1fr); }
  .ap-colors button, .ap-colors label { width: 30px; height: 30px; }
  .toasts { left: 12px; right: 12px; transform: none; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .toast { width: 100%; justify-content: space-between; height: 46px; border-radius: 14px; }
  .palette { top: calc(env(safe-area-inset-top) + 8px); }
  .ee-row { grid-template-columns: 1fr 1fr; }
  .cal-mobile-views { margin: 2px 12px 8px; }
  .cal-mobile-views button { height: 32px; }
  .ev .n { font-size: 12px; }
  .detailpane { padding-top: env(safe-area-inset-top); }
}

/* ---------- agendamentos (link público) ---------- */
#app.mod-booking .listpane, #app.mod-booking .agendapane, #app.mod-booking .detailpane { display: none; }
#app:not(.mod-booking) .schedpane { display: none; }
.schedpane { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.sched-head { height: 72px; }
.sched-body { flex: 1; overflow-y: auto; padding: 4px 24px 60px 20px; }
.linkbar { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 14px 16px; border-radius: var(--r-l); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.lb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lb-left > div { display: flex; flex-direction: column; min-width: 0; }
.lb-left a { color: var(--accent); font-size: 13px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-av { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.lb-actions { display: flex; gap: 6px; align-items: center; }
.sched-tabs { max-width: 520px; margin-bottom: 18px; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tcard { background: var(--surface); border-radius: var(--r-l); box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(16,32,72,.04); padding: 16px; display: flex; flex-direction: column; gap: 4px; transition: box-shadow .15s; }
.tcard:hover { box-shadow: inset 0 0 0 1.5px var(--tc), 0 6px 18px rgba(16,32,72,.08); }
.tcard.off { opacity: .55; }
.tc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.tc-badge { width: 40px; height: 40px; border-radius: 12px; background: var(--tc); color: #fff; display: grid; place-items: center; font-size: 19px; }
.tcard b { font-size: 15.5px; }
.tc-meta { color: var(--text-2); font-size: 13px; }
.tc-link { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-actions { display: flex; gap: 4px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.tc-actions .btn { flex: 1; }
.sched-onb { max-width: 460px; margin: 60px auto; text-align: center; }
.onb-ic { width: 72px; height: 72px; border-radius: 20px; background: var(--accent); color: #fff; display: grid; place-items: center; margin: 0 auto 16px; }
.sched-onb h2 { font: 700 22px var(--font-display); margin: 0 0 8px; }
.sched-onb p { color: var(--text-2); margin: 0 0 20px; line-height: 1.55; }
.slugfield { display: flex; align-items: center; height: 40px; border-radius: var(--r-s); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); padding: 0 12px; font-size: 14px; }
.slugfield span { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.slugfield input { flex: 1; min-width: 0; font-weight: 600; }
.slugfield:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--surface); }
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rules label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.rules .select { width: 100%; height: 36px; }
.qrow { display: grid; grid-template-columns: 1fr 120px auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.qrow .qopts { grid-column: 1 / -1; }
.qreq { display: flex; gap: 5px; align-items: center; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.linkbtn { color: var(--accent); font-weight: 600; font-size: 13.5px; padding: 4px 0; }
.bk-list { display: flex; flex-direction: column; gap: 8px; }
.bk { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.bk.cancelled { opacity: .6; }
.bk-date { width: 48px; height: 52px; border-radius: 12px; background: var(--accent); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; line-height: 1.1; }
.bk.cancelled .bk-date { background: var(--text-3); }
.bk-date span { font: 700 19px var(--font-display); }
.bk-date small { font-size: 11px; text-transform: uppercase; }
.bk-main { flex: 1; min-width: 0; }
.bk-main .muted { color: var(--text-3); font-size: 13px; }
.bk-meta { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.bk-x { color: var(--high); }
.bk-ans { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.bk-ans summary { cursor: default; color: var(--accent); font-weight: 600; }
.bk-ans p { margin: 6px 0; }
.bk-actions { display: flex; gap: 4px; align-items: center; }
.hours { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; }
.hours h3 { margin: 0 0 4px; font: 600 16px var(--font-display); }
.hours .hint { margin: 0 0 14px; }
.hrow { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); flex-wrap: wrap; padding: 6px 0; }
.hday { width: 40px; font-weight: 600; text-transform: capitalize; }
.hdate { width: 92px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hranges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
.hr { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 10px; padding: 4px 4px 4px 10px; box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--text-3); }
.hr input, .ov-add input[type=time] { font-variant-numeric: tabular-nums; color: var(--text); }
.hr .icon-btn { width: 26px; height: 26px; }
.ov-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.ov-add .input { width: 160px; height: 36px; }
.ov-add [data-ov-times] { display: inline-flex; gap: 6px; }
.ov-add [data-ov-times][hidden] { display: none; }
@media (max-width: 760px) {
  .sched-head { display: none; }
  .sched-body { padding: 8px 12px 100px; }
  .hours { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr 1fr; }
  .qrow { grid-template-columns: 1fr auto; }
  .qrow select { grid-column: 1; }
}

/* ---------- estilo leve: cartões, respiro e poucas linhas (15/10) ----------
   Padrões: raio 12 (pequeno) / 16 (cartão) / 24 (painel); respiro 8 / 12 / 16 / 24. */
:root {
  --r-s: 10px; --r-m: 14px; --r-l: 24px; --r-card: 18px;
  --bg: #ECEFF5; --rail: #ECEFF5;
  --grid-bg: #F6F7FA; --grid-line: #E8EBF1;
  --side-w: 268px;
}
:root[data-theme="dark"] { --bg: #070B15; --rail: #070B15; --grid-bg: #0D1322; --grid-line: #1A2236; }
.main { margin: 10px 10px 10px 0; border-radius: var(--r-l); box-shadow: 0 1px 2px rgba(16, 32, 72, .04), 0 12px 40px rgba(16, 32, 72, .06); }
#app.side-collapsed .main { margin-left: 10px; }
.rail-btn { border-radius: 14px; }

/* lateral em cartões */
.sidebar { padding: 40px 10px 10px 2px; }
.side-card { background: var(--surface); border-radius: var(--r-card); padding: 14px; margin: 0 0 10px; box-shadow: 0 1px 2px rgba(16, 32, 72, .04); }
.new-btn-wrap { padding: 2px 0 12px; }
.new-btn { height: 44px; border-radius: 14px; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.mini { padding: 12px 10px 10px; }
.mini-head { padding: 0 0 6px 6px; }
.mini-head b { font-size: 14px; font-weight: 600; }
.mini-grid { gap: 2px 0; }
.mini-grid button { height: 32px; border-radius: 0; display: grid; place-items: center; background: none !important; }
.mini-grid button span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.mini-grid button:hover span { background: var(--hover); }
.mini-grid button.inrange { background: var(--grid-bg) !important; }
.mini-grid button.r-start { border-radius: 16px 0 0 16px; }
.mini-grid button.r-end { border-radius: 0 16px 16px 0; }
.mini-grid button.r-start.r-end { border-radius: 16px; }
.mini-grid button.today span { background: var(--accent); color: #fff; font-weight: 600; }
.mini-grid button i { bottom: 1px; }
.mini-grid button.today i { background: var(--accent); }

.next-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 12px; }
.nc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nc-time { color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.nc-when { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--hover); color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.nc-when.soon { background: var(--accent); color: #fff; }
.nc-title { font: 600 16px/1.3 var(--font-display); letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nc-title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ec); margin: 0 7px 2px 0; vertical-align: middle; }
.nc-actions { display: flex; gap: 6px; margin-top: 2px; }
.nc-actions .btn { flex: 1; height: 34px; border-radius: 11px; }

.cals { padding: 6px 6px 8px; }
.cals .side-head { padding: 10px 10px 6px; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.cals .nav { border-radius: 11px; }
.cals .g-status { padding: 8px 10px 2px; min-width: 0; }
.cals .g-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-card { margin: 0 0 10px; border-radius: var(--r-card); }

/* cabeçalho */
.cal-head { height: 80px; padding: 0 20px 0 18px; gap: 12px; }
.cal-head h1 { font: 600 27px/1.1 var(--font-display); letter-spacing: -.025em; }
.cal-views { background: var(--grid-bg); border-radius: 14px; padding: 4px; }
.cal-views button { height: 34px; border-radius: 10px; padding: 0 14px; font-size: 13px; }
.cal-views button.on { box-shadow: 0 1px 3px rgba(16, 32, 72, .1); font-weight: 600; }
.nav-arrows { gap: 6px; }
.sq-btn { height: 40px; min-width: 40px; border-radius: 12px; background: var(--grid-bg); display: grid; place-items: center; color: var(--text); font-size: 13.5px; font-weight: 600; }
.sq-btn:hover { background: var(--hover); }
.today-btn { padding: 0 16px; }
.head-new { height: 40px; border-radius: 12px; }

/* dias em cartões */
.cal-grid { --gut: 60px; }
.cal-days { border-bottom: 0; padding: 0 12px 12px 0; }
.cal-day-h { height: 70px; margin: 0 4px; border-radius: 16px; background: var(--grid-bg); gap: 4px; }
.cal-day-h:hover { background: var(--hover); }
.cal-day-h .dw { font-size: 12.5px; text-transform: none; letter-spacing: 0; color: var(--text-2); }
.cal-day-h .dn { width: auto; height: auto; border-radius: 0; font: 600 24px/1 var(--font-display); letter-spacing: -.02em; }
.cal-day-h.past .dn { color: var(--text-3); }
.cal-day-h.today, .cal-day-h.today:hover { background: var(--accent); }
.cal-day-h.today .dn { background: none; color: #fff; }
.cal-day-h.today .dw { color: #fff; font-weight: 500; }
.cal-allday { border-bottom: 0; padding: 0 12px 8px 0; }
.ad-col { padding: 0 4px; gap: 4px; }
.ad-col .cal-chip { height: 26px; border-radius: 9px; padding: 0 9px; }

/* grade: fundo cinza claro, só as linhas das horas */
.cal-scroll { background: var(--grid-bg); border-radius: 20px 20px 0 0; margin: 0 12px 0 10px; }
.cal-body { padding-right: 0; background-image: linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px); background-size: 100% 56px; }
.cal-body .gutter { background: var(--grid-bg); }
.cal-body .gutter span { right: 10px; font-size: 11.5px; }
.col { border-left: 0; }
.col.today { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.cal-days, .cal-allday { padding-left: 10px; padding-right: 12px; }
.now { height: 1.5px; background: var(--text); left: 0; }
.now::before { display: none; }
.now-tag { position: absolute; right: 4px; transform: translateY(-50%); z-index: 4; height: 20px; padding: 0 6px; border-radius: 7px; background: var(--text); color: var(--surface); font: 600 11px/20px var(--font); font-variant-numeric: tabular-nums; }

/* eventos: cartões arredondados com respiro */
.ev { border-radius: 12px; box-shadow: none; }
.ev:hover { box-shadow: 0 6px 18px rgba(16, 32, 72, .16); }
.ev-in { padding: 8px 10px; gap: 3px; }
.ev .n { font-size: 12.5px; font-weight: 600; letter-spacing: -.005em; }
.ev .t { font-size: 11.5px; opacity: .88; }
.ev.short .ev-in { padding: 2px 9px; }
.ev.task .ev-in { gap: 7px; }
.ev .meet { height: 20px; padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, .22); align-self: flex-start; margin-top: 4px; }

/* mês em blocos */
.cal-month { padding: 0 16px 16px 14px; gap: 6px; grid-template-rows: 28px repeat(6, 1fr); }
.cal-month .mh { border-bottom: 0; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.mc { border: 0 !important; border-radius: 16px; background: var(--grid-bg); padding: 8px 6px 6px; }
.mc:hover { background: var(--hover); }
.mc.out { background: transparent; box-shadow: inset 0 0 0 1px var(--grid-line); }
.mc .mn { height: 28px; min-width: 28px; border-radius: 14px; font-size: 13.5px; }
.mc.today { background: var(--surface); box-shadow: 0 4px 16px rgba(16, 32, 72, .08); }
.mc .cal-chip { height: 22px; border-radius: 8px; }
.mc .more { background: var(--surface); }

/* lista */
.cl-day { border-bottom: 0; padding: 10px 0; }
.cl-items { background: var(--grid-bg); border-radius: 16px; padding: 6px; }
.cl-item { border-radius: 12px; }
.cl-item:hover { background: var(--surface); }

/* agendamentos: tipos com a duração em destaque */
.sched-body { padding: 4px 24px 60px; }
.linkbar { background: var(--grid-bg); box-shadow: none; border-radius: 20px; padding: 16px 18px; }
.sched-tabs { background: var(--grid-bg); border-radius: 14px; padding: 4px; }
.sched-tabs button { height: 34px; border-radius: 10px; }
.tgrid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tcard { background: var(--grid-bg); box-shadow: none; border-radius: 20px; padding: 18px; gap: 2px; }
.tcard:hover { box-shadow: 0 8px 24px rgba(16, 32, 72, .08); background: var(--surface); }
.tc-top { margin-bottom: 14px; }
.tc-badge { width: 44px; height: 44px; border-radius: 50%; }
.tc-dur { display: flex; align-items: baseline; gap: 6px; }
.tc-dur .num { font: 600 40px/1 var(--font-display); letter-spacing: -.03em; }
.tc-dur small { font-size: 13px; color: var(--text-2); }
.tc-dur small b { color: var(--text); font-weight: 600; }
.tc-name { font-size: 15px; margin-top: 10px; }
.tc-actions { border-top: 0; padding-top: 0; margin-top: 14px; }
.tc-actions .btn { background: var(--surface); height: 36px; border-radius: 11px; }
.tcard:hover .tc-actions .btn { background: var(--grid-bg); }
.bk { background: var(--grid-bg); box-shadow: none; border-radius: 16px; padding: 14px 16px; }
.bk-date { border-radius: 14px; }

/* janelas médias */
@media (max-width: 1180px) and (min-width: 761px) {
  .cal-views button { padding: 0 10px; }
  .today-btn { padding: 0 12px; }
}
@media (max-width: 960px) and (min-width: 761px) {
  .cal-head h1 { font-size: 22px; }
}

/* celular: saudação no topo, dias compactos */
.mtitle { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: 4px; }
.mtitle small { color: var(--text-3); font-size: 12px; line-height: 1.2; }
.mtitle h1 { margin: 0 !important; }
@media (max-width: 760px) {
  .mtop { height: calc(env(safe-area-inset-top) + 60px); }
  .cal-grid { --gut: 44px; }
  .cal-days { padding: 0 8px 8px 0; }
  .cal-days, .cal-allday { padding-left: 6px; padding-right: 8px; }
  .cal-day-h { height: 56px; margin: 0 3px; border-radius: 14px; gap: 3px; }
  .cal-day-h .dw { font-size: 11.5px; }
  .cal-day-h .dn { font-size: 19px; }
  .cal-scroll { margin: 0 8px 0 6px; border-radius: 16px 16px 0 0; }
  .ev-in { padding: 6px 8px; }
  .cal-month { padding: 0 8px 8px; gap: 3px; }
  .mc { border-radius: 10px; padding: 4px 2px; }
  .cal-mobile-views { background: var(--grid-bg); border-radius: 12px; padding: 3px; }
  .cal-mobile-views button { border-radius: 9px; }
  .sidebar .side-card { margin-bottom: 10px; }
}
.ad-more { align-self: flex-start; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--grid-bg); color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.ad-more:hover { background: var(--hover); }
/* títulos de todas as telas no mesmo padrão da agenda */
.head { height: 80px; padding: 0 20px 0 18px; }
.head h1 { font: 600 27px/1.1 var(--font-display); letter-spacing: -.025em; }
.head .btn.primary { height: 40px; border-radius: 12px; }
.addbar { height: 46px; border-radius: 14px; background: var(--grid-bg); }
@media (max-width: 760px) {
  .main, #app.side-collapsed .main { margin: 0; border-radius: 0; box-shadow: none; }
}

/* ---------- ícones e alinhamento (15/10) ----------
   Pílulas e blocos: bolinha da tarefa, ícone e texto sempre no mesmo eixo (linha de 16px). */
.rail-btn .i-on { display: none; }
.rail-btn.on { background: transparent; box-shadow: none; color: var(--accent); --cut: var(--rail); }
.rail-btn.on .i-on { display: block; }
.rail-btn.on .i-off { display: none; }
.rail-btn:hover, .rail-btn.on:hover { background: var(--hover); --cut: var(--hover); }

.em { margin: 0; display: inline-grid; place-items: center; flex: none; }
.cal-chip { gap: 6px; }
.cal-chip .tc, .ev .tc { margin: 0; flex: none; }
.cal-chip .em { width: 14px; height: 16px; }
.cal-chip .n { line-height: 16px; flex: 1; min-width: 0; }
.cal-chip .t { line-height: 16px; }

.ev .ev-in, .ev.task .ev-in, .ev.short .ev-in { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.ev-head { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.ev-head .tc { width: 14px; height: 14px; margin-top: 1px; }
.ev-head .em { width: 14px; height: 16px; }
.ev-head .n { flex: 1; min-width: 0; line-height: 16px; }
.ev.short .ev-in { justify-content: center; padding-top: 0; padding-bottom: 0; }
.ev.short .ev-head { align-items: center; }
.ev.short .ev-head .tc { margin-top: 0; }
.ev.short .ev-head .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .meet { display: inline-flex; align-items: center; gap: 5px; height: 22px; line-height: 1; }
.ev .meet .ic { flex: none; }

/* selos de ícone em textos corridos (listas, detalhes) */
.badge-ic { vertical-align: middle; position: relative; top: -1px; }
.nav .badge-ic, .menu-item .badge-ic { top: 0; margin-right: 0; }
.ec-icon { width: 30px; height: 30px; border-radius: 10px; background: var(--ec); color: #fff; display: grid; place-items: center; flex: none; }
.ec-title { align-items: center; }
.ec-title .sq { margin-top: 0; }
.nc-title { display: flex; align-items: flex-start; gap: 8px; font: inherit; -webkit-line-clamp: unset; }
.nc-title::before { content: none; }
.nc-title .em { width: 16px; height: 21px; color: var(--ec); }
.nc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ec); flex: none; margin-top: 6px; }
.nc-title b { font: 600 16px/21px var(--font-display); letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* janela estreita do Mac (até 1040px): cabeçalho compacto, tudo numa linha */
@media (max-width: 1040px) and (min-width: 761px) {
  .cal-head { gap: 8px; padding: 0 14px 0 12px; }
  .cal-head h1 { font-size: 20px; }
  .cal-views { flex-shrink: 0; overflow: visible; }
  .cal-views button { padding: 0 8px; font-size: 12.5px; }
  .nav-arrows { gap: 4px; }
  .sq-btn { min-width: 36px; height: 36px; }
  .today-btn { padding: 0 10px; }
  .head-new { width: 36px; height: 36px; padding: 0; }
  .head-new .lbl { display: none; }
  .cal-day-h .dn { font-size: 21px; }
}

/* ---------- cabeçalho com menus, menu reduzido e mês denso (15/10) ---------- */
.mtop-cal, .fab, .tabbar { display: none; }
.cal-head { height: 72px; }
.cal-head h1 { font-size: 24px; }
.cal-head .sq-btn { height: 38px; min-width: 38px; border-radius: 12px; }
.view-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px 0 14px; font-size: 13.5px; font-weight: 600; }
.view-btn .ic { color: var(--text-2); }
.nav-group { display: flex; align-items: center; height: 38px; border-radius: 12px; background: var(--grid-bg); padding: 0 2px; }
.nav-group button { height: 34px; min-width: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text); }
.nav-group button:hover { background: var(--hover); }
.nav-group .today-btn { padding: 0 12px; font-size: 13.5px; font-weight: 600; }
.pop.drop .menu-item { height: 38px; }
.pop.drop .menu-item .check-mark { color: var(--accent); }

/* menu reduzido: lateral escondida, agenda com mais folga */
#app.side-collapsed .main { margin: 8px 8px 8px 0; }
#app.side-collapsed .cal-month { gap: 5px; }
#app.side-collapsed .cal-day-h { height: 64px; }

/* mês: uma linha por item, hora à direita, sem a bolinha */
.cal-month .mh .l { display: none; }
.mc .cal-chip { height: 21px; padding: 0 8px; font-size: 12px; gap: 5px; }
.mc .cal-chip .tc { display: none; }
.mc .cal-chip .t { order: 9; margin-left: auto; padding-left: 6px; font-size: 11px; opacity: .85; }
.mc-items { gap: 3px; }

@media (max-width: 760px) {
  /* topo: botões redondos e título no meio */
  .mtop.mtop-cal { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 8px; height: auto; padding: calc(env(safe-area-inset-top) + 8px) 14px 8px; background: var(--surface); }
  .mtop-cal h1 { margin: 0; text-align: center; font: 600 18px/1.2 var(--font-display); letter-spacing: -.01em; }
  .round-btn { width: 46px; height: 46px; border-radius: 50%; background: var(--surface); color: var(--text); display: grid; place-items: center; box-shadow: 0 0 0 1px var(--line), 0 4px 14px rgba(16, 32, 72, .08); }
  .round-btn:active { background: var(--hover); }
  .cal-mobile-views { display: none !important; }
  .pop.drop { border-radius: 22px; padding: 8px; min-width: 230px; box-shadow: 0 16px 50px rgba(16, 32, 72, .22), 0 0 0 1px var(--line); }
  .pop.drop .menu-item { height: 48px; font-size: 16.5px; gap: 14px; padding: 0 14px; }
  .pop.drop .menu-item .ic { width: 22px; height: 22px; color: var(--text); }

  /* botão + flutuante */
  .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 43; width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 45%, transparent); }
  .fab:active { transform: scale(.96); }

  /* barra de abas flutuante */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; left: 14px; right: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 44; height: 66px; padding: 0 6px; border-radius: 33px; background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: 0 0 0 1px var(--line), 0 10px 34px rgba(16, 32, 72, .14); }
  .tab { height: 54px; border-radius: 27px; display: grid; place-items: center; color: var(--text); --cut: var(--surface); }
  .tab .i-on { display: none; }
  .tab.on { background: var(--hover); color: var(--accent); --cut: var(--hover); }
  .tab.on .i-on { display: block; }
  .tab.on .i-off { display: none; }
  .tab-cal { position: relative; width: 25px; height: 25px; border-radius: 8px; border: 2.2px solid currentColor; display: grid; place-items: center; }
  .tab-cal::before { content: ""; position: absolute; top: -6px; left: 5px; width: 2.2px; height: 6px; border-radius: 2px; background: currentColor; box-shadow: 9.6px 0 0 currentColor; }
  .tab-cal b { font: 700 11.5px/1 var(--font); margin-top: 2px; font-variant-numeric: tabular-nums; }
  .tab.on .tab-cal { background: var(--accent); border-color: var(--accent); }
  .tab.on .tab-cal b { color: #fff; }
  #app.drawer .tabbar, #app.drawer .fab { display: none; }

  /* espaço para a barra de abas no fim das telas */
  .cal-scroll { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .cal-list, .scroller, .sched-body { padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important; }
  .sidebar { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

  /* mês em tela cheia, sem caixas, como no app do iPhone */
  .cal-month { padding: 0 2px calc(84px + env(safe-area-inset-bottom)); gap: 0; grid-template-rows: 28px repeat(6, 1fr); }
  .cal-month .mh { font-size: 12.5px; color: var(--text-3); font-weight: 500; border-bottom: 1px solid var(--line); }
  .cal-month .mh .l { display: inline; }
  .cal-month .mh .s { display: none; }
  .mc, .mc.out, .mc.today { background: transparent; box-shadow: none; border-radius: 0; padding: 6px 1px 2px; gap: 3px; }
  .mc:hover { background: transparent; }
  .mc .mn { align-self: center; height: 30px; min-width: 30px; padding: 0 6px; border-radius: 15px; font-size: 16px; font-weight: 500; margin: 0; }
  .mc.today .mn { background: var(--accent); color: #fff; }
  .mc.out .mn { opacity: .4; }
  .mc-items { gap: 2px; }
  .mc .cal-chip { height: 17px; padding: 0 3px; border-radius: 4px; font-size: 10.5px; gap: 3px; }
  .mc .cal-chip .em { width: 10px; height: 14px; }
  .mc .cal-chip .em .ic { width: 10px; height: 10px; }
  .mc .cal-chip .t { display: none; }
  .mc .more { height: 16px; padding: 0 5px; font-size: 10px; background: transparent; color: var(--text-3); }
}

/* ---------- Agendamentos: visão geral, abas e compartilhar (15/10) ---------- */
.sched-head { height: 72px; }
.head-cta { height: 38px; border-radius: 12px; padding: 0 14px; }
.sched-body { padding: 0 24px 60px; }
.sched-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.profile-card, .next-meet, .kpi, .hours-card { background: var(--grid-bg); border-radius: 20px; }
.profile-card { padding: 18px; display: flex; flex-direction: column; gap: 16px; justify-content: space-between; }
.pc-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pc-head .lb-av { width: 48px; height: 48px; font-size: 16px; }
.pc-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-who b { font: 600 17px/1.2 var(--font-display); }
.pc-who a { color: var(--accent); font-size: 13px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-actions .btn { height: 38px; border-radius: 12px; }
.pc-actions .btn:not(.primary) { background: var(--surface); }
.next-meet { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.nm-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nm-label { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.nm-name { font: 600 18px/1.25 var(--font-display); letter-spacing: -.01em; }
.nm-meta { color: var(--text-2); font-size: 13px; }
.nm-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 8px; }
.nm-actions .btn { height: 34px; border-radius: 11px; }
.nm-actions .btn:not(.primary) { background: var(--surface); }
.next-meet.empty .nm-name { color: var(--text-2); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.kpi-ic { grid-row: 1 / 3; width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.kpi b { font: 600 22px/1.1 var(--font-display); }
.kpi > span:last-child { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-tabs { max-width: 640px; margin-bottom: 16px; }

.tc-top { align-items: center; gap: 10px; }
.tc-state { flex: 1; font-size: 12px; color: var(--text-3); font-weight: 500; }
.tc-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--text-2); font-size: 12.5px; }
.tc-facts span { display: inline-flex; align-items: center; gap: 6px; }
.tc-facts .ic { color: var(--text-3); }
.tnew { align-items: flex-start; justify-content: center; text-align: left; gap: 6px; min-height: 230px; color: var(--text-2); }
.tnew b { color: var(--text); font-size: 15px; }
.tnew span:last-child { font-size: 12.5px; }
.tnew-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin-bottom: 6px; }
.tc-badge.sm { width: 32px; height: 32px; border-radius: 50%; flex: none; }

.bk-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bk-filter { background: var(--grid-bg); border-radius: 12px; }
.bk-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 12px; background: var(--grid-bg); color: var(--text-3); }
.bk-search input { flex: 1; font-size: 13.5px; color: var(--text); }
.bk-day { margin-bottom: 16px; }
.bk-day-h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; margin: 0 2px 8px; }
.bk-list { gap: 6px; }
.bk { align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--grid-bg); }
.bk-time { width: 54px; flex: none; display: flex; flex-direction: column; line-height: 1.25; }
.bk-time b { font-size: 14px; }
.bk-time span { font-size: 12px; color: var(--text-3); }
.bk-av { width: 38px; height: 38px; border-radius: 50%; background: var(--tc); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.bk-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-line b { font-size: 14px; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--text-2); color: #fff; font-size: 11px; font-weight: 600; }
.tag.red { background: var(--high); }
.bk-actions .btn { height: 32px; border-radius: 10px; }
.sched-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 48px 16px; border-radius: 20px; background: var(--grid-bg); color: var(--text-2); }
.sched-empty b { color: var(--text); font-size: 15px; }

.hours { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.hours-card { padding: 18px; }
.hc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.hc-head .btn { background: var(--surface); border-radius: 10px; }
.hours-card .hrow { border-bottom-color: var(--grid-line); min-height: 52px; }
.hours-card .hrow:last-child { border-bottom: 0; }
.hrow.off .hday { color: var(--text-3); }
.hday { width: 76px; }
.hours-card .hr { background: var(--surface); box-shadow: none; }
.ov-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ov-item { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 6px 0 12px; border-radius: 12px; background: var(--surface); }
.ov-date { font-weight: 600; min-width: 110px; text-transform: capitalize; }
.ov-times { flex: 1; font-variant-numeric: tabular-nums; }
.ov-item .muted { flex: 1; }
.ov-add .input, .ov-add .select { background: var(--surface); }

.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.share-grid .hours-card:last-child { grid-column: 1 / -1; }
.share-grid h4 { margin: 14px 0 8px; font-size: 13px; color: var(--text-2); }
.share-url { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 6px 0 14px; border-radius: 14px; background: var(--surface); font-weight: 600; }
.share-url span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }
.share-box { padding: 12px 14px; border-radius: 14px; background: var(--surface); color: var(--text-2); line-height: 1.5; font-size: 13.5px; }
.share-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.share-actions .btn, .share-type .btn { background: var(--surface); border-radius: 10px; }
.share-type { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--grid-line); }
.share-type:last-child { border-bottom: 0; }
.share-type > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.share-type > div span { font-size: 12px; color: var(--text-3); }
.share-code { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); white-space: pre-wrap; word-break: break-all; user-select: text; -webkit-user-select: text; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1040px) and (min-width: 761px) {
  .head-cta { width: 38px; padding: 0; }
  .head-cta .lbl { display: none; }
}
@media (max-width: 900px) {
  .sched-top, .hours, .share-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sched-head { display: none; }
  .sched-body { padding: 4px 14px calc(120px + env(safe-area-inset-bottom)); }
  .kpis { gap: 8px; }
  .kpi { padding: 12px; column-gap: 10px; }
  .kpi-ic { width: 32px; height: 32px; border-radius: 10px; }
  .kpi b { font-size: 19px; }
  .sched-tabs { overflow-x: auto; scrollbar-width: none; }
  .sched-tabs button { flex: none; padding: 0 12px; }
  .bk { flex-wrap: wrap; }
  .bk-actions { width: 100%; justify-content: flex-end; }
  .hday { width: 64px; }
}
@media (max-width: 560px) { .tgrid { grid-template-columns: 1fr; } .tnew { min-height: 0; } }
.code-input { text-align: center; font: 600 26px/1 var(--font) !important; letter-spacing: .14em; font-variant-numeric: tabular-nums; height: 58px !important; }
.login-card .linkbtn { margin-top: 2px; align-self: center; }
.pair-box { margin: 14px 0 0; padding: 16px; border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pair-code { font: 700 32px/1.1 var(--font); letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--text); }
.pair-box .hint { margin: 0; }
.acct-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acct-actions .wide { grid-column: 1 / -1; }
.acct-actions .btn { height: 40px; border-radius: 12px; }
.danger-link { display: inline-flex; align-items: center; gap: 6px; color: var(--high); margin-top: 6px; }

/* ---------- Hábitos (estilo TickTick, 15/10) ---------- */
#app.mod-habits .listpane, #app.mod-habits .agendapane, #app.mod-habits .detailpane, #app.mod-habits .schedpane { display: none; }
#app:not(.mod-habits) .habitpane { display: none; }
.habitpane { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.hb-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(400px, 1fr) minmax(380px, 1.05fr); gap: 12px; padding: 0 16px 16px 14px; }
.hb-list { overflow-y: auto; min-height: 0; padding-right: 2px; }
.hb-detail { overflow-y: auto; min-height: 0; background: var(--grid-bg); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.hb-pick { margin: auto; color: var(--text-3); }
.hb-grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(7, 34px); column-gap: 6px; align-items: center; }
.hb-week { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 2px 12px 10px; }
.hb-wd { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1; }
.hb-wd small { font-size: 11px; color: var(--text-3); }
.hb-wd b { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.hb-wd.today small, .hb-wd.today b { color: var(--accent); }
.ring-svg { display: block; }
.ring-svg circle { fill: none; stroke-width: 3.4; transform: rotate(-90deg); transform-origin: 50% 50%; stroke-linecap: round; }
.ring-svg .bg { stroke: var(--grid-line); }
.ring-svg .fg { stroke: var(--accent); }
.ring-svg .ok { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.hb-sec { margin-top: 6px; }
.hb-sec-h { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.hb-sec-h .ic { color: var(--text-3); transition: transform .15s; }
.hb-sec.closed .hb-sec-h .ic { transform: rotate(-90deg); }
.hb-card { padding: 12px; border-radius: 18px; background: var(--grid-bg); margin-bottom: 8px; cursor: default; transition: background .12s, box-shadow .12s; }
.hb-card:hover { background: var(--hover); }
.hb-card.sel { background: var(--surface); box-shadow: 0 0 0 2px var(--accent), 0 6px 18px rgba(16, 32, 72, .08); }
.hb-card.archived { opacity: .6; }
.hb-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hb-badge { width: 40px; height: 40px; border-radius: 50%; background: var(--hc); color: #fff; display: grid; place-items: center; flex: none; }
.hb-badge.big { width: 48px; height: 48px; }
.hb-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hb-txt b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 20px; }
.hb-meta { display: flex; gap: 12px; color: var(--text-3); font-size: 12px; line-height: 16px; }
.hb-meta span { display: inline-flex; align-items: center; gap: 4px; }
.hb-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; justify-self: center; color: #fff; position: relative; touch-action: manipulation; -webkit-touch-callout: none; user-select: none; }
.hb-dot.due { box-shadow: inset 0 0 0 2px var(--line-strong); }
.hb-dot.off { background: none; }
.hb-dot.off::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.hb-dot.done { background: var(--hc); }
.hb-dot.skip { background: var(--line-strong); color: var(--text-2); }
.hb-dot.part { box-shadow: inset 0 0 0 2px var(--line-strong); }
.hb-dot .ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.hb-dot .ring circle { fill: none; stroke: var(--hc); stroke-width: 3.4; transform: rotate(-90deg); transform-origin: 50% 50%; stroke-linecap: round; }
.hb-dot.today.due, .hb-dot.today.part { box-shadow: inset 0 0 0 2px var(--hc); }
.hb-dot.future { opacity: .35; }
.hb-dot:hover:not(.future) { filter: brightness(1.05); transform: scale(1.06); }
.hb-dot .ic { width: 14px; height: 14px; stroke-width: 3; }

.hb-d-head { display: flex; align-items: center; gap: 12px; }
.hb-d-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hb-d-title h2 { margin: 0; font: 600 20px/1.2 var(--font-display); letter-spacing: -.01em; }
.hb-d-title span { color: var(--text-2); font-size: 12.5px; }
.hb-back { display: none; }
.hb-today-cta { display: flex; gap: 8px; }
.hb-today-cta .btn { height: 42px; border-radius: 13px; }
.hb-today-cta .btn:not(.primary) { background: var(--surface); }
.hb-check-today { flex: 1; }
.hb-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hb-stat { background: var(--surface); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.hb-stat-l { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; line-height: 16px; }
.hb-stat-l .ic { color: var(--accent); }
.hb-stat b { font: 600 20px/1.25 var(--font-display); }
.hb-stat small { color: var(--text-3); font-size: 11.5px; }
.hb-goal { background: var(--surface); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.hb-goal > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.hb-goal b { font: 600 22px/1 var(--font-display); }
.hb-goal span { color: var(--text-2); font-size: 12.5px; }
.hb-bar { height: 8px; border-radius: 4px; background: var(--grid-line); overflow: hidden; }
.hb-bar i { display: block; height: 100%; border-radius: 4px; }
.hb-cal { background: var(--surface); border-radius: 16px; padding: 12px; }
.hb-cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.hb-cal-h b { font-size: 14px; }
.hb-cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 0; justify-items: center; }
.hb-cal-g small { font-size: 11px; color: var(--text-3); line-height: 18px; }
.hb-cal-d { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-variant-numeric: tabular-nums; position: relative; color: var(--text); }
.hb-cal-d.off { color: var(--text-3); }
.hb-cal-d.miss { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.hb-cal-d.done { background: var(--hc); color: #fff; font-weight: 600; }
.hb-cal-d.part { box-shadow: inset 0 0 0 2px var(--hc); }
.hb-cal-d.skip { background: var(--line-strong); color: var(--text-2); }
.hb-cal-d.today:not(.done) { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 700; }
.hb-cal-d.future { opacity: .45; }
.hb-cal-d i { position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; opacity: .8; }
.hb-log { background: var(--surface); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.hb-log-h { display: flex; align-items: center; justify-content: space-between; }
.hb-log-h b { font-size: 14px; }
.hb-log .hint { margin: 0; }
.hb-note { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--grid-line); text-align: left; width: 100%; }
.hb-note-d { width: 34px; flex: none; display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: 16px; line-height: 1.1; }
.hb-note-d small { font-size: 10.5px; color: var(--text-3); font-weight: 500; }
.hb-note-t { font-size: 13px; color: var(--text-2); line-height: 1.45; white-space: pre-wrap; }
.hb-note-t b { color: var(--text); margin-right: 6px; }
.hb-empty { margin-top: 30px; }
.hb-days { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.hb-days button { width: 42px; height: 34px; border-radius: 10px; background: var(--hover); font-size: 12.5px; text-transform: capitalize; }
.hb-days button.on { background: var(--accent); color: #fff; font-weight: 600; }
.hb-n { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.hb-n b { min-width: 24px; text-align: center; font-size: 16px; }
.hb-n span { color: var(--text-2); font-size: 13px; }
.hb-n .sq-btn { width: 34px; height: 34px; min-width: 34px; border-radius: 10px; }
.hb-amount-def { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.hb-amount-def label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.hb-secs, .hb-rems { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dchip.add { background: var(--hover); color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.hb-rem { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 4px 0 10px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.hb-rem input { font-variant-numeric: tabular-nums; }
.hb-rem .icon-btn { width: 26px; height: 26px; }
.hb-amount { display: flex; flex-direction: column; gap: 10px; padding: 6px; }
.hb-amount-row { display: flex; align-items: center; gap: 8px; }
.hb-amount-row .input { width: 90px; text-align: center; }
.hb-amount-row span { color: var(--text-2); font-size: 13px; }

@media (max-width: 1100px) and (min-width: 761px) {
  .hb-wrap { grid-template-columns: 1fr; }
  .hb-detail { display: none; }
  .hb-wrap.detail-open .hb-list { display: none; }
  .hb-wrap.detail-open .hb-detail { display: flex; }
  .hb-back { display: grid; }
}
@media (max-width: 760px) {
  .hb-wrap { display: block; padding: 0 10px; overflow-y: auto; }
  .hb-list { overflow: visible; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .hb-week { padding: 4px 8px 10px; top: 0; }
  .hb-grid { grid-template-columns: minmax(0, 1fr) repeat(7, 28px); column-gap: 3px; }
  .hb-card { padding: 10px; border-radius: 16px; }
  .hb-badge { width: 34px; height: 34px; }
  .hb-info { gap: 9px; }
  .hb-txt b { font-size: 13.5px; }
  .hb-meta { gap: 8px; font-size: 11px; }
  .hb-dot { width: 26px; height: 26px; }
  .ring-svg { width: 28px; height: 28px; }
  .hb-detail { display: none; position: fixed; inset: 0; z-index: 47; border-radius: 0; padding: calc(env(safe-area-inset-top) + 10px) 14px calc(30px + env(safe-area-inset-bottom)); background: var(--surface); }
  .hb-wrap.detail-open .hb-detail { display: flex; animation: sheet-up .22s ease-out; }
  .hb-back { display: grid; }
  .hb-stat, .hb-goal, .hb-cal, .hb-log { background: var(--grid-bg); }
  .hb-cal-d { width: 38px; height: 38px; }
}

/* ---------- alinhamento ao centro (15/10) ---------- */
.toast { padding: 0 18px; justify-content: center; line-height: 1.2; text-align: center; }
.toast:has(button) { padding-right: 8px; justify-content: space-between; text-align: left; }
.pill, .tag, .nc-when, .chip, .prio-badge, .head .sub, .group-head .count, .mc .more, .ad-more { line-height: 1; }
.btn, .sq-btn, .dchip, .seg button, .menu-item { line-height: 1.2; }
.btn .ic, .sq-btn .ic, .menu-item .ic, .seg button .ic { flex: none; }
.hb-meta span { white-space: nowrap; }
@media (max-width: 760px) {
  .hb-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: 0; }
  .hb-week > span:first-child { display: none; }
  .hb-week { padding: 4px 10px 10px; }
  .hb-info { grid-column: 1 / -1; margin-bottom: 10px; }
  .hb-card { padding: 12px 10px; }
  .hb-dot { width: 32px; height: 32px; }
  .hb-txt b { font-size: 14.5px; }
  .hb-meta { font-size: 12px; gap: 12px; }
}
.seg.hb-freq { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.seg.hb-freq button { height: 34px; }
/* o contorno do hábito selecionado não pode ser cortado pela borda da lista */
.hb-list { padding: 4px 6px 24px; margin: -4px -6px 0; }
@media (max-width: 760px) { .hb-list { padding: 4px 4px calc(110px + env(safe-area-inset-bottom)); margin: -4px -4px 0; } }
.hb-secnew { display: inline-flex; gap: 6px; align-items: center; } .hb-secnew .input { height: 34px; width: 180px; }

/* ---------- navegar entre meses (23/10) ---------- */
.ch-title { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 10px 4px 8px; margin-left: -8px; border-radius: 12px; color: var(--text); }
.ch-title h1 { margin: 0 !important; }
.ch-title .ic { color: var(--text-3); flex: none; transition: transform .15s; }
.ch-title:hover { background: var(--hover); }
.mt-title { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 4px 8px; border-radius: 12px; color: var(--text); justify-self: center; }
.mt-title h1 { margin: 0; text-align: center; font: 600 18px/1.2 var(--font-display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-title .ic { color: var(--text-3); flex: none; }
.mt-title:active { background: var(--hover); }
.month-pick { padding: 12px; }
.mp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mp-head b { font: 600 17px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp-grid button { height: 44px; border-radius: 12px; font-size: 14px; font-weight: 500; background: var(--grid-bg); }
.mp-grid button:hover { background: var(--hover); }
.mp-grid button.mp-now { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); font-weight: 700; }
.mp-grid button.mp-on { background: var(--accent); color: #fff; font-weight: 700; box-shadow: none; }
.mp-today { width: 100%; margin-top: 10px; height: 38px; border-radius: 12px; }
.cal-body-wrap.anim-next > * { animation: cal-next .26s cubic-bezier(.2, .8, .2, 1); }
.cal-body-wrap.anim-prev > * { animation: cal-prev .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes cal-next { from { transform: translateX(32px); opacity: 0; } }
@keyframes cal-prev { from { transform: translateX(-32px); opacity: 0; } }
@media (max-width: 760px) {
  .mtop.mtop-cal { grid-template-columns: 46px minmax(0, 1fr) 46px; }
  .pop.drop.month-pick { left: 12px !important; right: 12px; width: auto !important; }
  .mp-grid button { height: 48px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .cal-body-wrap > * { animation: none !important; } }
