/* ==========================================================================
   Nexos — Grafo de conexões (#/grafo) · prefixo .gf-

   Palco em tela cheia (canvas) + camadas flutuantes:
     topo    → barra de vidro: busca · chips de espaço · "Concluídas"
     abaixo  → dica de uso (1ª vez) ou cartão do "Fio da meada"
     direita → painel do item selecionado (no celular: folha inferior)
     cantos  → legenda (inferior esquerdo) e zoom (inferior direito)

   O JS conta com estas medidas (fit/centerOn/panelInset):
     barra do topo ≈ 58px (celular ≈ 106px) · painel 336px + 12px de margem
     · no celular a folha ocupa no máximo 52% da altura.
   ========================================================================== */

.gf {
  --gf-m: 12px;                 /* margem das camadas flutuantes */
  --gf-top: 68px;               /* onde começam painel, dica e fio (abaixo da barra) */
  --gf-pw: 336px;               /* largura do painel lateral */
  --gf-pr: 0px;                 /* espaço reservado à direita quando o painel abre */
  --gf-ctl: 36px;               /* tamanho dos botões de zoom */
  --gf-zb: 94px;                /* base do zoom: acima do botão + (FAB) no desktop */
  position: absolute; inset: 0; overflow: hidden;
  isolation: isolate;
  container: gf / size;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  background:
    radial-gradient(1100px 680px at 50% 46%, color-mix(in srgb, var(--surface) 62%, transparent), transparent 72%),
    radial-gradient(620px 420px at 100% 100%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%),
    radial-gradient(560px 380px at 0% 0%, color-mix(in srgb, var(--c-sky-s) 5%, transparent), transparent 70%),
    var(--bg);
}
.gf.has-panel { --gf-pr: calc(var(--gf-pw) + var(--gf-m)); --gf-zb: var(--gf-m); }

/* moldura suave quando o modo "Fio da meada" está ligado */
.gf::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  box-shadow: inset 0 0 0 3px var(--accent-ring), inset 0 0 60px color-mix(in srgb, var(--accent) 10%, transparent);
  opacity: 0; transition: opacity .25s var(--ease);
}
.gf.is-path-mode::after { opacity: 1; }

/* ---------------- Palco ---------------- */
.gf-canvas {
  position: absolute; inset: 0; z-index: 0; display: block;
  width: 100%; height: 100%;
  touch-action: none; -webkit-touch-callout: none;
  cursor: grab; outline: none;
}
.gf-canvas:focus-visible { outline: none; }
.gf.is-kb .gf-canvas:focus { box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 5px var(--accent-ring); }
.gf.is-over-node .gf-canvas { cursor: pointer; }
.gf.is-path-mode .gf-canvas { cursor: crosshair; }
.gf.is-path-mode.is-over-node .gf-canvas { cursor: cell; }
.gf.is-panning .gf-canvas,
.gf.is-dragging-node .gf-canvas { cursor: grabbing; }
/* durante arrasto/pan as camadas ficam discretas e não roubam o ponteiro */
.gf.is-panning .gf-top, .gf.is-panning .gf-zoom, .gf.is-panning .gf-legend,
.gf.is-dragging-node .gf-top, .gf.is-dragging-node .gf-zoom, .gf.is-dragging-node .gf-legend { opacity: .82; pointer-events: none; }

/* ---------------- Vidro compartilhado ---------------- */
.gf-top, .gf-zoom, .gf-legend, .gf-hint {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ---------------- Barra do topo ---------------- */
.gf-top {
  position: absolute; z-index: 4; top: var(--gf-m); left: var(--gf-m); right: var(--gf-m);
  display: flex; align-items: center; gap: 8px;
  padding: 5px; border-radius: var(--r-lg);
  transition: opacity .2s var(--ease);
  animation: gfDrop .35s var(--ease) both;
}

/* busca */
.gf-search {
  flex: 0 0 auto; width: 236px; height: 34px; padding: 0 8px 0 10px;
  display: flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text-3); cursor: text;
  transition: border-color var(--dur), box-shadow var(--dur), width .25s var(--ease), color var(--dur);
}
.gf-search:hover { border-color: var(--border-2); }
.gf-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); color: var(--text-2); width: 272px; }
.gf-search svg.lucide { width: 15px; height: 15px; flex-shrink: 0; }
.gf-search input {
  flex: 1; min-width: 0; height: 100%; padding: 0;
  border: 0; outline: none; background: transparent;
  color: var(--text); font-size: 13.5px;
  user-select: text; -webkit-user-select: text;
}
.gf-search input::placeholder { color: var(--text-3); }
.gf-search input::-webkit-search-cancel-button { cursor: pointer; opacity: .55; }
.gf-search-n {
  flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 7px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 11.5px; font-weight: 680; font-variant-numeric: tabular-nums; line-height: 1;
  animation: gfPop .22s var(--spring);
}
.gf-search-n:empty { display: none; }
.gf-search-n.none { background: var(--surface-3); color: var(--text-3); font-weight: 600; }

