/* Central — estilo true-black-flat (taste skill, seed 1385244877), shell ruled-t-frame.
   Layout: menu lateral 210px (64px recolhido) + barra superior 64px, divididos só por réguas de 1px;
   canvas fluido com calha de 29px; uma calha de 14px na horizontal e na vertical; grade de 12 colunas.
   Face: chão quente de casa (#0e0d0c) e um único matiz de dado, o âmbar do sol de Cuiabá.
   Elevação só por luminosidade: chão -> card -> painel aninhado. Sem sombra em nada parado.
   Movimento: só transform e opacity, uma curva (--ease). --move zera o deslocamento. */

/* ---------- tokens: escuro primeiro ---------- */
:root {
  color-scheme: dark;
  --ground: #0e0d0c;
  --surface: #181716;
  --raised: #2a2826;
  --active: #22201e;
  --border: #23211f;
  --rule: #1f1d1b;
  --control: #4a4642;
  --field: #121110;
  --dash: #34312e;
  --text: #f5f5f4;
  --muted: #b4b0aa;
  --faint: #99948d;
  --nav-idle: #bdb8b1;
  --primary: #f5f5f4;
  --primary-ink: #0e0d0c;
  --accent: #f2b33d;
  --accent-ink: #f2b33d;
  --accent-soft: #3a2c10;
  --positive: #3fc07a;
  --negative: #e5566f;
  --pill-positive-bg: #172a1d; --pill-positive-ink: #5fd393;
  --pill-negative-bg: #2c1a20; --pill-negative-ink: #f07b8f;
  --pill-warning-bg: #2b2414; --pill-warning-ink: #e9b65a;
  --pill-neutral-bg: #2a2826; --pill-neutral-ink: #f5f5f4;
  --scrim: rgba(0, 0, 0, 0.62);
  --float-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
  --lift-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  --focus: #f5f5f4;
  /* charts.js */
  --chart-1: var(--accent); --chart-2: #e6e2dc; --chart-3: #6b6762; --chart-muted: #4d4945;
  --chart-mark: var(--text); --chart-span: 0.12; --chart-track: #2a2826;
  --grid: #2b2927; --axis-ink: var(--faint); --ink: var(--text);
  /* etiquetas: fundo / tinta */
  --lab-verde-bg: #18301f; --lab-verde-ink: #7ad79f;
  --lab-ambar-bg: #33280f; --lab-ambar-ink: #f2c063;
  --lab-laranja-bg: #36200f; --lab-laranja-ink: #f39a5b;
  --lab-vermelho-bg: #3a1a1d; --lab-vermelho-ink: #f2808c;
  --lab-rosa-bg: #361a2a; --lab-rosa-ink: #ef8fbf;
  --lab-azul-bg: #142636; --lab-azul-ink: #7fb8ec;
  --lab-ciano-bg: #10302f; --lab-ciano-ink: #6fd1c8;
  --lab-cinza-bg: #2a2826; --lab-cinza-ink: #d6d1ca;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-greet: 28px; --fs-title: 20px; --fs-section: 16px; --fs-kpi: 24px; --fs-body: 14px; --fs-small: 12px;
  --sbw: 210px; --sbw-closed: 64px; --top: 64px;
  --pad: 29px; --gap: 14px; --card-pad: 22px;
  --radius-card: 20px; --radius-inner: 12px; --radius-chip: 8px; --radius-control: 999px;
  --control-height: 36px; --nav-row: 32px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-press: 120ms; --t-ui: 160ms; --t-page: 200ms; --t-win: 260ms;
  --move: 1;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --ground: #f3f2ef; --surface: #ffffff; --raised: #ebe9e5; --active: #e6e4e0;
    --border: #e2dfda; --rule: #ece9e5; --control: #c9c5bf; --field: #ffffff; --dash: #d3cfc9;
    --text: #171614; --muted: #57534e; --faint: #69655f; --nav-idle: #5c5852;
    --primary: #171614; --primary-ink: #ffffff;
    --accent: #c4840a; --accent-ink: #8a5a00; --accent-soft: #fbecc8;
    --positive: #247b50; --negative: #c4242a;
    --pill-positive-bg: #dcfae5; --pill-positive-ink: #0f4d2b;
    --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
    --pill-warning-bg: #fff4dc; --pill-warning-ink: #84500a;
    --pill-neutral-bg: #ebe9e5; --pill-neutral-ink: #171614;
    --scrim: rgba(23, 22, 20, 0.34);
    --float-shadow: 0 18px 48px rgba(23, 22, 20, 0.18), 0 2px 8px rgba(23, 22, 20, 0.1);
    --lift-shadow: 0 14px 34px rgba(23, 22, 20, 0.2);
    --focus: #171614;
    --chart-2: #3a3734; --chart-3: #a19c95; --chart-muted: #d3cfc9; --chart-span: 0.06; --chart-track: #e6e3df;
    --grid: #e7e4e0;
    --lab-verde-bg: #dcf3e3; --lab-verde-ink: #1d5c35;
    --lab-ambar-bg: #fbeccb; --lab-ambar-ink: #7a4f00;
    --lab-laranja-bg: #fde3cf; --lab-laranja-ink: #8a3c0a;
    --lab-vermelho-bg: #fde0e1; --lab-vermelho-ink: #8f1d27;
    --lab-rosa-bg: #fbe0ee; --lab-rosa-ink: #8a1f57;
    --lab-azul-bg: #dceaf8; --lab-azul-ink: #1d4f80;
    --lab-ciano-bg: #d5f1ee; --lab-ciano-ink: #12584f;
    --lab-cinza-bg: #e9e7e3; --lab-cinza-ink: #3d3a36;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #f3f2ef; --surface: #ffffff; --raised: #ebe9e5; --active: #e6e4e0;
  --border: #e2dfda; --rule: #ece9e5; --control: #c9c5bf; --field: #ffffff; --dash: #d3cfc9;
  --text: #171614; --muted: #57534e; --faint: #69655f; --nav-idle: #5c5852;
  --primary: #171614; --primary-ink: #ffffff;
  --accent: #c4840a; --accent-ink: #8a5a00; --accent-soft: #fbecc8;
  --positive: #247b50; --negative: #c4242a;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #0f4d2b;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fff4dc; --pill-warning-ink: #84500a;
  --pill-neutral-bg: #ebe9e5; --pill-neutral-ink: #171614;
  --scrim: rgba(23, 22, 20, 0.34);
  --float-shadow: 0 18px 48px rgba(23, 22, 20, 0.18), 0 2px 8px rgba(23, 22, 20, 0.1);
  --lift-shadow: 0 14px 34px rgba(23, 22, 20, 0.2);
  --focus: #171614;
  --chart-2: #3a3734; --chart-3: #a19c95; --chart-muted: #d3cfc9; --chart-span: 0.06; --chart-track: #e6e3df;
  --grid: #e7e4e0;
  --lab-verde-bg: #dcf3e3; --lab-verde-ink: #1d5c35;
  --lab-ambar-bg: #fbeccb; --lab-ambar-ink: #7a4f00;
  --lab-laranja-bg: #fde3cf; --lab-laranja-ink: #8a3c0a;
  --lab-vermelho-bg: #fde0e1; --lab-vermelho-ink: #8f1d27;
  --lab-rosa-bg: #fbe0ee; --lab-rosa-ink: #8a1f57;
  --lab-azul-bg: #dceaf8; --lab-azul-ink: #1d4f80;
  --lab-ciano-bg: #d5f1ee; --lab-ciano-ink: #12584f;
  --lab-cinza-bg: #e9e7e3; --lab-cinza-ink: #3d3a36;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-reduced-motion: reduce) { :root { --move: 0; } }
:root.reduce-motion { --move: 0; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--text);
  font: 400 var(--fs-body)/20px var(--font); -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num, time, .kpi { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: var(--fs-small); line-height: 16px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 14px; height: 14px; }
kbd { font: 500 11px/16px var(--font); padding: 1px 6px; border-radius: 6px; background: var(--raised); color: var(--muted); }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--sbw) minmax(0, 1fr); height: 100%; }
.app.collapsed { grid-template-columns: var(--sbw-closed) minmax(0, 1fr); }
.sidebar {
  display: flex; flex-direction: column; gap: 18px; min-height: 0; overflow: hidden auto;
  padding: 14px 10px 14px; border-right: 1px solid var(--border); background: var(--ground);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 9px; }
