/* =========================================================================
   3 Blocos - design system
   Clareza, calma, controle, foco, maturidade, simplicidade (spec §43).
   A cor da categoria e um sinal, nunca o cenario (spec §16).
   ========================================================================= */

:root {
  color-scheme: light;

  --bg:            #F6F5F2;
  --surface:       #FFFFFF;
  --surface-2:     #F1EFEA;
  --surface-sunk:  #EDEBE6;
  --ink:           #16140F;
  --ink-2:         #4A463E;
  --ink-3:         #7C776C;
  --ink-4:         #A5A096;
  --line:          rgba(22, 20, 15, .10);
  --line-strong:   rgba(22, 20, 15, .18);

  --focus-bg:      #16140F;   /* card AGORA */
  --focus-ink:     #FBFAF7;
  --focus-ink-2:   rgba(251, 250, 247, .62);
  --focus-line:    rgba(251, 250, 247, .16);

  --accent:        #16140F;
  --danger:        #B3261E;
  --ok:            #2E7D5B;

  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 26px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  --shadow-card: 0 1px 2px rgba(22,20,15,.04);
  --shadow-lift: 0 8px 30px rgba(22,20,15,.12);
  --nav-h: 68px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #0E0D0B;
  --surface:       #171613;
  --surface-2:     #1F1D19;
  --surface-sunk:  #131211;
  --ink:           #F4F2ED;
  --ink-2:         #BFBAB0;
  --ink-3:         #8C877D;
  --ink-4:         #6A655C;
  --line:          rgba(244, 242, 237, .10);
  --line-strong:   rgba(244, 242, 237, .20);

  --focus-bg:      #232019;
  --focus-ink:     #F8F6F1;
  --focus-ink-2:   rgba(248, 246, 241, .60);
  --focus-line:    rgba(248, 246, 241, .14);

  --accent:        #F4F2ED;
  --danger:        #E0685F;
  --ok:            #5FB98F;
  --shadow-card: none;
  --shadow-lift: 0 12px 40px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- tipografia */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
}
.h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.h2 { font-size: 19px; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny  { font-size: 12px; }

/* ------------------------------------------------------------------ shell */
#app { min-height: 100%; }
.shell { display: block; }
.main {
  max-width: 640px; margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px calc(var(--nav-h) + 42px);
}
.sidebar, .aside { display: none; }

/* --------------------------------------------------------------- cabecalho */
.topbar { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.topbar-main { flex: 1; min-width: 0; }
.topbar .h1 { line-height: 1.15; }
.topbar-date { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.topbar-meta { color: var(--ink-2); font-size: 14px; margin-top: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--surface); flex: none;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }

/* ==================================================== CARD AGORA (§6, §41) */
.now {
  background: var(--focus-bg); color: var(--focus-ink);
  border-radius: var(--r-xl); padding: 22px 22px 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-lift);
  animation: rise .32s cubic-bezier(.2,.7,.3,1);
}
.now::before {                       /* faixa da categoria: sinal discreto */
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--cat, transparent);
}
.now-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.now .eyebrow { color: var(--focus-ink-2); }
.now-title {
  font-size: 32px; line-height: 1.1; font-weight: 700;
  letter-spacing: -.025em; margin: 12px 0 6px; overflow-wrap: anywhere;
}
.now-time { font-size: 17px; color: var(--focus-ink-2); font-weight: 500; }
.now-desc { margin-top: 10px; color: var(--focus-ink-2); font-size: 14px; }
.now-cat {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 14px; font-size: 13px; color: var(--focus-ink-2);
}
.now-remaining {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-top: 20px;
}
.now-remaining b { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.track {
  height: 6px; border-radius: 99px; background: var(--focus-line);
  margin-top: 10px; overflow: hidden;
}
.track > i {
  display: block; height: 100%; border-radius: 99px;
  background: var(--cat, var(--focus-ink));
  transition: width .6s cubic-bezier(.3,.8,.3,1);
}
.now-actions { display: flex; gap: 10px; margin-top: 20px; }

/* estado livre / encerrado */
.now.is-idle { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.now.is-idle .eyebrow, .now.is-idle .now-time, .now.is-idle .now-desc { color: var(--ink-3); }
.now.is-idle .now-title { font-size: 27px; }

/* --------------------------------------------------------------- botoes */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  border: 1px solid transparent; transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.975); }
.btn-primary { background: var(--focus-ink); color: var(--focus-bg); }
.now.is-idle .btn-primary, .btn-dark { background: var(--ink); color: var(--bg); }
.btn-ghost { border-color: var(--focus-line); color: var(--focus-ink); }
.now.is-idle .btn-ghost, .btn-outline { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-danger { color: var(--danger); border-color: var(--line-strong); background: var(--surface); }
.btn:disabled { opacity: .45; pointer-events: none; }

/* ---------------------------------------------------- cards secundarios */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-card);
}
.section { margin-top: 18px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}