/* chips de espaço (rolam na horizontal) */
.gf-chips-wrap {
  flex: 1; min-width: 0; align-self: stretch;
  display: flex; align-items: center;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scrollbar-width: none; touch-action: pan-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, var(--text) 10px, var(--text) calc(100% - 22px), transparent);
          mask-image: linear-gradient(90deg, transparent, var(--text) 10px, var(--text) calc(100% - 22px), transparent);
}
.gf-chips-wrap::-webkit-scrollbar { display: none; }
.gf-chips { display: flex; align-items: center; gap: 6px; width: max-content; padding: 0 22px 0 6px; }

.gf-chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  height: 32px; padding: 0 6px 0 9px; border-radius: var(--r-full);
  border: 1px dashed var(--border-2); background: transparent; color: var(--text-3);
  font-size: 12.8px; font-weight: 580; white-space: nowrap; line-height: 1;
  transition: background var(--dur), color var(--dur), border-color var(--dur), box-shadow var(--dur), transform .1s;
}
.gf-chip:active { transform: scale(.95); }
.gf-chip-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: transparent; box-shadow: inset 0 0 0 1.5px var(--c-s, var(--text-3));
  transition: background var(--dur), box-shadow var(--dur);
}
.gf-chip-emoji { font-size: 14px; line-height: 1; filter: grayscale(1); opacity: .55; transition: filter var(--dur), opacity var(--dur); }
.gf-chip-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.gf-chip-n {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full);
  display: inline-grid; place-items: center;
  background: var(--surface-3); color: var(--text-3);
  font-size: 11px; font-weight: 680; font-variant-numeric: tabular-nums;
}
.gf-chip:hover { border-color: var(--c-s, var(--border-2)); color: var(--text-2); }
.gf-chip:hover .gf-chip-emoji { opacity: .85; }

.gf-chip.on { background: var(--c-bg); color: var(--c-ink); border: 1px solid transparent; }
.gf-chip.on .gf-chip-dot { background: var(--c-s); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-s) 24%, transparent); }
.gf-chip.on .gf-chip-emoji { filter: none; opacity: 1; }
.gf-chip.on .gf-chip-n { background: color-mix(in srgb, var(--surface) 62%, transparent); color: var(--c-ink); }
.gf-chip.on:hover { border-color: color-mix(in srgb, var(--c-s) 55%, transparent); box-shadow: 0 2px 8px color-mix(in srgb, var(--c-s) 22%, transparent); }

.gf-chip-all {
  padding: 0 11px 0 9px; border: 1px solid transparent;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 640;
  animation: gfPop .25s var(--spring);
}
.gf-chip-all svg.lucide { width: 14px; height: 14px; }
.gf-chip-all:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: transparent; color: var(--accent-ink); }

/* "Concluídas" */
.gf-toggle {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px 0 10px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  font-size: 12.8px; font-weight: 580; white-space: nowrap;
  transition: background var(--dur), color var(--dur), border-color var(--dur), transform .1s;
}
.gf-toggle svg.lucide { width: 15px; height: 15px; color: var(--text-3); transition: color var(--dur); }
.gf-toggle:hover { border-color: var(--border-2); color: var(--text); }
.gf-toggle:active { transform: scale(.96); }
.gf-toggle.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.gf-toggle.on svg.lucide { color: var(--accent); }