.brand svg { width: 24px; height: 24px; flex: none; }
.brand b { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.nav { display: grid; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; height: var(--nav-row);
  padding: 0 11px; border-radius: 10px; color: var(--nav-idle); white-space: nowrap;
  
}
.nav-item:hover { background: var(--active); color: var(--text); }
.nav-item[aria-current="page"] { color: var(--text); font-weight: 500; }
.nav-item:active { transform: scale(calc(1 - 0.02 * var(--move))); }
.nav-label { transition: opacity var(--t-ui) var(--ease); }
.sidebar .bottom { margin-top: auto; display: grid; gap: 2px; }
.collapse-btn { color: var(--faint); }
.app.collapsed .nav-label, .app.collapsed .brand b { opacity: 0; pointer-events: none; }
.app.collapsed .collapse-btn svg { transform: scaleX(-1); }
.tip {
  position: fixed; z-index: 230; padding: 5px 10px; border-radius: 8px; background: var(--raised); color: var(--text);
  font-size: 12px; line-height: 16px; pointer-events: none; box-shadow: var(--float-shadow); /* taste-skill-ignore: flutua */
  opacity: 0; transform: translateX(calc(-4px * var(--move))); transition: opacity var(--t-ui) var(--ease), transform var(--t-ui) var(--ease);
}
.tip.on { opacity: 1; transform: none; }

.main { position: relative; display: grid; grid-template-rows: var(--top) minmax(0, 1fr); min-width: 0; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 0 var(--pad); border-bottom: 1px solid var(--border);
  background: var(--ground); min-width: 0; position: relative; z-index: 15;
}
.btn.menu-btn { display: none; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; width: min(440px, 46%); height: var(--control-height); padding: 0 8px 0 14px;
  border-radius: var(--radius-control); background: var(--surface); color: var(--faint); text-align: left;
  
}
.search-trigger:hover { background: var(--raised); }
.search-trigger span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-spacer { flex: 1; }
.top-right { display: flex; align-items: center; gap: 8px; height: 100%; }
.top-divider { width: 1px; align-self: stretch; background: var(--border); margin: 0 8px; }
.top-now { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.top-now .clock { font-size: 15px; font-weight: 500; }
.top-now .date { color: var(--muted); }
.focus-chip { display: none; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface); color: var(--text); }
.focus-chip.on { display: inline-flex; }
.focus-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.canvas { overflow: auto; min-height: 0; padding: 28px var(--pad) 72px; scroll-padding-top: 16px; }
.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); align-content: start; min-width: 0; }
.view.entering { animation: viewIn var(--t-page) var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(calc(6px * var(--move))); } to { opacity: 1; transform: none; } }

/* ---------- title row ---------- */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.title-row .t { display: grid; gap: 4px; min-width: 0; }
.title-row h1 { font-size: var(--fs-title); line-height: 28px; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.title-row .sub { color: var(--muted); }
.title-row .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.greet h1 { font-size: var(--fs-greet); line-height: 34px; font-weight: 500; letter-spacing: -0.02em; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height);
  padding: 0 16px; border-radius: var(--radius-control); background: var(--raised); color: var(--text);
  font-weight: 500; white-space: nowrap; flex: none;
  transition: transform var(--t-press) var(--ease), opacity var(--t-ui) var(--ease);
}
.btn:hover { background: var(--active); }
.btn:active { transform: scale(calc(1 - 0.03 * var(--move))); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { opacity: 0.88; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--raised); color: var(--text); }
.btn.danger { background: transparent; color: var(--negative); box-shadow: inset 0 0 0 1px currentColor; } /* taste-skill-ignore: contorno de controle, não sombra */
.btn.danger:hover { background: var(--pill-negative-bg); }
.btn.danger.solid { background: var(--negative); color: #fff; box-shadow: none; } /* taste-skill-ignore: contorno de controle, não sombra */
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: var(--control-height); padding: 0; }
.btn.icon.sm { width: 30px; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; background: var(--surface); color: var(--faint); transform: none; opacity: 1; }
.linkbtn { color: var(--muted); font-size: 13px; border-radius: 6px; padding: 2px 4px; margin: -2px -4px;  }
.linkbtn:hover { color: var(--text); }

.field { display: grid; gap: 8px; min-width: 0; align-content: start; }
.field > label, .field > .lbl { font-weight: 500; }
.field .hint { color: var(--faint); font-size: 12px; line-height: 16px; }
.field .err { color: var(--pill-negative-ink); font-size: 12px; line-height: 16px; }
.input, select.input, textarea.input {
  width: 100%; min-width: 0; height: 38px; padding: 0 14px; border-radius: var(--radius-inner);
  background: var(--field); border: 1px solid var(--control); color: var(--text); outline: none;
  
}
textarea.input { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; line-height: 20px; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--muted); }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.input[aria-invalid="true"] { border-color: var(--negative); }
.input.pill { border-radius: var(--radius-control); height: var(--control-height); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.switch { appearance: none; width: 33px; height: 20px; border-radius: 999px; background: var(--control); position: relative; flex: none; cursor: pointer; margin: 0;  }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform var(--t-ui) var(--ease); }
.switch:checked { background: var(--text); }
.switch:checked::after { transform: translateX(13px); background: var(--ground); }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); }
.segmented button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px; border-radius: 999px; color: var(--muted); font-weight: 500;  }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--raised); color: var(--text); }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] { position: relative; height: 40px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); }
.tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); border-radius: 2px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; flex: none; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pill.quiet { background: transparent; color: var(--faint); padding: 0; }
.lab { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lab[data-c="verde"] { background: var(--lab-verde-bg); color: var(--lab-verde-ink); }
.lab[data-c="ambar"] { background: var(--lab-ambar-bg); color: var(--lab-ambar-ink); }
.lab[data-c="laranja"] { background: var(--lab-laranja-bg); color: var(--lab-laranja-ink); }
.lab[data-c="vermelho"] { background: var(--lab-vermelho-bg); color: var(--lab-vermelho-ink); }
.lab[data-c="rosa"] { background: var(--lab-rosa-bg); color: var(--lab-rosa-ink); }
.lab[data-c="azul"] { background: var(--lab-azul-bg); color: var(--lab-azul-ink); }
.lab[data-c="ciano"] { background: var(--lab-ciano-bg); color: var(--lab-ciano-ink); }
.lab[data-c="cinza"] { background: var(--lab-cinza-bg); color: var(--lab-cinza-ink); }

/* a caixa de seleção que se desenha: o traço é revelado por uma tampa que desliza (só transform) */
.check {
  position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--control); transition: transform var(--t-press) var(--ease); /* taste-skill-ignore: contorno de controle, não sombra */
  overflow: hidden;
}
.check:hover { box-shadow: inset 0 0 0 1.5px var(--muted); } /* taste-skill-ignore: contorno de controle, não sombra */
.check:active { transform: scale(calc(1 - 0.08 * var(--move))); }
.check svg { width: 12px; height: 12px; fill: none; stroke: var(--ground); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.check .cover { position: absolute; inset: 0; background: var(--text); transform: translateX(101%); }
.check[aria-checked="true"] { background: var(--text); box-shadow: none; } /* taste-skill-ignore: contorno de controle, não sombra */
.check[aria-checked="true"] svg { opacity: 1; }
.check.draw .cover { animation: drawCheck 280ms var(--ease) both; }
@keyframes drawCheck { from { transform: translateX(0); } to { transform: translateX(101%); } }
.check.sq { border-radius: 6px; }

.progress { position: relative; height: 6px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.progress > i { position: absolute; inset: 0; background: var(--accent); border-radius: inherit; transform-origin: left center; transform: scaleX(0); transition: transform 420ms var(--ease); }

/* ---------- panels ---------- */
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: 1 / -1; }
.stack { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.panel { background: var(--surface); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; display: grid; gap: 14px; align-content: start; }
.panel > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 24px; }
.panel h2 { font-size: var(--fs-section); line-height: 24px; font-weight: 600; }
.panel .meta { color: var(--faint); font-size: 12px; white-space: nowrap; }
.panel.flat { background: transparent; padding: 0; }

.empty {
  display: grid; gap: 10px; justify-items: start; padding: 16px 18px; border-radius: var(--radius-inner);
  border: 1px dashed var(--dash); color: var(--muted); grid-column: 1 / -1;
}
.empty p { max-width: 52ch; }
.empty strong { color: var(--text); font-weight: 500; }
.skel { display: block; border-radius: 6px; background: var(--raised); }
.errbox { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius-inner); background: var(--pill-negative-bg); color: var(--pill-negative-ink); }