/* PRÓXIMA (§8) */
.next { display: flex; align-items: flex-start; gap: 14px; }
.next-time {
  font-size: 22px; font-weight: 700; letter-spacing: -.03em;
  min-width: 66px; padding-top: 1px;
}
.next-body { flex: 1; min-width: 0; }
.next-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.next-meta { color: var(--ink-3); font-size: 13.5px; margin-top: 3px; }
.next-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  padding: 12px 0; min-height: 44px;   /* alvo de toque confortavel (§58) */
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.after-line {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}

/* ATRASADA (§10) */
.late-card { border-color: var(--line-strong); background: var(--surface); }
.late-card .eyebrow { color: var(--danger); }
.late-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* --------------------------------------------------- blocos do dia (§13) */
.block { margin-top: 22px; }
.block-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 0 2px 8px; border-bottom: 1px solid var(--line);
}
.block-head .eyebrow { flex: 1; color: var(--ink-2); }
.block-count { font-size: 12px; color: var(--ink-4); }
.rows { display: flex; flex-direction: column; }

.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 4px; border-bottom: 1px solid var(--line);
  text-align: left; width: 100%; transition: background .15s ease;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--surface-2); }
.row-check {
  width: 22px; height: 22px; border-radius: 50%; flex: none; position: relative;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center;
  color: transparent; transition: all .18s ease;
}
/* area de toque de 44px sem aumentar o circulo (§58) */
.row-check::after { content: ''; position: absolute; inset: -11px; border-radius: 50%; }
.row-check:hover { border-color: var(--ink-3); }
.row.is-done .row-check { background: var(--ink-3); border-color: var(--ink-3); color: var(--bg); }
.row-time { font-size: 14px; font-weight: 600; min-width: 46px; color: var(--ink-2); }
.row-body { flex: 1; min-width: 0; }
.row-title {
  font-size: 15px; font-weight: 500; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.row-sub { font-size: 12px; color: var(--ink-4); margin-top: 1px; }
.row-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--cat, var(--ink-4)); }

.row.is-done .row-title { color: var(--ink-4); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.row.is-done .row-time, .row.is-done .row-dot { opacity: .45; }
.row.is-current {
  background: var(--surface); border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1.5px var(--ink); padding-left: 12px; padding-right: 12px;
  border-bottom-color: transparent;
}
.row.is-current .row-title { font-weight: 650; }
.row.is-late .row-time { color: var(--danger); }

.badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 99px;
  border: 1px solid var(--line-strong); color: var(--ink-3); vertical-align: middle;
}
.badge-late { color: var(--danger); border-color: currentColor; }
.badge-now { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.empty-block { padding: 14px 4px; color: var(--ink-4); font-size: 13.5px; }

/* ------------------------------------------------------- resumo do dia */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.summary-cell { background: var(--surface-2); border-radius: var(--r-md); padding: 12px; }
.summary-cell b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.summary-cell span { font-size: 11.5px; color: var(--ink-3); }

/* --------------------------------------------------------- navegacao */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--ink-4); font-size: 10.5px; font-weight: 600; height: 100%;
  justify-content: center; letter-spacing: -.01em;
}
.nav-item.is-active { color: var(--ink); }
.nav-fab {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center; box-shadow: var(--shadow-lift);
  transition: transform .14s ease;
}
.nav-fab:active { transform: scale(.92); }