/* ---------------- Dica (primeira visita) ---------------- */
.gf-hint {
  position: absolute; z-index: 3; top: var(--gf-top);
  left: calc((100% - var(--gf-pr)) / 2); transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px;
  width: max-content; max-width: calc(100% - var(--gf-pr) - 2 * var(--gf-m));
  min-height: 38px; padding: 7px 42px 7px 14px; border-radius: 19px;
  font-size: 12.5px; line-height: 1.35; color: var(--text-2);
  animation: gfHintIn .4s var(--spring) .5s both;
  transition: left .3s var(--ease);
}
.gf-hint > span:not(.gf-hint-sep) { display: inline-flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; }
.gf-hint svg.lucide { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.gf-hint b { color: var(--text); font-weight: 650; }
.gf-hint .kbd { margin: 0 1px; }
.gf-hint .btn { position: absolute; top: 50%; right: 5px; margin-top: -14px; color: var(--text-3); border-radius: var(--r-full); }
.gf-hint .btn svg.lucide { color: currentColor; }
.gf-hint-sep { width: 1px; height: 16px; background: var(--border-2); flex-shrink: 0; }
.gf-hint.out { animation: gfHintOut .2s var(--ease) forwards; pointer-events: none; }
.gf.has-path .gf-hint { display: none; }
/* sem espaço para uma linha só (painel aberto ou palco estreito): vira um cartãozinho de duas linhas */
.gf.has-panel .gf-hint { flex-direction: column; align-items: flex-start; gap: 4px; border-radius: var(--r-lg); }
.gf.has-panel .gf-hint-sep { display: none; }
@container gf (max-width: 840px) {
  .gf-hint { flex-direction: column; align-items: flex-start; gap: 4px; border-radius: var(--r-lg); }
  .gf-hint-sep { display: none; }
}

/* ---------------- Controles de zoom ---------------- */
.gf-zoom {
  position: absolute; z-index: 4; right: calc(var(--gf-m) + var(--gf-pr)); bottom: var(--gf-zb);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px; border-radius: var(--r-lg);
  transition: right .32s var(--ease), bottom .32s var(--ease), opacity .2s var(--ease), transform .25s var(--ease);
}
.gf-zoom button {
  width: var(--gf-ctl); height: var(--gf-ctl); border-radius: calc(var(--r) - 2px);
  display: grid; place-items: center; color: var(--text-2);
  transition: background var(--dur), color var(--dur), box-shadow var(--dur), transform .1s;
}
.gf-zoom button:hover { background: var(--hover); color: var(--text); }
.gf-zoom button:active { transform: scale(.92); }
.gf-zoom button.on { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 14px var(--accent-ring); }
.gf-zoom button.on:hover { background: var(--accent-2); color: var(--on-accent); }
.gf-zsep { width: 60%; height: 1px; margin: 3px 0; background: var(--border); }
/* botão do "Fio da meada": ícone + rótulo curto, para ser achado (a dica cita "Fio") */
.gf-zoom button[data-gf="path"] { height: auto; min-height: calc(var(--gf-ctl) + 10px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px 0 4px; }
.gf-zlbl { font-size: 10px; font-weight: 680; line-height: 1; letter-spacing: .01em; }

/* ---------------- Legenda ---------------- */
.gf-legend {
  position: absolute; z-index: 4; left: var(--gf-m); bottom: var(--gf-m);
  width: max-content; max-width: calc(100% - 2 * var(--gf-m) - var(--gf-ctl) - 20px - var(--gf-pr));
  border-radius: var(--r-lg); overflow: hidden;
  transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.gf-legend.open { width: 244px; }
.gf-legend:empty { display: none; }
.gf-legend-toggle {
  display: flex; align-items: center; gap: 7px; width: 100%;
  height: 38px; padding: 0 10px 0 12px;
  font-size: 12.8px; font-weight: 640; color: var(--text); text-align: left; white-space: nowrap;
  transition: background var(--dur);
}
.gf-legend-toggle:hover { background: var(--hover); }
.gf-legend-toggle:focus-visible { outline-offset: -2px; border-radius: var(--r-lg); }
.gf-legend-toggle > svg.lucide:first-child { width: 15px; height: 15px; color: var(--text-3); }
.gf-legend-n {
  margin-left: auto; padding-left: 6px;
  font-size: 11.5px; font-weight: 560; color: var(--text-3); font-variant-numeric: tabular-nums;
}
.gf-legend-caret { width: 14px; height: 14px; color: var(--text-3); transform: rotate(180deg); transition: transform .25s var(--ease); }
.gf-legend.open .gf-legend-caret { transform: none; }
.gf-legend-body { display: none; flex-direction: column; gap: 7px; padding: 0 12px 11px; }
.gf-legend.open .gf-legend-body { display: flex; animation: gfFade .2s var(--ease); }
.gf-lg-row { display: flex; align-items: center; gap: 10px; font-size: 12px; line-height: 1.3; color: var(--text-2); }
.gf-lg-row svg { flex-shrink: 0; width: 24px; }
.gf-lg-shapes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--surface-3) 70%, transparent);
}
.gf-lg-shapes span { display: inline-flex; align-items: center; gap: 7px; font-size: 11.8px; color: var(--text-2); white-space: nowrap; }
.gf-lg-shapes svg { flex-shrink: 0; }
.gf-lg-foot {
  margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums;
}