/* linhas de lista */
.rows { display: grid; }
.lrow { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 0; border-top: 1px solid var(--rule); min-width: 0; }
.lrow:first-child { border-top: 0; }
.lrow .grow { flex: 1; min-width: 0; }
.lrow .title { display: block; }
.lrow .line2 { display: block; color: var(--faint); font-size: 12px; line-height: 16px; margin-top: 2px; }
.lrow.done .title { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.prio { width: 6px; height: 6px; border-radius: 50%; flex: none; background: transparent; }
.prio[data-p="alta"] { background: var(--negative); }
.prio[data-p="media"] { background: var(--muted); }

/* ---------- overlays ---------- */
/* todo fundo de sobreposição desfoca a página atrás (pedido do usuário); a opacidade faz o desfoque entrar e sair */
.scrim {
  position: fixed; inset: 0; z-index: 60; opacity: 0; transition: opacity var(--t-ui) var(--ease);
  background: color-mix(in srgb, var(--scrim) 70%, transparent);
  -webkit-backdrop-filter: blur(7px) saturate(0.9); backdrop-filter: blur(7px) saturate(0.9); /* taste-skill-ignore: desfoque pedido pelo usuário */
}
.scrim.on { opacity: 1; }
.dialog {
  position: fixed; z-index: 61; left: 50%; top: 50%; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface); border-radius: var(--radius-card);
  box-shadow: var(--float-shadow); transform: translate(-50%, -50%) scale(calc(1 - 0.02 * var(--move))); opacity: 0; /* taste-skill-ignore: flutua */
  transition: opacity var(--t-ui) var(--ease), transform var(--t-ui) var(--ease);
}
.dialog.on { opacity: 1; transform: translate(-50%, -50%); }
.dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dialog.bare .body { padding-top: 20px; }
.dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 8px; }
.dialog > header h2 { font-size: 16px; font-weight: 600; line-height: 24px; }
.dialog .body { overflow: auto; padding: 8px 22px 18px; display: grid; gap: 16px; align-content: start; }
.dialog > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.dialog > footer .left { margin-right: auto; }

.menu {
  position: fixed; z-index: 200; min-width: 200px; max-width: 280px; padding: 6px; border-radius: 14px; background: var(--raised);
  box-shadow: var(--float-shadow); display: grid; gap: 1px; opacity: 0; transform: scale(calc(1 - 0.02 * var(--move))); transform-origin: top left; /* taste-skill-ignore: flutua */
  transition: opacity var(--t-ui) var(--ease), transform var(--t-ui) var(--ease);
}
.menu.on { opacity: 1; transform: none; }
.menu [role="menuitem"] { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 9px; text-align: left; color: var(--text); white-space: nowrap; }
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus-visible { background: var(--active); outline: none; }
.menu [role="menuitem"].danger { color: var(--pill-negative-ink); }
.menu .sep { height: 1px; background: var(--rule); margin: 4px 6px; }
.menu .mlabel { color: var(--faint); font-size: 12px; padding: 6px 10px 2px; }

.toasts { position: fixed; z-index: 210; left: 50%; bottom: 84px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--ground); font-weight: 500; box-shadow: var(--float-shadow); opacity: 0; transform: translateY(calc(8px * var(--move))); transition: opacity var(--t-ui) var(--ease), transform var(--t-ui) var(--ease); } /* taste-skill-ignore: flutua */
.toast.on { opacity: 1; transform: none; }
.toast button { color: inherit; text-decoration: underline; }

/* barra de comandos */
.cmd { top: 14vh; transform: translate(-50%, 0) scale(calc(1 - 0.02 * var(--move))); width: min(600px, calc(100vw - 32px)); grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(560px, 76vh); }
.cmd.on { transform: translate(-50%, 0); }
.cmd .cmd-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 56px; border-bottom: 1px solid var(--rule); }
.cmd .cmd-input input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 16px; }
.cmd .cmd-input input::placeholder { color: var(--faint); }
.cmd .cmd-list { overflow: auto; padding: 6px 8px 10px; }
.cmd .grp { color: var(--faint); font-size: 12px; padding: 10px 10px 4px; }
.cmd .opt { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 6px 10px; border-radius: 10px; cursor: pointer; }
.cmd .opt .k { margin-left: auto; color: var(--faint); font-size: 12px; white-space: nowrap; }
.cmd .opt[aria-selected="true"] { background: var(--raised); }
.cmd .opt .i { color: var(--muted); }
.cmd .cmd-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--rule); color: var(--faint); font-size: 12px; flex-wrap: wrap; }
.cmd mark { background: transparent; color: var(--text); font-weight: 600; }

/* ---------- arrastar ---------- */
.dragging-on, .dragging-on * { cursor: grabbing !important; user-select: none !important; }
.drag-float { position: fixed !important; z-index: 220; margin: 0 !important; pointer-events: none; box-shadow: var(--lift-shadow);  will-change: transform; } /* taste-skill-ignore: flutua */
.drag-ph { visibility: hidden; }
.draggable { touch-action: none; }
.draggable:not(.no-grab) { cursor: grab; }

