:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232d;
  --border: #2b303c;
  --text: #e9ebf1;
  --muted: #9aa3b2;
  --accent: #8291ff;
  --accent-ink: #0f1115;
  --good: #3ecf8e;
  --warn: #f0b24a;
  --bad: #f2707a;
  --c-blue: #3987e5; --c-orange: #d95926; --c-aqua: #199e70; --c-yellow: #c98500;
  --c-magenta: #d55181; --c-green: #008300; --c-violet: #9085e9; --c-red: #e66767;
  --c-none: #7d8696;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / .25);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f9;
    --surface: #ffffff;
    --surface-2: #eef0f4;
    --border: #dde1e8;
    --text: #1a1d24;
    --muted: #5c6574;
    --accent: #4353d8;
    --accent-ink: #ffffff;
    --good: #14855a;
    --warn: #99660a;
    --bad: #c2313d;
    --shadow: 0 1px 2px rgb(20 25 40 / .06);
    --c-blue: #2a78d6; --c-orange: #eb6834; --c-aqua: #1baf7a; --c-yellow: #eda100;
    --c-magenta: #e87ba4; --c-green: #008300; --c-violet: #4a3aa7; --c-red: #e34948;
    --c-none: #7b8494;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 16px; margin-bottom: 12px; }
h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 18px 0 10px; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- lateral */
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 14px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.brand { font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; padding: 0 10px; letter-spacing: -.01em; }
.brand span { color: var(--muted); font-weight: 500; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a {
  padding: 9px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-weight: 500;
}
#nav a:hover { background: var(--surface-2); color: var(--text); }
#nav a[aria-current] { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.mini {
  display: block; padding: 10px; border-radius: 8px; text-align: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  text-decoration: none; font-variant-numeric: tabular-nums;
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.side-foot p { font-size: 12px; color: var(--muted); padding: 0 4px 4px; }

/* ---------- conteúdo */
main { padding: 32px clamp(16px, 4vw, 44px) 64px; max-width: 1180px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { color: var(--muted); margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  margin-bottom: 16px; min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2, .card-head .hint { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols.wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid .card { margin: 0; }
.grow { flex: 1; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { box-shadow: inset 0 3px 0 var(--k, transparent); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile-label, .tile-sub { font-size: 12.5px; color: var(--muted); }
.tile strong { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- botões */
.btn {
  border: 1px solid transparent; border-radius: 9px; padding: 8px 14px;
  font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.lg { padding: 12px 26px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- listas */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.list .row:first-child { border-top: 0; }
.row-main {
  flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.row-title { font-weight: 500; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; }
.row-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); }
.row.done .row-title { color: var(--muted); text-decoration: line-through; }
.row.habit.done .row-title { text-decoration: none; }
.ev-time { font-size: 12.5px; color: var(--muted); min-width: 92px; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 10px 0; }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

.check {
  flex: none; width: 22px; height: 22px; border-radius: 7px; padding: 0;
  border: 2px solid var(--muted); background: transparent; position: relative;
}
.check:hover { border-color: var(--accent); }
.check.on { background: var(--c, var(--good)); border-color: var(--c, var(--good)); }
.check.on::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid var(--surface); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.check.off { border-style: dashed; opacity: .3; display: inline-block; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2); border-radius: 999px; padding: 2px 9px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.chip.hi { color: var(--warn); }
.chip.late { color: var(--bad); }
.chip.ok { color: var(--good); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.lg { width: 14px; height: 14px; }
.dot.ev { background: var(--accent); }
.dot.task { background: var(--warn); }
.dot.g { background: var(--c-green); }

.quick { display: flex; gap: 8px; margin-bottom: 8px; }
.quick input { flex: 1; min-width: 0; }
.quick[data-form=event-quick] { flex-wrap: wrap; }
.quick[data-form=event-quick] input[name=title] { flex: 1 1 150px; }
.quick input[type=time] { flex: none; width: 112px !important; }
.notes { flex-basis: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.row-meta .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
h3.first { margin-top: 4px; }

input:not([type=checkbox]):not([type=range]), select, textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 11px; width: 100%;
}
input:disabled, select:disabled { opacity: .55; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs.sm { margin: 0; }
.tabs button {
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  padding: 6px 13px; color: var(--muted); font-weight: 500;
}
.tabs button span { opacity: .7; font-size: 12px; margin-left: 2px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected=true] { background: var(--surface); border-color: var(--border); color: var(--text); }
.tabs.sm button[aria-selected=true] { background: var(--surface-2); }

/* ---------- hábitos (cartões com cérebro) */
.habits-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); align-items: start; }
.habit-card { display: flex; flex-direction: column; gap: 14px; box-shadow: inset 0 3px 0 var(--c); }
.habit-top { display: flex; gap: 16px; align-items: center; }
.habit-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.habit-name { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.habit-name h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.habit-pct { color: var(--muted); font-size: 13.5px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.habit-pct strong { font-size: 26px; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.habit-bar { font-size: 12.5px; color: var(--muted); }
.habit-bar strong { color: var(--text); }
.habit-bar .progress { height: 6px; margin: 4px 0 0; }
.habit-bar .progress i { background: var(--c); }

.brain { flex: none; overflow: visible; }
.brain-bg { fill: var(--surface-2); }
.brain-fill { fill: var(--c); }
.brain-fold { fill: none; stroke: var(--text); stroke-opacity: .32; stroke-width: 2; stroke-linecap: round; }
.brain-line { fill: none; stroke: var(--text); stroke-opacity: .6; stroke-width: 2.5; stroke-linejoin: round; }
.brain.full { filter: drop-shadow(0 0 7px var(--c)); }
.brain.brain-sm .brain-fold { display: none; }
.brain.brain-sm .brain-line { stroke-width: 5; }

.habit-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hw {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0;
  background: var(--bg); border: 2px solid var(--border); border-radius: 10px; font-size: 11px; color: var(--muted);
}
.hw b { font-size: 15px; color: var(--text); }
.hw:hover { border-color: var(--c); }
.hw.on { border-color: var(--c); background: color-mix(in oklab, var(--c) 26%, var(--surface)); color: var(--text); }
.hw.on b::after { content: " ✓"; font-size: 11px; }
.hw.off { border-style: dashed; opacity: .55; }
.hw.today { box-shadow: 0 0 0 2px color-mix(in oklab, var(--text) 30%, transparent); }
.habit-do { width: 100%; padding: 11px; border: 2px solid var(--c); background: color-mix(in oklab, var(--c) 14%, var(--surface)); color: var(--text); white-space: normal; }
.habit-do:hover { background: color-mix(in oklab, var(--c) 26%, var(--surface)); }
.habit-do.done { background: color-mix(in oklab, var(--c) 34%, var(--surface)); }
.habit-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; color: var(--muted); }
.habit-foot strong { color: var(--text); font-variant-numeric: tabular-nums; }
.habit-foot .link { margin-left: auto; }
.habit-history .hint { margin: 6px 0 0; }
.hday { display: block; width: var(--hs); height: var(--hs); padding: 0; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); position: relative; }
.hday.on { background: var(--c); border-color: var(--c); }
.hday.off:not(.on) { border-style: dashed; background: transparent; }
.hday.future { visibility: hidden; border: 0; }
.hday:hover { outline: 2px solid var(--text); outline-offset: 1px; z-index: 2; }

/* ---------- pop-up de detalhes do evento */
.detail h2 { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.detail dl { margin: 0; }
.detail dl > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.detail dt { color: var(--muted); font-size: 13px; }
.detail dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.detail-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- metas e projetos */
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 12px 0 10px; display: block; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.goal-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.goal-foot strong { color: var(--text); }
.steps { display: flex; gap: 6px; }
.proj { text-align: left; display: flex; flex-direction: column; gap: 8px; width: 100%; box-shadow: inset 0 3px 0 var(--k); }
.proj .progress { margin: 0; }
.proj .progress i { background: var(--k); }
.proj-hours { color: var(--muted); font-size: 13px; }
.proj-hours strong { color: var(--text); font-size: 22px; letter-spacing: -.02em; margin-right: 4px; }
.proj:hover { border-color: var(--accent); }

/* ---------- agenda */
.cal-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-bar strong { min-width: 130px; text-align: center; }
.cal-dow, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 4px; }
.cal-cell {
  min-height: 78px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 5px; text-align: left; display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.cal-cell.out { opacity: .4; }
.cal-cell.today .cal-num { background: var(--accent); color: var(--accent-ink); }
.cal-cell.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-num { font-size: 12.5px; font-weight: 600; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.cal-item {
  font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  padding: 1px 5px; border-radius: 4px; background: var(--surface-2); border-left: 3px solid var(--c, var(--accent));
}
.cal-item.task { border-left: 3px dotted var(--warn); }
.cal-item.g { border-left-color: var(--c-green); }
.cal-item.g::before { content: "G "; font-weight: 700; color: var(--c-green); }
.gcal-status { font-size: 13px; color: var(--muted); margin-top: 10px; }
.gcal-status.warn { color: var(--warn); }
a.row-main { color: inherit; text-decoration: none; }
a.row-main:hover .row-title { text-decoration: underline; }
.cal-more { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- foco */
.focus { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.focus .field { width: 100%; }
.ring { position: relative; width: min(260px, 70vw); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.ring.break .ring-fg { stroke: var(--good); }
.ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.ring-in strong { font-size: 52px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.phase { color: var(--muted); font-size: 13.5px; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field.two > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-btn { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-weight: 500; }
.chip-btn.on { border-color: var(--accent); color: var(--accent); }
.chip-btn:disabled { opacity: .5; cursor: not-allowed; }
.custom { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.custom input { width: 68px !important; padding: 6px 8px !important; }

.waves { display: grid; gap: 8px; margin-bottom: 14px; }
.wave {
  text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
}
.wave span { font-size: 12.5px; color: var(--muted); }
.wave.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.switch { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; cursor: pointer; }
.switch input, .days input { accent-color: var(--accent); width: 17px; height: 17px; }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* ---------- gráfico */
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 26px 0 28px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; color: var(--muted); text-align: right; height: 180px; }
.chart-y span { transform: translateY(-50%); }
.chart-y span:last-child { transform: translateY(50%); }
.chart-plot {
  height: 180px; display: flex; align-items: flex-end; gap: 2px; position: relative;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(var(--border), var(--border)) 0 0 / 100% 1px no-repeat,
              linear-gradient(var(--border), var(--border)) 0 50% / 100% 1px no-repeat;
}
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; outline-offset: -2px; }
.bar { width: min(26px, 70%); background: var(--bar, var(--accent)); border-radius: 4px 4px 0 0; min-height: 0; }
.bar-col:hover .bar, .bar-col:focus-visible .bar { filter: brightness(1.2); }
.bar-x { position: absolute; top: calc(100% + 6px); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bar-col:hover::after, .bar-col:focus-visible::after, .heat[data-tip]:hover::after, .hday[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600;
  padding: 5px 9px; border-radius: 6px; white-space: pre; text-align: left; line-height: 1.5; z-index: 3; pointer-events: none;
}
.bar-col:nth-child(-n+4)::after { left: 0; transform: none; }
.bar-col:nth-last-child(-n+3)::after { left: auto; right: 0; transform: none; }
.table-view summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.table-view table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; }
.table-view th, .table-view td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--border); }
.table-view th { color: var(--muted); font-weight: 600; border-top: 0; }

/* ---------- painel */
.kpi .progress { margin: 8px 0 6px; }
.kpi .progress i { background: var(--k); }
.link { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; text-align: left; text-decoration: underline dotted; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
.up { color: var(--good); font-weight: 600; }
.down { color: var(--bad); font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.stackbar { width: min(30px, 70%); height: 100%; display: flex; flex-direction: column-reverse; gap: 2px; }
.stackbar i { display: block; flex: none; min-height: 2px; }
.stackbar i:last-child { border-radius: 4px 4px 0 0; }
.bar-col:hover .stackbar, .bar-col:focus-visible .stackbar { filter: brightness(1.15); }
.goal-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); pointer-events: none; z-index: 1; }
.goal-line span { position: absolute; right: 0; bottom: 3px; font-size: 11px; color: var(--muted); background: var(--surface); padding: 0 4px; border-radius: 4px; }
.chart + .legend { margin-top: 0; flex-wrap: wrap; gap: 6px 16px; }
.chart + .empty { padding-top: 0; }

.hbars { display: flex; flex-direction: column; gap: 2px; }
.hbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center;
  background: none; border: 0; padding: 8px 6px; border-radius: 8px; text-align: left; width: 100%;
}
button.hbar:hover { background: var(--surface-2); }
.hbar-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { grid-column: 1 / -1; grid-row: 2; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 999px; }
.hbar-name { font-weight: 500; }
.hbar strong { font-variant-numeric: tabular-nums; font-size: 13.5px; text-align: right; }
.hint.total { margin: 10px 6px 0; }
.hint.total strong { color: var(--text); }

.heat-wrap { --hs: 20px; display: flex; gap: 8px; padding: 4px 0 2px; }
.heat-dow, .heat-grid { display: grid; grid-template-rows: repeat(7, var(--hs)); gap: 3px; }
.heat-dow { font-size: 10.5px; color: var(--muted); line-height: var(--hs); }
.heat-grid { grid-auto-flow: column; grid-auto-columns: var(--hs); }
.heat { display: block; width: var(--hs, 14px); height: var(--hs, 14px); border-radius: 4px; background: var(--surface-2); position: relative; }
.heat.l1 { background: color-mix(in oklab, var(--accent) 30%, var(--surface-2)); }
.heat.l2 { background: color-mix(in oklab, var(--accent) 55%, var(--surface-2)); }
.heat.l3 { background: color-mix(in oklab, var(--accent) 78%, var(--surface-2)); }
.heat.l4 { background: var(--accent); }
.heat.none { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.heat.future { visibility: hidden; }
.heat[data-tip]:hover { outline: 2px solid var(--text); outline-offset: 1px; z-index: 2; }
.heat-legend { align-items: center; gap: 4px; }
.heat-legend span { margin: 0 4px; }

.weekdots { display: flex; gap: 3px; }
.weekdots i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--muted); }
.weekdots i.on { background: var(--c); box-shadow: none; }
.weekdots i.off { box-shadow: none; background: var(--surface-2); }

.mini-goal { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.mini-goal:first-of-type { border-top: 0; padding-top: 0; }
.mini-goal .progress { grid-column: 1 / -1; margin: 0; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { position: relative; cursor: pointer; }
.swatches input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatches i { display: block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 2px transparent; }
.swatches input:checked + i { box-shadow: 0 0 0 2px var(--text); }
.swatches input:focus-visible + i { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- diálogo */
dialog {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  padding: 22px; width: min(500px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto;
}
dialog::backdrop { background: rgb(0 0 0 / .55); }
.form h2 { font-size: 18px; margin-bottom: 16px; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.fields .field { grid-column: 1 / -1; }
.fields .field.half { grid-column: auto; }
.field .hint { margin: 0; font-size: 12.5px; }
.field .switch { margin: 4px 0 0; color: var(--text); font-size: 15px; font-weight: 500; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 18px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text); font-weight: 500; }

.form > p { margin-bottom: 12px; }
.form-msg { min-height: 1.4em; font-size: 13.5px; color: var(--warn); }

/* ---------- celular */
@media (max-width: 860px) {
  body { grid-template-columns: minmax(0, 1fr); padding-bottom: 62px; }
  .side {
    position: fixed; inset: auto 0 0 0; height: auto; z-index: 5;
    flex-direction: column-reverse; gap: 6px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--border);
  }
  .brand, .side-foot, .desk-only { display: none; }
  .sync-on .side-foot { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; padding: 0 6px; }
  .sync-on .side-foot p { flex: 1; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #nav { flex-direction: row; }
  #nav a { flex: 1; min-width: 0; text-align: center; padding: 10px 0; font-size: 12px; }
  #nav a[aria-current] { box-shadow: inset 0 -3px 0 var(--accent); }
  .mini { padding: 7px 10px; font-size: 13px; }
  main { padding: 20px 16px 40px; }
  .cols, .cols.wide { grid-template-columns: minmax(0, 1fr); }
  .field.two { grid-template-columns: 1fr; }
  .cal-cell { min-height: 54px; align-items: center; flex-direction: row; flex-wrap: wrap; align-content: flex-start; }
  .cal-num { width: 100%; }
  .cal-item, .cal-item.task { font-size: 0; padding: 0; width: 7px; height: 7px; border-radius: 50%; border: 0; background: var(--c, var(--accent)); }
  .cal-item.task { background: var(--warn); }
  .cal-item.g { background: var(--c-green); }
  .bar-col:nth-last-child(even) .bar-x { display: none; }
  .ev-time { min-width: 64px; }
  .heat-wrap { --hs: 16px; }
  .weekdots { display: none; }
  .habit-top { align-items: flex-start; }
  .habit-top .brain { width: 84px; height: 70px; }
  .detail dl > div { grid-template-columns: 84px minmax(0, 1fr); }
}