/* ---------------- Fio da meada ---------------- */
.gf-path {
  position: absolute; z-index: 5; top: var(--gf-top);
  left: calc((100% - var(--gf-pr)) / 2); transform: translateX(-50%);
  width: min(560px, calc(100% - var(--gf-pr) - 2 * var(--gf-m) - 96px));
  max-height: calc(100% - var(--gf-top) - 70px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 12px 12px 12px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-soft);
  user-select: text; -webkit-user-select: text; touch-action: pan-y;
  animation: gfDrop .32s var(--spring);
  transition: left .3s var(--ease), width .3s var(--ease);
}
.gf-path-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); }
.gf-path-head b { font-weight: 680; letter-spacing: -.005em; }
.gf-path-head .btn { margin-left: auto; flex-shrink: 0; color: var(--text-3); }
.gf-path-ic {
  width: 28px; height: 28px; border-radius: calc(var(--r) - 3px); flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.gf-path-ic svg.lucide { width: 15px; height: 15px; }
.gf-path-n {
  height: 20px; padding: 0 8px; border-radius: var(--r-full);
  display: inline-flex; align-items: center;
  background: var(--surface-3); color: var(--text-2);
  font-size: 11.5px; font-weight: 640; white-space: nowrap;
}
.gf-path-text { margin: 8px 2px 0; font-size: 13.2px; line-height: 1.75; color: var(--text-2); }
.gf-path-text b { color: var(--text); font-weight: 640; }
.gf-path-text .kbd { margin: 0 1px; vertical-align: 1px; }
.gf-path-text .gf-chain-node { height: 24px; margin: 0 2px; vertical-align: middle; font-size: 12.2px; }

.gf-chain {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-2);
}
.gf-chain-node {
  display: inline-flex; align-items: center; gap: 6px; max-width: 230px;
  height: 28px; padding: 0 10px 0 8px; border-radius: var(--r-full);
  background: var(--c-bg); color: var(--c-ink);
  font-size: 12.5px; font-weight: 600; line-height: 1;
  transition: box-shadow var(--dur), transform .12s var(--ease);
  animation: gfPop .28s var(--spring) both;
}
.gf-chain-node:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-s) 55%, transparent); transform: translateY(-1px); }
.gf-chain-node:active { transform: scale(.96); }
.gf-chain > :nth-child(3) { animation-delay: .04s; }
.gf-chain > :nth-child(5) { animation-delay: .08s; }
.gf-chain > :nth-child(7) { animation-delay: .12s; }
.gf-chain > :nth-child(9) { animation-delay: .16s; }
.gf-chain > :nth-child(n+11) { animation-delay: .2s; }
.gf-chain-arrow { display: inline-grid; place-items: center; color: var(--text-3); }
.gf-chain-arrow svg.lucide { width: 13px; height: 13px; }

.gf-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--c-s, var(--text-3)); }

/* sugestão do Claude = cartão-fantasma (tracejado na cor de destaque) */
.gf-path-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  margin-top: 10px; padding: 8px 10px;
  border: 1.5px dashed var(--accent); border-radius: var(--r);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  animation: gfFade .3s var(--ease) .15s both;
}
.gf-path-actions .tiny { display: inline-flex; align-items: center; gap: 5px; }
.gf-path-actions .tiny::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}

/* ---------------- Painel lateral ---------------- */
.gf-panel {
  position: absolute; z-index: 6; top: var(--gf-top); right: var(--gf-m); bottom: var(--gf-m);
  width: var(--gf-pw);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  overflow: hidden;
  user-select: text; -webkit-user-select: text;
  animation: gfPanelIn .32s var(--ease);
}
.gf-panel-head {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: 10px 8px 6px 16px;
}
.gf-kicker {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gf-kicker svg.lucide { width: 14px; height: 14px; flex-shrink: 0; }
.gf-panel-head .btn { flex-shrink: 0; color: var(--text-3); }
.gf-panel-head .btn:hover { color: var(--text); }

.gf-panel-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  display: flex; flex-direction: column; gap: 12px;
  padding: 4px 16px 18px;
}
.gf-panel-body > * { flex-shrink: 0; animation: gfFade .25s var(--ease) both; }
.gf-panel-body > :nth-child(2) { animation-delay: .03s; }
.gf-panel-body > :nth-child(n+3) { animation-delay: .06s; }
.gf-panel-body .item-card { box-shadow: none; }
.gf-panel-body .item-card:hover { transform: none; box-shadow: var(--shadow-sm); }