/* ---------- Início ---------- */
.today-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.today-count { font-size: 32px; line-height: 36px; font-weight: 500; letter-spacing: -0.01em; }
.today-count small { font-size: 14px; color: var(--muted); font-weight: 400; }
.kv { display: grid; grid-template-columns: 1fr auto; row-gap: 8px; column-gap: 12px; }
.kv dt { color: var(--muted); }
.kv dd { text-align: right; font-variant-numeric: tabular-nums; }
.site-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.mini-site { display: grid; gap: 6px; min-width: 0; border-radius: 10px; }
.mini-site .thumb { aspect-ratio: 16 / 10; border-radius: 10px; }
.mini-site .thumb .word { font-size: 16px; }
.thumb.mini .word { font-size: 15px; padding: 0; }
.panel .thumb, .dialog .thumb { background: var(--raised); }
.capture { display: flex; gap: 8px; }
/* ideias recentes: cartões lado a lado que descem de linha quando não cabem */
.idea-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); grid-auto-rows: 1fr; gap: 12px; }
.idea-tile {
  display: flex; flex-direction: column; gap: 8px; min-height: 140px; min-width: 0; padding: 14px 16px; border-radius: 14px;
  background: var(--raised); text-align: left; transition: transform var(--t-press) var(--ease);
}
.idea-tile:hover { background: var(--active); }
.idea-tile:active { transform: scale(calc(1 - 0.02 * var(--move))); }
.idea-tile .it-meta { color: var(--faint); font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idea-tile .it-title { font-size: 15px; line-height: 21px; font-weight: 500; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.habit-tile { min-height: 124px; cursor: default; }
.habit-tile:hover { background: var(--raised); }
.habit-tile .ht-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.habit-tile .ht-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.habit-tile .habit-grid.ht-week { grid-template-columns: repeat(7, 10px); gap: 3px; }
.habit-tile .ht-week i { width: 10px; height: 10px; background: var(--field); }
.habit-tile .ht-week i.on { background: var(--accent); }
.habit-tile.is-done .it-title { color: var(--muted); }
.task-tile .it-title { text-align: left; border-radius: 6px; }
.task-tile.is-done .it-title { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
/* agenda do dia no Início: lista compacta em ordem, o compromisso de agora ou o próximo em destaque */
.agenda { display: grid; gap: 6px; }
.ag-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; }
.ag-time { display: grid; justify-items: end; font-size: 13px; line-height: 16px; font-weight: 500; }
.ag-time small { color: var(--faint); font-size: 12px; font-weight: 400; }
.ag-blk { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 48px; padding: 6px 12px 6px 15px; border-radius: 10px; background: var(--raised); text-align: left; }
.ag-blk::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--chart-muted); }
.ag-blk:hover { background: var(--active); }
.ag-txt { display: grid; min-width: 0; flex: 1; }
.ag-txt .title { font-weight: 500; }
.ag-txt .line2 { color: var(--faint); font-size: 12px; line-height: 16px; }
.ag-cd { flex: none; font-size: 12px; line-height: 16px; color: var(--accent-ink); white-space: nowrap; }
.ag-row.is-focus .ag-blk { background: var(--accent-soft); }
.ag-row.is-focus .ag-blk::before { background: var(--accent); }
.ag-row.is-past .ag-blk { background: transparent; min-height: 40px; }
.ag-row.is-past .ag-blk::before { background: var(--rule); }
.ag-row.is-past .title, .ag-row.is-past .ag-time { color: var(--faint); }
.ag-row.is-done .title { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.task-tile.is-focus { background: var(--accent-soft); }
.task-tile .ht-foot > .truncate { min-width: 0; flex: 1; }
.ag-note { padding-left: 60px; font-size: 12px; line-height: 16px; color: var(--faint); }
.ag-note .linkbtn { font-size: 12px; }
.ag-now { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; height: 16px; }
.ag-now span { justify-self: end; font-size: 12px; font-weight: 500; color: var(--accent-ink); }
.ag-now i { position: relative; height: 2px; border-radius: 1px; background: var(--accent); }
.ag-now i::before { content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ag-foot { justify-content: space-between; }
/* a agenda divide a linha com o gráfico: o último bloco (rodapé ou estado vazio) desce até o fim do cartão */
#in-today { display: flex; flex-direction: column; }
#in-today > :last-child { margin-top: auto; }
#in-today > .empty:last-child { flex: 1; display: grid; align-content: center; justify-items: start; }
.allday { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.allday-chip { padding: 4px 10px; border-radius: 999px; background: var(--raised); font-size: 13px; line-height: 18px; }
.allday-chip:hover { background: var(--active); }
.chart-tall { grid-template-rows: auto minmax(180px, 1fr) auto; }
.ch-fill { position: relative; min-height: 180px; }
.ch-fill > svg { position: absolute; left: 0; top: 0; }
.idea-tile .it-desc { color: var(--muted); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: auto; }
.note-preview { min-height: 0; overflow: hidden; }
@media (min-width: 1101px) {
  /* a nota acompanha a altura do bloco de Sites e corta o excedente; "Abrir nota" fica no pé */
  #in-note { contain: size; min-height: 280px; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
}
.chart { min-height: 160px; }
.chart-fill { grid-template-rows: auto minmax(0, 1fr) auto; }
.chart-fill .chart { height: 100%; }
.chart-fill .chart > ol { height: 100%; grid-auto-rows: minmax(min-content, 1fr); align-items: center; }
#in-hab .lrow { min-height: 52px; }
.note-others { display: grid; gap: 2px; border-top: 1px solid var(--rule); padding-top: 10px; }
.chart-wrap { display: grid; gap: 10px; }

/* ---------- prévia ao passar o mouse ---------- */
.peek-veil {
  position: fixed; inset: 0; z-index: 56; pointer-events: none; opacity: 0;
  background: color-mix(in srgb, var(--ground) 28%, transparent);
  -webkit-backdrop-filter: blur(7px) saturate(0.9); backdrop-filter: blur(7px) saturate(0.9); /* taste-skill-ignore: desfoque pedido pelo usuário */
  transition: opacity 260ms var(--ease);
}
.peek-veil.on { opacity: 1; }
.peek-ghost { position: fixed !important; z-index: 57 !important; pointer-events: none; opacity: 0; transform: none !important; transition: opacity 180ms var(--ease); box-shadow: 0 0 0 1px var(--control); } /* taste-skill-ignore: contorno, não sombra */
.peek-ghost.on { opacity: 1; }
.peek {
  position: fixed; z-index: 58; width: 320px; max-width: calc(100vw - 24px); display: grid; gap: 12px; padding: 16px 18px 14px;
  border-radius: 16px; background: var(--surface); box-shadow: var(--float-shadow); pointer-events: none; /* taste-skill-ignore: flutua */
  opacity: 0; transform: scale(calc(1 - 0.02 * var(--move))); transition: opacity var(--t-ui) var(--ease), transform var(--t-ui) var(--ease);
}
.peek.on { opacity: 1; transform: none; pointer-events: auto; }
.peek > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.peek > header .pill { margin-top: 1px; }
.peek-meta { color: var(--faint); font-size: 12px; line-height: 16px; margin-top: -6px; }
.peek div > .peek-meta { margin-top: 6px; }
.peek h3 { font-size: 16px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.peek .kv { row-gap: 6px; }
.peek .kv dd { min-width: 0; overflow-wrap: anywhere; }
.peek-note { color: var(--muted); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; padding: 10px 12px; border-radius: 10px; background: var(--raised); }
.peek > footer { color: var(--faint); font-size: 12px; line-height: 16px; }
.peek .peek-md { font-size: 13px; line-height: 20px; max-height: 260px; overflow: hidden; padding: 10px 12px; border-radius: 10px; background: var(--raised); }
.peek-md > * + * { margin-top: 6px; }
.peek .peek-md h1, .peek .peek-md h2, .peek .peek-md h3 { font-size: 14px; line-height: 20px; }
.peek-md .check { width: 16px; height: 16px; pointer-events: none; }
.peek-md .check svg { width: 10px; height: 10px; }
.peek-cover { margin: -2px -4px 0; aspect-ratio: 16 / 9; max-width: none; border-radius: 10px; overflow: hidden; background: var(--raised); }
.peek-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.peek .habit-grid.peek-days { grid-template-columns: repeat(14, 12px); }
.peek > * { min-width: 0; }

/* ---------- Sites ---------- */
.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 22px var(--gap); }
.site-card { display: grid; gap: 8px; min-width: 0; border-radius: 14px; color: inherit; transition: transform var(--t-press) var(--ease); }
.site-card:active { transform: scale(calc(1 - 0.015 * var(--move))); }
.thumb {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; max-width: 100%; border-radius: 14px; overflow: hidden;
  background: var(--surface); transition: transform var(--t-ui) var(--ease), opacity var(--t-ui) var(--ease);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.thumb .word { padding: 12px; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; text-align: center; overflow-wrap: anywhere; color: var(--text); }
.site-card:hover .thumb { opacity: 0.9; }
.site-card .cap { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.site-card .cap span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-card .cap svg { color: var(--faint); }
.drag-float .thumb { opacity: 1; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-inner); background: var(--surface); color: var(--muted); }
.notice b { color: var(--text); font-weight: 500; }

/* janelas */
.wm { position: absolute; left: 0; right: 0; top: var(--top); bottom: 0; z-index: 12; pointer-events: none; }
.wm.has { pointer-events: auto; background: var(--ground); }
.wm.dock-on { bottom: 58px; }
.win {
  position: absolute; display: grid; grid-template-rows: 40px minmax(0, 1fr); background: var(--surface); border-radius: 14px; overflow: hidden;
  transform-origin: 0 0; will-change: transform; pointer-events: auto;
}
.win:focus { outline: none; }
.win.focused { box-shadow: 0 0 0 1px var(--control); } /* taste-skill-ignore: contorno de controle, não sombra */
.win:focus-visible { box-shadow: 0 0 0 2px var(--focus); } /* taste-skill-ignore: contorno de controle, não sombra */
.win[hidden] { display: none !important; }
.win-bar { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 14px; min-width: 0; border-bottom: 1px solid var(--rule); }
.win-bar .wt { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-bar .wb { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); }
.win-bar .wb:hover { background: var(--raised); color: var(--text); }
.win-body { position: relative; background: var(--ground); min-height: 0; }
.win-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.win-msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; background: var(--surface); color: var(--muted); }
.win-msg b { color: var(--text); font-size: 16px; }
.win-loading { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--raised); overflow: hidden; }
.win-loading i { position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: var(--muted); animation: wl 1.1s var(--ease) infinite; }
@keyframes wl { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.dock {
  position: absolute; z-index: 14; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px;
  border-radius: 999px; background: var(--raised); box-shadow: var(--float-shadow); max-width: calc(100% - 32px); overflow-x: auto; /* taste-skill-ignore: flutua */
}
.dock[hidden] { display: none; }
.dock button { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 6px; border-radius: 999px; white-space: nowrap; transition: transform var(--t-press) var(--ease); }
.dock button:hover { background: var(--active); }
.dock button:active { transform: scale(calc(1 - 0.04 * var(--move))); }
.dock .ini { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); font-size: 12px; font-weight: 600; overflow: hidden; }
.dock .ini img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Rotina ---------- */
.timeline { position: relative; height: 560px; overflow: auto; border-radius: var(--radius-inner); background: var(--ground); }
@media (min-width: 1101px) {
  #rt-tl-panel { contain: size; min-height: 520px; grid-template-rows: auto minmax(0, 1fr) auto; }
  #rt-tl-panel .timeline { height: 100%; }
}
.tl-blk.next { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); } /* taste-skill-ignore: marca de dado, não sombra */
.tl-inner { position: relative; margin-left: 52px; margin-right: 8px; }
.tl-hour { position: absolute; left: -52px; right: 0; height: 1px; background: var(--rule); }
.tl-hour span { position: absolute; left: 8px; top: -8px; font-size: 12px; color: var(--faint); background: var(--ground); padding-right: 6px; }
.tl-now { position: absolute; left: -6px; right: 0; height: 2px; background: var(--accent); z-index: 3; pointer-events: none; }
.tl-now::before { content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tl-blk {
  position: absolute; left: 6px; right: 6px; z-index: 2; display: flex; gap: 10px; align-items: flex-start; padding: 6px 10px; border-radius: 10px;
  background: var(--raised); min-height: 26px; overflow: hidden; cursor: grab; touch-action: none; text-align: left;
  
}
.tl-blk:hover { background: var(--active); }
.tl-blk .check { margin-top: 1px; }
.tl-blk .bt { display: grid; justify-items: start; text-align: left; min-width: 0; flex: 1; }
.tl-blk .bt b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-blk .bt span { color: var(--faint); font-size: 12px; line-height: 16px; }
.tl-blk.done b { color: var(--faint); text-decoration: line-through; }
.tl-blk.short { align-items: center; padding-top: 4px; padding-bottom: 4px; }
.tl-blk.short .bt span { display: none; }
.tl-blk.short .check { margin-top: 0; }
.tl-blk.lift { box-shadow: var(--lift-shadow); transform: scale(calc(1 + 0.02 * var(--move))); z-index: 5; cursor: grabbing; } /* taste-skill-ignore: flutua */
.tl-blk .when-tag { position: absolute; right: 8px; top: 6px; font-size: 12px; color: var(--accent-ink); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wcol { display: grid; grid-template-rows: auto minmax(160px, 1fr); gap: 8px; min-width: 0; background: var(--surface); border-radius: 16px; padding: 12px 10px; }
.wcol.today { background: var(--raised); }
.wcol .wh { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 0 4px; }
.wcol .wh b { font-weight: 600; }
.wcol .wh .d { color: var(--muted); font-variant-numeric: tabular-nums; }
.wcol.today .wh .d { color: var(--text); }
.wlist { display: grid; gap: 6px; align-content: start; min-height: 120px; }
.wtask { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--ground); min-width: 0; text-align: left; }
.wcol.today .wtask { background: var(--surface); }
.wtask > .row { min-width: 0; }
.wtask b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wtask .grow > span { display: block; color: var(--faint); font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtask.done b { color: var(--faint); text-decoration: line-through; }
.habit-grid { display: grid; grid-template-columns: repeat(31, 12px); gap: 3px; }
.habit-grid i { width: 12px; height: 12px; border-radius: 3px; background: var(--raised); }
.habit-grid i.on { background: var(--accent); }
.habit-grid i.fut { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); } /* taste-skill-ignore: contorno de controle, não sombra */
.habit-grid i.td { box-shadow: inset 0 0 0 1.5px var(--text); } /* taste-skill-ignore: contorno de controle, não sombra */
.habit { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto auto; gap: 8px 18px; align-items: center; min-height: 52px; padding: 8px 0; border-top: 1px solid var(--rule); }
.habit:first-child { border-top: 0; }
.habit .hs { display: flex; gap: 14px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.habit .hs b { color: var(--text); font-weight: 500; font-size: 14px; }
.habit .hs .btn { margin-left: -6px; }
.focus-face { font-size: 40px; line-height: 44px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- Ideias ---------- */
.board-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; min-height: 320px; }
.bcol { flex: 0 0 272px; width: 272px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 250px); background: var(--surface); border-radius: 16px; min-height: 0; }
.bcol-h { display: flex; align-items: center; gap: 6px; padding: 10px 8px 6px 14px; min-width: 0; }
.bcol-h .ct { flex: 1; min-width: 0; font-weight: 600; text-align: left; padding: 4px 6px; margin-left: -6px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcol-h .ct:hover { background: var(--raised); }
.bcol-h input { flex: 1; height: 30px; border-radius: 8px; }
.bcol-h .n { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.bcards { display: grid; gap: 8px; align-content: start; padding: 4px 8px 4px; overflow-y: auto; min-height: 12px; }
.kc { display: block; min-width: 0; }
.bcard { width: 100%; display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--raised); text-align: left; min-width: 0;  }
.bcard:hover { background: var(--active); }
.bcard .cover { margin: -10px -12px 0; aspect-ratio: 16 / 9; max-width: none; border-radius: 12px 12px 0 0; overflow: hidden; background: var(--surface); }
.bcard .cover img { width: 100%; height: 100%; object-fit: cover; }
.bcard .labs { display: flex; flex-wrap: wrap; gap: 4px; }
.bcard .ttl { overflow-wrap: anywhere; }
.bcard .ind { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--faint); font-size: 12px; line-height: 16px; }
.bcard .ind span { display: inline-flex; align-items: center; gap: 4px; }
.bcard .ind .pill { height: 18px; }
.bcard .site-link { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.bcard .site-link .thumb { width: 40px; border-radius: 4px; flex: none; }
.bcard .site-link .thumb .word, .srow .thumb .word { font-size: 11px; line-height: 1; padding: 2px; }
.bcol-f { padding: 6px 8px 10px; }
.add-card-btn { width: 100%; display: flex; gap: 8px; align-items: center; height: 34px; padding: 0 8px; border-radius: 10px; color: var(--muted); }
.add-card-btn:hover { background: var(--raised); color: var(--text); }
.add-card-form { display: grid; gap: 8px; }
.add-card-form textarea { min-height: 64px; }
.add-col-slot { flex: 0 0 272px; }
.add-col { width: 100%; height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 16px; background: var(--surface); color: var(--muted); }
.add-col:hover { color: var(--text); background: var(--raised); }
.add-col-form { padding: 10px; border-radius: 16px; background: var(--surface); display: grid; gap: 8px; }
.cl-item { display: flex; gap: 10px; align-items: center; min-height: 34px; }
.cl-item input.input { height: 32px; }
.cover-edit { aspect-ratio: 16 / 7; max-width: 100%; border-radius: 12px; overflow: hidden; background: var(--raised); display: grid; place-items: center; }
.cover-edit img { width: 100%; height: 100%; object-fit: cover; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500;  }
.chip-btn:hover { color: var(--text); }
.chip-btn[aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--control); } /* taste-skill-ignore: contorno de controle, não sombra */
.chip-btn .sw { width: 8px; height: 8px; border-radius: 50%; }
.lab-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-pick button { border-radius: 6px; }
.lab-pick button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); } /* taste-skill-ignore: contorno de controle, não sombra */
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 8px; background: var(--sw-bg); box-shadow: inset 0 0 0 2px var(--sw-ink); } /* taste-skill-ignore: contorno da amostra */
.swatches button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--sw-ink), 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); } /* taste-skill-ignore: contorno de controle, não sombra */