/* ------------------------------------------------------- bottom sheet */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(10,9,8,.42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease; backdrop-filter: blur(2px);
}
.sheet {
  background: var(--surface); width: 100%; max-width: 560px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 92vh; overflow-y: auto;
  animation: slide-up .28s cubic-bezier(.2,.75,.3,1);
}
.sheet-grip {
  width: 40px; height: 4px; border-radius: 99px; background: var(--line-strong);
  margin: 4px auto 14px;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.sheet-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 12px; border-radius: var(--r-md); background: var(--surface-2);
  font-size: 15px; font-weight: 500; text-align: left;
}
.sheet-row:hover { background: var(--surface-sunk); }
.sheet-row.is-danger { color: var(--danger); }
.sheet-row span:last-child { margin-left: auto; color: var(--ink-4); font-size: 13px; font-weight: 400; }

/* ------------------------------------------------------------ formulario */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: var(--r-md); font-size: 16px; /* 16px evita zoom no iOS */
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--ink); background: var(--surface);
}
.textarea { min-height: 78px; resize: vertical; }
.select { appearance: none; background-image: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 550;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent;
  min-height: 42px; display: inline-flex; align-items: center; gap: 7px;
}
.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-cat.is-on { background: var(--cat); border-color: var(--cat); color: #fff; }
.chip-day {
  width: 42px; padding: 0; justify-content: center;
  border-radius: 50%; height: 42px;
}
.form-error {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger); padding: 11px 14px; border-radius: var(--r-md);
  font-size: 14px; margin-bottom: 14px;
}

/* ------------------------------------------------------------ calendario */
.seg {
  display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px;
}
.seg button {
  padding: 8px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-3);
}
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }

.cal-nav { display: flex; align-items: center; gap: 6px; }
.week-list { display: flex; flex-direction: column; gap: 8px; }
.day-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 14px 16px;
}
.day-card.is-today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.day-card-date { min-width: 46px; }
.day-card-date b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.day-card-date span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.day-card-body { flex: 1; min-width: 0; }
.block-counts { display: flex; gap: 12px; font-size: 12.5px; color: var(--ink-3); }
.block-counts b { color: var(--ink-2); font-weight: 650; }
.dots { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }

.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month-head {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin-bottom: 8px; text-align: center;
}
.month-head span { font-size: 11px; color: var(--ink-4); font-weight: 600; }
.month-cell {
  aspect-ratio: 1 / 1.15; border-radius: var(--r-sm); background: var(--surface);
  border: 1px solid var(--line); padding: 5px 4px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 13px; position: relative;
}
.month-cell.is-out { opacity: .32; }
.month-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.month-cell b { font-weight: 600; font-size: 13px; }
.month-cell .dots { margin-top: 0; justify-content: center; gap: 2.5px; }
.month-cell .dots i { width: 5px; height: 5px; }
.month-ring {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 99px; background: var(--surface-sunk);
  overflow: hidden;
}
.month-ring i { display: block; height: 100%; background: var(--ok); }

/* --------------------------------------------------------- relatorio */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px;
}
.stat b { display: block; font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--ink-3); }
.stat small { display: block; font-size: 12px; color: var(--ink-4); margin-top: 4px; }

.bar-row { margin-bottom: 15px; }
.bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; }
.bar-head b { font-weight: 600; }
.bar-head span { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bar {
  height: 9px; border-radius: 99px; background: var(--surface-sunk);
  margin-top: 7px; position: relative; overflow: hidden;
}
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--cat, var(--ink-3)); }
.bar u {                                   /* marca do planejado */
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--ink-2); opacity: .4;
}
.legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--ink-4); margin-top: 4px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--ink-3); margin-right: 5px; }

.streak {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px;
}
.streak-n { font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.alert-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 0;
  border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2);
}
.alert-row:last-child { border-bottom: none; }
.alert-row i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }

/* ---------------------------------------------------------- modo foco */
.focus-screen {
  position: fixed; inset: 0; z-index: 80; background: var(--focus-bg);
  color: var(--focus-ink); display: flex; flex-direction: column;
  padding: max(24px, env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom));
  animation: fade .25s ease;
}
.focus-top { display: flex; justify-content: space-between; align-items: center; }
.focus-top .icon-btn { background: transparent; border-color: var(--focus-line); color: var(--focus-ink-2); }
.focus-body { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 10px; }
.focus-title { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.12; }
.focus-timer { font-size: 68px; font-weight: 300; letter-spacing: -.04em; line-height: 1; margin: 10px 0; font-variant-numeric: tabular-nums; }
.focus-sub { color: var(--focus-ink-2); font-size: 15px; }
.focus-actions { display: flex; flex-direction: column; gap: 10px; }
.focus-actions .row-of { display: flex; gap: 10px; }
.focus-actions .row-of .btn { flex: 1; }

/* ------------------------------------------------------------- login */
.auth-wrap {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center;
  justify-content: center; padding: 24px;
}
.auth-card { width: 100%; max-width: 400px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.brand-mark { display: flex; gap: 3px; align-items: flex-end; height: 26px; }
.brand-mark i { width: 7px; border-radius: 2px; background: var(--ink); display: block; }
.brand-mark i:nth-child(1) { height: 12px; opacity: .35; }
.brand-mark i:nth-child(2) { height: 19px; opacity: .6; }
.brand-mark i:nth-child(3) { height: 26px; }
.brand b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--ink-3); }
.auth-switch button { font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.demo-hint {
  margin-top: 18px; padding: 12px 14px; background: var(--surface-2);
  border-radius: var(--r-md); font-size: 12.5px; color: var(--ink-3); line-height: 1.5;
}

/* ------------------------------------------------------------- toast */
.toast-host {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 16px;
}
.toast {
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 550; box-shadow: var(--shadow-lift);
  animation: rise .26s cubic-bezier(.2,.7,.3,1); max-width: 100%;
}

/* --------------------------------------------------------- utilitarios */
.list-plain { list-style: none; margin: 0; padding: 0; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.stack > * + * { margin-top: 10px; }
.center { text-align: center; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%; margin: 60px auto;
  border: 2px solid var(--line-strong); border-top-color: var(--ink);
  animation: spin .7s linear infinite;
}
.switch {
  width: 46px; height: 28px; border-radius: 99px; background: var(--surface-sunk);
  position: relative; flex: none; transition: background .2s ease;
  border: 1px solid var(--line);
}
.switch i {
  position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-card);
  transition: transform .2s cubic-bezier(.3,.8,.3,1);
}
.switch.is-on { background: var(--ok); border-color: transparent; }
.switch.is-on i { transform: translateX(18px); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 50% { transform: scale(1.14); } }
.did-complete { animation: pop .34s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =============================================================== DESKTOP */
@media (min-width: 900px) {
  .shell {
    display: grid; grid-template-columns: 232px minmax(0, 1fr);
    max-width: 1240px; margin: 0 auto; min-height: 100vh;
  }
  /* largura de leitura confortavel: os cards nao se esticam sem necessidade */
  .main { max-width: 720px; margin: 0 auto; padding: 40px 40px 60px; }
  .nav { display: none; }
  .toast-host { bottom: 28px; }

  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    padding: 34px 18px; border-right: 1px solid var(--line);
    position: sticky; top: 0; height: 100vh;
  }
  .side-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px;
    border-radius: var(--r-md); color: var(--ink-3); font-size: 14.5px; font-weight: 550;
    width: 100%; text-align: left;
  }
  .side-item:hover { background: var(--surface-2); color: var(--ink); }
  .side-item.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
  .side-cta { margin-top: 16px; }
  .side-foot { margin-top: auto; }
}

@media (min-width: 1180px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr) 296px; max-width: 1400px; }
  .aside {
    display: block; padding: 40px 28px 40px 0;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
  }
  .aside-inner { border-left: 1px solid var(--line); padding-left: 28px; height: 100%; }
  /* no desktop com painel lateral, a Home usa duas colunas de conteudo */
  .home-cols { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; }
}