.gf-panel-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.gf-panel-actions .btn { flex: 1 1 auto; padding: 0 10px; }

.gf-panel-sec {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
  font-size: 11px; font-weight: 680; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3);
}
.gf-panel-sec::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.gf-n {
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--r-full);
  display: inline-grid; place-items: center;
  background: var(--surface-3); color: var(--text-2);
  font-size: 11px; font-weight: 680; letter-spacing: 0; font-variant-numeric: tabular-nums;
}

/* pessoas reais do espaço e autoria do item */
.gf-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.gf-person {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: 30px; padding: 0 10px 0 4px; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 560; color: var(--text);
}
.gf-who { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.gf-who-i { display: inline-flex; align-items: center; gap: 6px; }
.gf-who b { color: var(--text); font-weight: 620; }

.gf-nbrs { display: flex; flex-direction: column; gap: 1px; margin: -6px -8px 0; }
.gf-nbr {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 38px; padding: 6px 8px 6px 10px; border-radius: var(--r);
  text-align: left; font-size: 13.2px; font-weight: 520; color: var(--text);
  transition: background var(--dur);
}
.gf-nbr:hover { background: var(--hover); }
.gf-nbr:active { background: var(--active); }
.gf-nbr .gf-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-s) 22%, transparent); }
.gf-nbr-t { flex: 1; }
.gf-nbr > svg.lucide { width: 14px; height: 14px; color: var(--text-3); opacity: .5; transition: opacity var(--dur), transform var(--dur) var(--ease); }
.gf-nbr:hover > svg.lucide { opacity: 1; transform: translateX(2px); }
.gf-nbr .tiny { flex-shrink: 0; padding: 1px 7px; border-radius: var(--r-full); background: var(--surface-3); }

.gf-panel-empty {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border: 1.5px dashed var(--border-2); border-radius: var(--r);
  font-size: 12.8px; line-height: 1.55; color: var(--text-2);
}
.gf-nbrs .gf-panel-empty { margin: 6px 8px 0; }
.gf-panel-empty > svg.lucide { width: 16px; height: 16px; margin-top: 2px; color: var(--text-3); flex-shrink: 0; }
.gf-panel-empty b { color: var(--text); font-weight: 640; }

/* espaço selecionado */
.gf-space-hero {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--r-lg);
  background: radial-gradient(130% 150% at 0% 0%, var(--c-bg), color-mix(in srgb, var(--c-s) 30%, var(--c-bg)));
  color: var(--c-ink);
}
.gf-space-emoji {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: var(--r-lg);
  display: grid; place-items: center; font-size: 30px; line-height: 1;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  box-shadow: var(--shadow-sm);
}
.gf-space-name { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; color: var(--c-ink); }
.gf-space-desc { margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: color-mix(in srgb, var(--c-ink) 80%, transparent); }
.gf-space-desc:empty { display: none; }