/* ---------- Notas ---------- */
.notes { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--gap); min-height: calc(100vh - 210px); }
.note-list { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; background: var(--surface); border-radius: var(--radius-card); padding: 14px; min-height: 0; align-content: start; }
.note-items { display: grid; gap: 2px; align-content: start; overflow-y: auto; max-height: calc(100vh - 290px); }
.note-item { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; text-align: left; min-width: 0;  }
.note-item:hover { background: var(--active); }
.note-item[aria-selected="true"] { background: var(--raised); }
.note-item b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.note-item > span { color: var(--faint); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; background: var(--surface); border-radius: var(--radius-card); padding: 18px 22px; min-width: 0; min-height: 0; }
.editor-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.editor-bar .stamp { margin-left: auto; color: var(--faint); font-size: 12px; }
.note-title { width: 100%; border: 0; background: transparent; outline: none; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; padding: 2px 0; }
.note-title::placeholder { color: var(--faint); }
.note-body { width: 100%; min-height: 360px; height: 100%; border: 0; background: transparent; outline: none; resize: none; line-height: 22px; font-size: 15px; padding: 0; }
.note-body::placeholder { color: var(--faint); }
.md { line-height: 24px; font-size: 15px; max-width: 72ch; overflow-wrap: anywhere; }
.md > * + * { margin-top: 10px; }
.md h1 { font-size: 20px; line-height: 28px; font-weight: 600; }
.md h2 { font-size: 17px; line-height: 24px; font-weight: 600; }
.md h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
.md ul { list-style: disc; padding-left: 22px; }
.md ol { list-style: decimal; padding-left: 22px; }
.md ul.tasks { list-style: none; padding-left: 0; }
.md ul.tasks li { display: flex; gap: 10px; align-items: flex-start; }
.md ul.tasks li .check { margin-top: 2px; }
.md a { text-decoration: underline; text-underline-offset: 3px; }
.md code { padding: 1px 5px; border-radius: 5px; background: var(--raised); font-size: 13px; }
.md blockquote { padding-left: 14px; border-left: 2px solid var(--control); color: var(--muted); }

/* ---------- Configurações ---------- */
.set { display: grid; grid-template-columns: minmax(220px, 360px) minmax(0, 700px); gap: 24px 40px; padding: 28px 0; border-top: 1px solid var(--border); }
.set:first-of-type { border-top: 0; padding-top: 14px; }
.set .lbl h2 { font-size: 16px; font-weight: 500; line-height: 24px; margin-top: 6px; }
.set .lbl p { color: var(--muted); margin-top: 4px; max-width: 42ch; }
.set .panel { gap: 16px; }
.swrow { display: flex; align-items: flex-start; gap: 16px; }
.swrow .grow { flex: 1; min-width: 0; }
.swrow b { font-weight: 500; display: block; color: var(--text); }
.swrow .grow > span { color: var(--muted); display: block; margin-top: 2px; }
.swrow .switch { margin-top: 2px; }
.stamp-ok { color: var(--faint); font-size: 12px; opacity: 0; transition: opacity var(--t-ui) var(--ease); }
.stamp-ok.on { opacity: 1; }
.srow { display: grid; grid-template-columns: auto 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); }
.srow:first-child { border-top: 0; }
.srow .handle { color: var(--faint); display: grid; place-items: center; width: 24px; height: 32px; border-radius: 6px; }
.srow .thumb { width: 72px; border-radius: 6px; }
.srow .meta2 { display: grid; min-width: 0; }
.srow .meta2 span { color: var(--faint); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcuts { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.shortcuts > * { padding: 10px 0; border-top: 1px solid var(--rule); }
.shortcuts > :nth-child(-n + 2) { border-top: 0; }
.shortcuts dd { text-align: right; display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.drop { display: grid; place-items: center; gap: 8px; padding: 16px; border-radius: var(--radius-inner); border: 1px dashed var(--dash); color: var(--muted); text-align: center; }
.drop.over { border-color: var(--text); color: var(--text); }
.thumb-edit { width: 100%; max-width: 320px; }

/* ---------- telefone e tablet ---------- */
@media (max-width: 1100px) {
  .habit { grid-template-columns: auto minmax(0, 1fr) auto; }
  .habit .habit-grid { grid-column: 2 / -1; grid-row: 2; }
  .s3, .s4, .s5, .s6, .s7, .s8 { grid-column: 1 / -1; }
  .set { grid-template-columns: 1fr; gap: 14px; }
  .week { grid-template-columns: repeat(7, minmax(150px, 1fr)); overflow-x: auto; }
}
@media (max-width: 860px) {
  .tl-hint { display: none; }
  .panel > header { flex-wrap: wrap; }
  :root { --pad: 16px; --top: 56px; --card-pad: 18px; }
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); padding-top: calc(14px + env(safe-area-inset-top, 0px));
    transform: translateX(-104%); transition: transform var(--t-page) var(--ease); z-index: 65;
  }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--float-shadow); } /* taste-skill-ignore: flutua */
  .app.collapsed .nav-label, .app.collapsed .brand b { opacity: 1; pointer-events: auto; }
  .collapse-btn { display: none; }
  .btn.menu-btn { display: inline-flex; }
  .search-trigger { width: auto; flex: 1; }
  .search-trigger kbd, .top-now .date, .top-divider { display: none; }
  .canvas { padding: 20px max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px)); }
  .notes { grid-template-columns: 1fr; min-height: 0; }
  .note-list { align-content: start; }
  .notes.reading-list .editor, .notes.reading-note .note-list { display: none; }
  .note-items { max-height: none; }
  .grid2 { grid-template-columns: 1fr; }
  .bcol { max-height: none; }
  .dialog { max-height: calc(100vh - 24px); }
}
@media (max-width: 480px) {
  .idea-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 10px; }
  .idea-tile { min-height: 104px; padding: 12px; }
  .idea-tile .it-title { font-size: 14px; line-height: 19px; }
  .greet h1 { font-size: 24px; line-height: 30px; }
  .sites-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .srow { grid-template-columns: auto 56px minmax(0, 1fr) auto; }
  .srow .thumb { width: 56px; }
  .top-now .clock { font-size: 14px; }
}