.gf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gf-stats > div {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 9px 11px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border);
}
.gf-stats b { font-size: 19px; font-weight: 720; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.gf-stats span { font-size: 11.5px; color: var(--text-3); }

/* ---------------- Botão na barra superior ---------------- */
.gf-ask svg.lucide { color: var(--accent); }

/* ---------------- Escuro: vidro um pouco mais denso ---------------- */
:root[data-theme="dark"] .gf-path { background: var(--surface-2); }
:root[data-theme="dark"] .gf-search,
:root[data-theme="dark"] .gf-toggle { background: var(--surface-2); }
:root[data-theme="dark"] .gf-panel-body .item-card:not(.tinted) { background: var(--surface-2); }

/* ---------------- Telas médias ---------------- */
@media (max-width: 1100px) and (min-width: 761px) {
  .gf-search { width: 200px; }
  .gf-search:focus-within { width: 230px; }
  .gf.has-panel .gf-toggle span { display: none; }
  .gf.has-panel .gf-toggle { padding: 0 9px; }
}

/* ---------------- Celular ---------------- */
@media (max-width: 760px) {
  .gf {
    --gf-m: 8px;
    --gf-top: 114px;
    --gf-pr: 0px;
    --gf-ctl: 40px;
    --gf-zb: var(--gf-m);
  }
  .gf.has-panel { --gf-pr: 0px; }

  .gf-top {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "search done" "chips chips";
    gap: 6px; padding: 6px;
  }
  .gf-search { grid-area: search; width: auto; height: 40px; }
  .gf-search:focus-within { width: auto; }
  .gf-search input { font-size: 16px; }   /* evita o zoom automático do iOS */
  .gf-toggle { grid-area: done; height: 40px; }
  .gf-chips-wrap { grid-area: chips; height: 40px; margin: 0 -6px; }
  .gf-chips { padding: 0 22px 0 6px; }
  .gf-chip { height: 40px; padding: 0 8px 0 11px; font-size: 13px; }
  .gf-chip-all { padding: 0 13px 0 11px; }

  .gf-hint {
    left: var(--gf-m); right: var(--gf-m); transform: none; width: auto; max-width: none;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px;
    padding: 8px 46px 8px 14px; border-radius: var(--r-lg); line-height: 1.4;
  }
  .gf-hint > span:not(.gf-hint-sep) { white-space: normal; }
  .gf-hint-sep { display: none; }
  .gf-hint .btn { position: absolute; top: 50%; right: 4px; width: 40px; height: 40px; margin-top: -20px; }

  .gf-path {
    left: var(--gf-m); right: var(--gf-m); transform: none; width: auto;
    max-height: calc(100% - var(--gf-top) - 70px);
  }
  .gf.has-panel .gf-path { max-height: calc(48% - var(--gf-top) + 8px); min-height: 0; }
  .gf-path-head .btn { width: 40px; height: 40px; margin: -6px -6px -6px auto; }
  .gf-chain-node { height: 34px; }
  .gf-path-actions .btn { height: 38px; }

  .gf-zoom button { border-radius: var(--r); }
  .gf.has-panel .gf-zoom,
  .gf.has-panel .gf-legend { opacity: 0; pointer-events: none; transform: translateY(12px); }
  .gf.has-panel .gf-hint { display: none; }   /* com a folha aberta, o pouco palco que sobra fica livre */
  .gf-legend-toggle { height: 40px; }
  .gf-legend.open { width: min(250px, calc(100% - 2 * var(--gf-m) - var(--gf-ctl) - 24px)); }

  /* painel vira folha inferior */
  .gf-panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    max-height: 52%;
    border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: 0;
    box-shadow: var(--shadow-window);
    animation: sheetIn .32s var(--ease);
  }
  .gf-panel::before {
    content: ""; flex-shrink: 0; width: 38px; height: 5px; margin: 8px auto 0;
    border-radius: var(--r-full); background: var(--border-2);
  }
  .gf-panel-head { padding: 2px 6px 4px 16px; }
  .gf-panel-head .btn { width: 40px; height: 40px; }
  .gf-panel-body { padding: 2px 14px 16px; }
  .gf-panel-actions .btn { height: 40px; padding: 0 13px; font-size: 13px; flex: 1 1 auto; }
  .gf-nbr { min-height: 44px; }
  .gf-space-hero { padding: 12px; }

  .gf-ask .gf-act-label { display: none; }
  .gf-ask { width: 34px; padding: 0; }
}

/* telas bem estreitas: "Concluídas" vira só ícone */
@media (max-width: 360px) {
  .gf-toggle span { display: none; }
  .gf-toggle { width: 40px; padding: 0; justify-content: center; }
}

/* ---------------- Animações ---------------- */
@keyframes gfDrop { from { opacity: 0; transform: translate(var(--gf-tx, 0), -8px); } to { opacity: 1; transform: translate(var(--gf-tx, 0), 0); } }
@keyframes gfHintIn { from { opacity: 0; transform: translate(var(--gf-tx, 0), -6px) scale(.97); } to { opacity: 1; transform: translate(var(--gf-tx, 0), 0); } }
@keyframes gfHintOut { to { opacity: 0; transform: translate(var(--gf-tx, 0), -6px) scale(.97); } }
@keyframes gfPanelIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes gfFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes gfPop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

/* os elementos centralizados por translateX(-50%) usam --gf-tx nas animações */
.gf-hint, .gf-path { --gf-tx: -50%; }
@media (max-width: 760px) { .gf-hint, .gf-path { --gf-tx: 0px; } }
.gf-top { --gf-tx: 0px; }