/* ---------- Estudos ---------- */
/* a coluna do dia e da semana acompanha a rolagem da fase, que é longa: fica sempre à mão */
@media (min-width: 1101px) { .es-trilha > .stack { position: sticky; top: 0; } }
#es-panel { padding-top: 18px; }
.progress.thin { height: 4px; }
.es-sec { display: grid; gap: 10px; padding-top: 4px; }
.es-sec h3, .gate h3, .rule h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; line-height: 20px; font-weight: 600; }
.es-sec h3 .meta { font-weight: 400; }
.es-intro { color: var(--muted); max-width: 72ch; }
.es-lead { max-width: 80ch; margin-bottom: 14px; }
.es-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; border-radius: var(--radius-inner); background: var(--raised); color: var(--muted); }
.es-prog { display: grid; gap: 6px; }
/* fases */
.phase-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.ps { display: grid; justify-items: start; gap: 2px; width: 100%; min-height: 56px; padding: 8px 10px; border-radius: 12px; background: var(--raised); text-align: left; color: var(--muted); }
.ps:hover { background: var(--active); color: var(--text); }
.ps .ps-n { display: inline-flex; align-items: center; height: 18px; font-size: 12px; font-weight: 600; color: var(--faint); }
.ps .ps-n svg { width: 14px; height: 14px; color: var(--positive, var(--accent)); }
.ps .ps-t { font-size: 13px; line-height: 17px; font-weight: 500; }
.ps.done .ps-t { color: var(--text); }
.ps.cur { background: var(--accent-soft); color: var(--text); }
.ps.cur .ps-n { color: var(--accent-ink); }
.ps.next { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); } /* taste-skill-ignore: contorno de controle, não sombra */
.ps[aria-current="step"] { outline: 2px solid var(--text); outline-offset: -2px; }
/* módulos */
.mods { display: grid; gap: 4px; }
.mod { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; padding: 10px 0 12px; border-top: 1px solid var(--rule); }
.mod:first-child { border-top: 0; padding-top: 2px; }
.mod .progress { grid-column: 1 / -1; }
.mod-main { display: grid; min-width: 0; }
.mod-main .title { font-weight: 500; }
.mod-main .line2, .lab-table .line2 { color: var(--faint); font-size: 12px; line-height: 16px; }
.mod.full .mod-val { color: var(--accent-ink); }
.stepper { display: inline-flex; align-items: center; gap: 2px; }
.stepper .btn:disabled { opacity: 0.35; pointer-events: none; }
.mod-val, .m-val { min-width: 64px; padding: 4px 6px; border-radius: 8px; text-align: center; font-weight: 600; white-space: nowrap; }
.mod-val small, .m-val small { color: var(--faint); font-weight: 400; font-size: 12px; }
button.mod-val:hover { background: var(--raised); }
/* labs */
.lab-table { width: 100%; border-collapse: collapse; }
.lab-table th, .lab-table td { padding: 10px 8px; border-top: 1px solid var(--rule); text-align: center; vertical-align: middle; }
.lab-table thead th { border-top: 0; padding-top: 0; font-size: 12px; font-weight: 500; color: var(--faint); white-space: nowrap; }
.lab-table th[scope="row"], .lab-table thead th:first-child { text-align: left; padding-left: 0; }
.lab-table th[scope="row"] { display: grid; font-weight: 400; }
.lab-table th[scope="row"] b { font-weight: 500; }
.lab-table td .check { margin: 0 auto; }
/* certificações */
.cert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cert { display: grid; gap: 4px; align-content: start; padding: 12px 14px; border-radius: 12px; background: var(--raised); }
/* conceitos */
.chip-btn.concept { height: auto; min-height: 30px; padding: 5px 12px; background: var(--raised); text-align: left; line-height: 18px; }
.chip-btn.concept svg { width: 14px; height: 14px; flex: none; color: var(--accent-ink); }
.chip-btn.concept[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); box-shadow: none; } /* taste-skill-ignore: sem contorno */
/* gate */
.gate { display: grid; gap: 10px; margin-top: 4px; padding: 16px 18px; border-radius: 14px; background: var(--raised); position: relative; overflow: hidden; }
.gate::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.gate.done::before { background: var(--chart-muted); }
.gate p { max-width: 70ch; }
/* bloco do dia */
.blks { display: grid; gap: 2px; }
.blk { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--rule); }
.blk:first-child { border-top: 0; padding-top: 0; }
.blk .check { margin-top: 1px; }
.blk-txt { display: grid; gap: 4px; min-width: 0; }
.blk-top { display: flex; align-items: baseline; gap: 8px; }
.blk-top b { font-size: 12px; color: var(--accent-ink); font-weight: 600; }
.blk-top .title { flex: 1; font-weight: 500; min-width: 0; }
.blk.done .title { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.blk-desc { color: var(--muted); font-size: 13px; line-height: 19px; }
.blk-rule { color: var(--faint); font-size: 12px; line-height: 17px; }
.blk.open { background: transparent; }
.es-streak { display: grid; gap: 8px; }
.es-streak .dots { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; }
.es-streak .dots i { height: 10px; border-radius: 3px; background: var(--raised); }
.es-streak .dots i.part { background: var(--chart-muted); }
.es-streak .dots i.on { background: var(--accent); }
.es-streak .dots i.td { box-shadow: inset 0 0 0 1.5px var(--text); } /* taste-skill-ignore: contorno de controle, não sombra */
/* painel da semana */
.metrics { display: grid; gap: 12px; }
.metric { display: grid; gap: 6px; }
.m-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m-l { display: grid; min-width: 0; font-size: 13px; line-height: 18px; }
.m-l small { color: var(--faint); font-size: 12px; line-height: 16px; }
.m-val { min-width: 52px; }
.metric.met .m-val { color: var(--accent-ink); }
/* mês a mês */
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gap); align-items: start; }
.month.cur { box-shadow: inset 0 0 0 1px var(--accent); } /* taste-skill-ignore: contorno de destaque, não sombra */
.month .lrow .title { font-size: 13px; line-height: 19px; }
.m-foot { color: var(--muted); font-size: 13px; line-height: 19px; }
.m-foot b { color: var(--text); font-weight: 600; }
/* leituras */
.es-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.es-bar .segmented { background: var(--surface); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.es-bar .segmented button { white-space: nowrap; flex: none; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }
.book { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px 18px; border-radius: 16px; background: var(--surface); }
.book.lendo { background: var(--raised); }
.book.lido .b-title { color: var(--muted); }
.b-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.b-status { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 6px 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--ground); }
.b-status:hover { color: var(--text); }
.b-status svg { width: 14px; height: 14px; }
.b-title { font-size: 15px; line-height: 21px; font-weight: 600; text-align: left; border-radius: 6px; }
.b-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.b-author { color: var(--faint); font-size: 12px; line-height: 16px; margin-top: -4px; }
.b-why { min-height: 57px; color: var(--muted); font-size: 13px; line-height: 19px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.b-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }
.b-prog { display: grid; gap: 6px; flex: 1; min-width: 0; }
/* regras */
.sentence { display: flex; flex-wrap: wrap; gap: 8px; counter-reset: s; }
.sentence li, .pipe li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--raised); font-size: 13px; line-height: 18px; }
.sentence li .num, .pipe li .num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ground); color: var(--accent-ink); font-size: 12px; font-weight: 600; }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rule { display: grid; gap: 8px; align-content: start; padding: 14px 16px; border-radius: 14px; background: var(--raised); }
.rule h3 { justify-content: flex-start; }
.rule h3 .num { color: var(--accent-ink); }
.rule p { color: var(--muted); font-size: 13px; line-height: 19px; }
.pipe { display: flex; flex-wrap: wrap; gap: 6px; }
.pipe li { background: var(--ground); }
.blank { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 13px; line-height: 19px; }
.err-list { display: grid; gap: 12px; counter-reset: e; }
.err-list li { display: grid; gap: 2px; padding-left: 28px; position: relative; counter-increment: e; }
.err-list li::before { content: counter(e); position: absolute; left: 0; top: 0; width: 20px; color: var(--accent-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.err-list li span { color: var(--muted); font-size: 13px; line-height: 19px; }
@media (max-width: 860px) {
  .phase-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rule-grid, .cert-grid { grid-template-columns: 1fr; }
  .month-grid { grid-template-columns: 1fr; }
  .lab-table thead th { white-space: normal; }
}
@media (max-width: 480px) {
  .lab-table th, .lab-table td { padding: 10px 4px; }
  .mod { grid-template-columns: 1fr; }
  .mod .stepper { justify-self: start; }
  .es-bar .segmented button { padding: 0 10px; }
}

/* ---------- login com 2FA (versão hospedada) ---------- */
.auth-screen { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; overflow-y: auto; padding: 24px 16px; background: var(--ground); opacity: 0; transition: opacity 200ms var(--ease); }
.auth-screen.on { opacity: 1; }
.auth-card { width: min(420px, 100%); display: grid; gap: 22px; padding: 28px; border-radius: var(--radius-card); background: var(--surface); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.auth-brand .mark { display: inline-grid; width: 22px; height: 22px; }
.auth-brand .mark svg { width: 22px; height: 22px; }
.auth-body { display: grid; gap: 14px; }
.auth-body h1 { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.auth-sub { color: var(--muted); margin-top: -6px; }
.auth-go { width: 100%; height: 42px; }
.auth-code { font-size: 22px; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-code.rec { letter-spacing: 0.12em; font-size: 18px; }
.auth-check { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; line-height: 18px; cursor: pointer; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.auth-err { color: var(--pill-negative-ink); font-size: 13px; line-height: 18px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; }
.auth-qr { justify-self: center; width: 200px; height: 200px; padding: 0; border-radius: 12px; overflow: hidden; background: #fff; } /* taste-skill-ignore: o QR precisa de fundo branco para os apps lerem */
.auth-qr svg { display: block; width: 100%; height: 100%; }
.auth-key { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--raised); }
.auth-key code { font-size: 13px; letter-spacing: 0.04em; word-break: break-all; }
.auth-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px; border-radius: 12px; background: var(--raised); list-style: none; }
.auth-codes li { font-size: 15px; letter-spacing: 0.06em; text-align: center; }

/* ================= celular: sem zoom, tela dinâmica, toque ================= */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; overscroll-behavior: none; }
body { -webkit-tap-highlight-color: transparent; }
/* altura real da tela (barra do navegador e teclado), com var(--vh) do app.js como reserva */
html, body { height: calc(var(--vh, 1vh) * 100); }
@supports (height: 100dvh) { html, body { height: 100dvh; } }
.dialog { max-height: calc(var(--vh, 1vh) * 100 - 48px); }
img, video, iframe, canvas, svg { max-width: 100%; }
.panel, .panel > *, .grid12 > *, .title-row .t { min-width: 0; }
h1, h2, h3, .it-title, .note-items b, .bcol .card, .empty p { overflow-wrap: anywhere; }

@media (pointer: coarse) {
  /* fonte de 16 px em campos: o iPhone não dá zoom ao focar */
  input, select, textarea, .input, select.input, textarea.input, .note-body { font-size: 16px; }
  .tl-blk { touch-action: pan-y; }
  .tl-blk.lift { touch-action: none; }
  /* áreas de toque com pelo menos 40 px */
  .btn.icon, .btn.icon.sm, .stepper .btn, .win-bar .wb { min-width: 40px; min-height: 40px; }
  .btn.sm { min-height: 36px; }
  .check { position: relative; }
  .check::after { content: ""; position: absolute; inset: -8px; }
  .tabs [role="tab"] { height: 44px; }
  a, button { -webkit-touch-callout: none; }
  .chip-btn, .linkbtn, .segmented button, .ct, .mod-val { min-height: 36px; }
  .linkbtn { display: inline-flex; align-items: center; }
  .nav-item { min-height: 44px; }
  .cmd-foot, .search-trigger kbd, kbd.esc-hint { display: none !important; }
}

@media (max-width: 860px) {
  :root { --top: calc(56px + env(safe-area-inset-top, 0px)); }
  .topbar { gap: 8px; padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); }
  .top-spacer { display: none; }
  .search-trigger { min-width: 0; flex: 1 1 auto; }
  .top-right { flex: 0 0 auto; gap: 4px; }
  .sidebar { padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; }
  .canvas { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 24px); }
  .toast { max-width: 100%; }
  .dock { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .title-row { align-items: flex-start; }
  .title-row .actions { width: 100%; }
  .title-row .actions > .btn { flex: 1 1 auto; }
  .tabs { margin-right: calc(-1 * var(--pad)); padding-right: var(--pad); scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .tabs [role="tab"] { scroll-snap-align: start; flex: 0 0 auto; }
  /* quadro de ideias: uma coluna por tela, com encaixe na rolagem */
  .board { scroll-snap-type: x mandatory; margin-right: calc(-1 * var(--pad)); padding-right: var(--pad); scroll-padding-left: 0; }
  .bcol { flex: 0 0 min(86vw, 340px); width: min(86vw, 340px); scroll-snap-align: start; }
  /* linha do tempo: títulos em até duas linhas em vez de cortados */
  .tl-blk:not(.short) .bt b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 17px; font-size: 13px; }
  .timeline { height: min(560px, calc(var(--vh, 1vh) * 100 - 260px)); min-height: 360px; }
  /* diálogos viram folha que sobe de baixo */
  .dialog {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-width: 100%; max-height: calc(var(--vh, 1vh) * 100 - env(safe-area-inset-top, 0px) - 12px);
    border-radius: var(--radius-card) var(--radius-card) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(calc(24px * var(--move))); 
  }
  .dialog.on { transform: none; }
  /* janelas de sites ocupam a área toda */
  .win { border-radius: 0; }
  .win-bar [data-a="max"] { display: none; }
  .title-row .actions > .input { flex: 1 1 100%; width: 100% !important; }
  .win-bar { padding-left: 12px; }
  .peek { max-width: calc(100vw - 16px); }
  .menu { max-width: calc(100vw - 16px); }
  .phase-steps .ps { min-width: 0; padding: 8px; }
  .phase-steps .ps .ps-t { overflow-wrap: anywhere; hyphens: auto; }
}

@media (max-width: 480px) {
  :root { --pad: 14px; --card-pad: 16px; }
  .greet h1 { font-size: 22px; line-height: 28px; }
  .title-row h1 { font-size: 19px; }
  .empty { padding: 14px; }
  .panel > header { gap: 4px 12px; }
  .phase-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week { grid-template-columns: repeat(7, minmax(132px, 1fr)); }
}

@media (max-width: 360px) {
  :root { --pad: 12px; --card-pad: 14px; }
  #theme-btn { display: none; }
  .search-trigger { padding-left: 10px; gap: 6px; }
  .top-now .clock { font-size: 13px; }
  .sites-grid { gap: 12px 8px; }
}

/* telas baixas na horizontal: menos respiro vertical */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --top: calc(48px + env(safe-area-inset-top, 0px)); }
  .canvas { padding-top: 12px; }
  .timeline { min-height: 240px; }
}
