/* =====================================================================
   Panettonne · sistema visual
   Escuro, vidro sobre um fundo com luz, uma cor de destaque (violeta) e
   tipografia Inter. Tudo sai das variáveis abaixo: cor, superfície,
   raio, sombra e movimento. Desfoque (caro no celular) só no que flutua:
   barras, caixa de texto, folhas, barra lateral, painel de trabalho,
   avisos. O resto é vidro sem desfoque.
   ===================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* cor */
  --bg: #07080d;
  --text: #ededf3;
  --text-2: #a3a3b8;
  --text-3: #6e6e84;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --line-3: rgba(255, 255, 255, .2);
  --fill: rgba(255, 255, 255, .03);
  --fill-2: rgba(255, 255, 255, .055);
  --fill-3: rgba(255, 255, 255, .085);
  --glass: rgba(17, 18, 28, .62);
  --glass-strong: rgba(14, 15, 24, .82);
  --accent: #8b7bff;
  --accent-hi: #a89cff;
  --accent-soft: rgba(139, 123, 255, .14);
  --accent-line: rgba(139, 123, 255, .38);
  --cyan: #5eead4;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #60a5fa;

  /* forma */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --hi: inset 0 1px 0 rgba(255, 255, 255, .06);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .3);
  --blur: blur(22px) saturate(170%);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;

  /* movimento: quatro durações e quatro curvas para o Panettonne inteiro.
     Toque/hover → --dur-1; avisos, abas, balões → --dur-2; folhas e
     painéis → --dur-3; mudanças grandes de layout → --dur-4.
     Entrada --ease-out, saída --ease-in, deslocamento --ease-in-out,
     contador/selo --ease-pop. */
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --dur-4: 450ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);

  --side-w: 264px;
}

/* ------------------------------------------------------------ base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
/* fundo com luz: manchas grandes e suaves que derivam devagar + grão */
body::before {
  content: ""; position: fixed; inset: -6vmax; z-index: -2; pointer-events: none;
  background:
    radial-gradient(48vmax 38vmax at 22% 12%, rgba(124, 92, 255, .30), transparent 64%),
    radial-gradient(40vmax 32vmax at 88% 18%, rgba(56, 189, 248, .14), transparent 64%),
    radial-gradient(46vmax 36vmax at 72% 92%, rgba(94, 234, 212, .11), transparent 64%),
    radial-gradient(34vmax 28vmax at 8% 90%, rgba(236, 72, 153, .10), transparent 64%);
  animation: drift 50s var(--ease-in-out) infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes drift { to { transform: translate3d(3vmax, -2vmax, 0) scale(1.06); } }

button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
::selection { background: rgba(139, 123, 255, .35); }
.i { width: 1em; height: 1em; flex-shrink: 0; vertical-align: -.125em; }
.muted { color: var(--text-2); }
.small { font-size: .82rem; }
.hint { margin-top: .9rem; font-size: .8rem; line-height: 1.5; color: var(--text-3); }
.hint code, .msg code { border-radius: 6px; background: var(--fill-3); padding: .08rem .35rem; font: .86em var(--mono); color: #e4e4ee; }
.error { color: var(--bad); }
.hidden { display: none !important; }
.center { display: flex; min-height: 60dvh; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; padding: 1.5rem; }
.center.small { min-height: 6rem; }
.stack { display: flex; flex-direction: column; gap: .5rem; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid rgba(139, 123, 255, .18); border-top-color: var(--accent-hi);
  animation: spin .8s linear infinite;
}
.small-spin { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ botões */
.btn {
  display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--fill-2);
  padding: 0 1rem; font-size: .9rem; font-weight: 560; color: var(--text); text-decoration: none; box-shadow: var(--hi);
  transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-2) ease, border-color var(--dur-2) ease, box-shadow var(--dur-2) ease, filter var(--dur-2) ease;
}
.btn:hover { background: var(--fill-3); border-color: var(--line-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .i { font-size: 1.05em; }
.btn.primary {
  border-color: rgba(255, 255, 255, .16); color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0)), var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 20px rgba(139, 123, 255, .32);
}
.btn.primary:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0)), var(--accent); filter: brightness(1.05); }
.btn.accent { border-color: rgba(94, 234, 212, .3); background: rgba(94, 234, 212, .08); color: #a7f3e4; }
.btn.danger { border-color: rgba(248, 113, 113, .28); background: rgba(248, 113, 113, .07); color: #fca5a5; }
.btn.danger:hover { background: rgba(248, 113, 113, .13); }
.btn.small { min-height: 32px; border-radius: 9px; padding: 0 .75rem; font-size: .82rem; }
.btn.big { min-height: 48px; font-size: .97rem; }
.btn.wide { width: 100%; }

.icon-btn {
  position: relative; display: inline-flex; width: 38px; height: 38px; flex-shrink: 0; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent; font-size: 1.15rem; color: var(--text-2); text-decoration: none;
  transition: background-color var(--dur-2) ease, color var(--dur-2) ease, transform var(--dur-1) var(--ease-out);
}
.icon-btn:hover { background: var(--fill-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.is-on { background: var(--accent-soft); color: var(--accent-hi); }

/* ------------------------------------------------------------ campos */
.input, .search input, .field select, .inline-form input {
  width: 100%; min-height: 44px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: rgba(0, 0, 0, .25); padding: .6rem .85rem; font-size: 16px; color: var(--text); outline: none;
  transition: border-color var(--dur-2) ease, box-shadow var(--dur-2) ease, background-color var(--dur-2) ease;
}
.input::placeholder, .search input::placeholder, textarea::placeholder { color: var(--text-3); }
.input:focus, .search input:focus, .field select:focus, .inline-form input:focus {
  border-color: var(--accent-line); background: rgba(0, 0, 0, .35); box-shadow: 0 0 0 4px rgba(139, 123, 255, .12);
}
textarea.input { resize: vertical; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: .4rem; font-size: .8rem; font-weight: 560; color: var(--text-2); }
.field small.muted { font-weight: 400; color: var(--text-3); }
.field textarea.input { min-height: 7rem; }
.inline-form { display: flex; gap: .5rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .4rem; }
.check {
  display: flex; min-height: 42px; align-items: center; gap: .55rem; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--fill); padding: .45rem .65rem; font-size: .86rem; font-weight: 500; cursor: pointer;
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease;
}
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.check:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }

/* ------------------------------------------------------------ etiquetas */
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; border-radius: 7px; background: var(--fill-2);
  padding: .14rem .5rem; font-size: .74rem; font-weight: 520; color: var(--text-2); white-space: nowrap;
}
.chip .i { font-size: .95em; }
.chip.warn { background: rgba(251, 191, 36, .1); color: #fcd34d; }
.chip.info { background: rgba(96, 165, 250, .1); color: #93c5fd; }
.chip.ok { background: rgba(74, 222, 128, .1); color: #86efac; }
.chip.bad { background: rgba(248, 113, 113, .1); color: #fca5a5; }

/* ponto de estado (verde aberto, âmbar trabalhando, vermelho esperando) */
.dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(74, 222, 128, .15); }
.dot.busy { background: var(--warn); box-shadow: 0 0 0 3px rgba(251, 191, 36, .15); animation: pulse 1.2s var(--ease-in-out) infinite alternate; }
.dot.wait { background: var(--bad); box-shadow: 0 0 0 3px rgba(248, 113, 113, .18); }
@keyframes pulse { from { opacity: .45; } to { opacity: 1; } }

/* ------------------------------------------------------------ barra do topo */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; min-height: 60px; align-items: center; gap: .35rem;
  border-bottom: 1px solid var(--line); background: rgba(7, 8, 13, .55);
  padding: .45rem .7rem; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.bar h1 { display: flex; flex: 1; min-width: 0; align-items: center; gap: .55rem; overflow: hidden; font-size: 1.02rem; font-weight: 620; letter-spacing: -.02em; white-space: nowrap; }
.bar h1 span { overflow: hidden; text-overflow: ellipsis; }
.bar-logo { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 0 24px rgba(139, 123, 255, .35); }
.avatar {
  display: inline-flex; width: 34px; height: 34px; flex-shrink: 0; align-items: center; justify-content: center; margin-left: .2rem;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px;
  background: linear-gradient(135deg, #8b7bff, #5eead4); font-size: .85rem; font-weight: 650; color: #0b0b12;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) ease;
}
.avatar:hover { box-shadow: 0 0 0 4px rgba(139, 123, 255, .2); }
.badge-host { position: relative; }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--accent);
  padding: 0 5px; font-size: .66rem; font-weight: 700; line-height: 17px; color: #fff; text-align: center; box-shadow: 0 0 0 2px var(--bg);
}
.mode-pill {
  display: inline-flex; flex-shrink: 0; max-width: 11rem; align-items: center; gap: .35rem; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--fill-2); padding: .32rem .7rem;
  font-size: .76rem; font-weight: 560; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap;
  transition: background-color var(--dur-2) ease, color var(--dur-2) ease;
}
.mode-pill:hover { background: var(--fill-3); color: var(--text); }
.mode-pill .i { color: var(--accent-hi); }

/* ------------------------------------------------------------ tela inicial */
.home-top { width: min(calc(100% - 1.5rem), 860px); margin: .7rem auto 0; display: flex; flex-direction: column; gap: .6rem; }
.usage-strip {
  display: flex; align-items: center; gap: 1rem; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--fill); padding: .55rem .8rem; font-size: .78rem; color: var(--text-2); text-decoration: none; white-space: nowrap;
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease;
}
.usage-strip:hover { border-color: var(--line-2); background: var(--fill-2); }
.usage-strip > .i { color: var(--text-3); }
.usage-strip .chev { margin-left: auto; color: var(--text-3); }
.strip-item { display: inline-flex; align-items: center; gap: .45rem; }
.strip-item b { font-weight: 560; color: var(--text); }
.strip-item small { color: var(--text-3); }
.mini { display: inline-block; width: 46px; height: 4px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.mini i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.strip-item.warning .mini i { background: var(--warn); }
.strip-item.critical .mini i { background: var(--bad); }

.tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: .25rem;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--fill); padding: .22rem;
}
.tabs a {
  display: flex; align-items: center; justify-content: center; gap: .45rem; border-radius: 9px; padding: .5rem;
  font-size: .87rem; font-weight: 560; color: var(--text-2); text-decoration: none;
  transition: background-color var(--dur-2) ease, color var(--dur-2) ease;
}
.tabs a:hover { color: var(--text); }
.tabs a.is-on { background: var(--fill-3); color: var(--text); box-shadow: var(--hi), 0 1px 3px rgba(0, 0, 0, .3); }
.search { position: relative; }
.search .i { position: absolute; top: 50%; left: .85rem; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 2.4rem; background: var(--fill); }

.list { display: flex; width: min(calc(100% - 1.5rem), 860px); margin: 0 auto; flex-direction: column; gap: .55rem; padding: .8rem 0 7rem; }
.list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); align-items: start; }
.empty {
  display: flex; flex-direction: column; align-items: center; gap: .6rem; grid-column: 1 / -1;
  border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 2.6rem 1rem; text-align: center; color: var(--text-2);
}
.empty .i { font-size: 1.6rem; color: var(--text-3); }
.section { margin-top: .6rem; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* cartões */
.card {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
  padding: 1rem 1.05rem; box-shadow: var(--hi), var(--shadow);
  transition: border-color var(--dur-2) ease, transform var(--dur-2) var(--ease-out), background-color var(--dur-2) ease;
}
.card-head { display: flex; align-items: center; gap: .6rem; }
.card-head h2 { flex: 1; min-width: 0; overflow: hidden; font-size: 1rem; font-weight: 620; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.card-title { margin: .1rem 0 .6rem; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.card > * + .card-title { margin-top: 1.1rem; }
.card.is-running { border-color: rgba(139, 123, 255, .28); }
.card.is-running::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(135deg, rgba(139, 123, 255, .55), transparent 45%, transparent 60%, rgba(94, 234, 212, .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.live { display: inline-flex; flex-shrink: 0; align-items: center; gap: .45rem; font-size: .75rem; font-weight: 520; color: var(--text-2); }
.commit { display: flex; align-items: center; gap: .6rem; margin-top: .75rem; font-size: .8rem; color: var(--text-3); }
.commit .i { color: var(--text-3); }
.commit span { flex: 1; min-width: 0; overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.commit time { flex-shrink: 0; }
.actions { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin-top: .9rem; }
.card.user .actions { grid-template-columns: 1fr 1fr; }
.card.user .actions.three { grid-template-columns: 1fr 1.25fr 1fr; }
.card.user .actions.three .btn { padding: 0 .5rem; font-size: .82rem; }
.as-link { display: block; color: inherit; text-decoration: none; }
.as-link:hover { border-color: var(--line-2); transform: translateY(-1px); }

/* lista de conversas */
.conv {
  display: grid; width: 100%; grid-template-columns: auto 1fr auto; align-items: center; gap: .15rem .85rem;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--fill);
  padding: .8rem .95rem; text-align: left; color: inherit;
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease, transform var(--dur-1) var(--ease-out);
}
.conv:hover { border-color: var(--line-2); background: var(--fill-2); }
.conv:active { transform: scale(.99); }
.conv:disabled { opacity: .6; }
.conv-icon {
  display: inline-flex; width: 38px; height: 38px; grid-row: span 2; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 11px; background: var(--fill-2); font-size: 1.05rem; color: var(--text-2);
}
.conv.is-trabalhando .conv-icon { border-color: rgba(251, 191, 36, .3); color: #fcd34d; }
.conv.is-esperando .conv-icon { border-color: rgba(248, 113, 113, .35); color: #fca5a5; }
.conv-title { display: -webkit-box; min-width: 0; overflow: hidden; font-size: .93rem; font-weight: 560; line-height: 1.38; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.conv-top { display: flex; min-width: 0; grid-column: 2; align-items: center; gap: .5rem; font-size: .76rem; color: var(--text-3); }
.conv-top time { flex-shrink: 0; }
.conv-project { overflow: hidden; color: var(--text-2); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.conv-project.is-free { color: #c4b5fd; }
.conv-top time::before { content: "·"; margin-right: .5rem; }
.conv-state {
  display: inline-flex; grid-column: 3; grid-row: 1 / span 2; align-items: center; gap: .4rem; border-radius: 999px;
  padding: .2rem .6rem; font-size: .72rem; font-weight: 560; white-space: nowrap;
}
.conv-state.ok { background: rgba(74, 222, 128, .08); color: #86efac; }
.conv-state.busy { background: rgba(251, 191, 36, .1); color: #fcd34d; }
.conv-state.warn { background: rgba(248, 113, 113, .12); color: #fca5a5; }

.fab {
  position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 20;
  display: inline-flex; min-height: 50px; align-items: center; gap: .45rem;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; padding: 0 1.2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0)), var(--accent);
  font-weight: 600; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 12px 32px rgba(139, 123, 255, .45);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) ease;
}
.fab:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 14px 40px rgba(139, 123, 255, .6); }
.fab:active { transform: scale(.96); }

/* ------------------------------------------------------------ linhas e folhas */
.row {
  display: flex; align-items: center; gap: .8rem; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--fill); padding: .7rem .8rem; text-decoration: none; color: inherit;
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease;
}
.as-button { width: 100%; text-align: left; color: inherit; }
.as-button:hover, a.row:hover { border-color: var(--line-2); background: var(--fill-2); }
.as-button:active { background: var(--fill-3); }
.as-button.is-picked { border-color: var(--accent-line); background: var(--accent-soft); }
.row-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: .1rem; }
.row-text b { overflow: hidden; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.row-text .chip { align-self: flex-start; margin: .15rem 0; }
.row-text small { overflow: hidden; font-size: .8rem; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.row-text.wrap small, .row-text.wrap b { white-space: normal; }
.row-icon, .new-icon {
  display: inline-flex; width: 36px; height: 36px; flex-shrink: 0; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--fill-2); font-size: 1.05rem; color: var(--text-2);
}
.new-icon { width: 42px; height: 42px; border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-hi); font-size: 1.2rem; }
.new-kind { align-items: flex-start; padding: .85rem .9rem; }
.new-kind .row-text small { white-space: normal; }
.danger-row b, .danger-row .row-icon { color: #fca5a5; }
.chev { display: inline-flex; font-size: 1.1rem; color: var(--text-3); }

.sheet-wrap {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(3, 4, 10, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: fade var(--dur-2) var(--ease-out);
}
.sheet {
  width: 100%; max-height: 88dvh; overflow: auto; border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--glass-strong); padding-bottom: env(safe-area-inset-bottom);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--hi), var(--shadow-lg);
  animation: rise var(--dur-3) var(--ease-out);
}
.sheet::before { content: ""; display: block; width: 38px; height: 4px; margin: .55rem auto 0; border-radius: 999px; background: rgba(255, 255, 255, .2); }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: .5rem; padding: .5rem .55rem .35rem 1.15rem; }
.sheet-head h2 { flex: 1; font-size: 1.05rem; font-weight: 620; letter-spacing: -.015em; }
.sheet-body { display: flex; flex-direction: column; gap: .55rem; padding: .2rem 1.15rem 1.4rem; }
.sheet-body h3 { margin-top: .8rem; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.sheet .check { min-height: 46px; }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ------------------------------------------------------------ avisos */
#toast {
  position: fixed; left: 50%; bottom: calc(5.5rem + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; width: max-content; max-width: calc(100% - 2rem); align-items: center; gap: .6rem;
  transform: translate(-50%, 16px) scale(.98); border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--glass-strong); padding: .65rem .95rem; font-size: .86rem; opacity: 0; pointer-events: none;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--hi), var(--shadow-lg);
  transition: opacity var(--dur-2) var(--ease-in), transform var(--dur-2) var(--ease-in);
}
#toast::before { content: ""; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--accent-hi); }
#toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); transition-timing-function: var(--ease-out); transition-duration: var(--dur-3); }
#toast.ok::before { background: var(--ok); }
#toast.error { border-color: rgba(248, 113, 113, .35); color: #fecaca; }
#toast.error::before { background: var(--bad); }
#update-bar, #net-bar {
  position: fixed; top: calc(.6rem + env(safe-area-inset-top)); left: 50%; z-index: 70; display: flex; align-items: center; gap: .7rem;
  transform: translateX(-50%); border: 1px solid var(--accent-line); border-radius: 999px; background: var(--glass-strong);
  padding: .35rem .4rem .35rem 1rem; font-size: .84rem; font-weight: 520; white-space: nowrap;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-lg); animation: fade var(--dur-3) var(--ease-out);
}
#net-bar { width: max-content; max-width: calc(100% - 1.5rem); border-color: rgba(251, 191, 36, .4); border-radius: 14px; padding: .5rem .9rem; color: #fde68a; white-space: normal; text-align: center; }

/* ------------------------------------------------------------ login */
.login { width: min(100%, 380px); text-align: center; }
.login.glass-card {
  border: 1px solid var(--line-2); border-radius: 26px; background: var(--glass); padding: 2rem 1.6rem 1.6rem;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--hi), var(--shadow-lg);
  animation: pop-in var(--dur-4) var(--ease-out);
}
.login-logo { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 0 50px rgba(139, 123, 255, .45); }
.login h1 { margin-top: 1.1rem; font-size: 1.75rem; font-weight: 680; letter-spacing: -.035em; }
.login .muted { margin: .35rem 0 1.6rem; }
.login .btn + .btn, .login .glass-btn { margin-top: .55rem; }
.or { position: relative; margin: 1.1rem 0; font-size: .78rem; color: var(--text-3); }
.or::before { content: ''; position: absolute; inset: 50% 0 auto; border-top: 1px solid var(--line); }
.or span { position: relative; background: #12131d; padding: 0 .7rem; }
.gbtn { display: flex; min-height: 44px; justify-content: center; }
.device-login { display: flex; flex-direction: column; align-items: center; gap: .55rem; }
.device-login h1 { margin-top: 0; font-size: 1.4rem; }
.device-login .muted { margin: 0; }
.qr { display: grid; min-height: 220px; place-items: center; border-radius: 18px; background: #fff; padding: .6rem; }
.qr svg { display: block; width: 220px; height: 220px; }
.code { font: 700 2.1rem/1 var(--mono); letter-spacing: .15em; }
.device-card { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; }
.device-icon { font-size: 2.4rem; color: var(--accent-hi); }
.device-warn { border: 1px solid rgba(251, 191, 36, .3); border-radius: var(--r); background: rgba(251, 191, 36, .07); padding: .6rem .8rem; font-size: .85rem; color: #fde68a; }
.device-card .field { align-self: stretch; text-align: left; }
.code-input { text-align: center; font: 700 1.6rem var(--mono); letter-spacing: .4em; }

/* ------------------------------------------------------------ conversa */
.chat { display: flex; height: 100dvh; flex-direction: column; }
.messages {
  display: flex; flex: 1; min-height: 0; flex-direction: column; gap: .75rem; overflow-y: auto;
  overscroll-behavior: contain; padding: 1.2rem max(.85rem, calc((100% - 780px) / 2)) 1.4rem;
}
.msg { max-width: 88%; overflow-wrap: anywhere; font-size: .95rem; line-height: 1.62; }
.msg.user {
  align-self: flex-end; white-space: pre-wrap; border: 1px solid rgba(139, 123, 255, .3); border-radius: 18px 18px 6px 18px;
  background: linear-gradient(180deg, rgba(139, 123, 255, .26), rgba(139, 123, 255, .16)); padding: .6rem .9rem; color: #f4f2ff;
  box-shadow: var(--hi);
}
.msg.claude { position: relative; align-self: stretch; max-width: 100%; padding: .1rem 0 .1rem 2.3rem; color: #e6e6ee; }
.msg.claude::before {
  content: ""; position: absolute; top: .2rem; left: 0; width: 26px; height: 26px; border-radius: 8px;
  background: radial-gradient(circle at 30% 30%, #b6abff, #7c6cff 55%, #4c3fd1); box-shadow: 0 0 18px rgba(139, 123, 255, .35);
}
.msg.claude + .msg.claude::before { display: none; }
.msg.claude.flat { padding: 0; }
.msg.claude.flat::before { display: none; }
.msg.error { align-self: stretch; max-width: 100%; border: 1px solid rgba(248, 113, 113, .3); border-radius: var(--r); background: rgba(248, 113, 113, .07); padding: .6rem .85rem; color: #fecaca; font-size: .86rem; }
.msg.claude p + p, .msg.claude p + ul, .msg.claude p + ol, .msg.claude ul + p, .msg.claude ol + p, .msg.claude pre + p { margin-top: .6rem; }
.msg.claude ul, .msg.claude ol { margin: .35rem 0; padding-left: 1.2rem; }
.msg.claude li + li { margin-top: .2rem; }
.msg.claude li::marker { color: var(--text-3); }
.msg.claude h4 { margin: .8rem 0 .3rem; font-size: 1rem; font-weight: 620; }
.msg.claude strong { font-weight: 620; color: #fff; }
.msg.claude a { color: var(--accent-hi); text-underline-offset: 2px; }
.msg pre, .perm pre, pre.diff, pre.stat {
  margin: .6rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: rgba(0, 0, 0, .4);
  padding: .7rem .85rem;
}
.msg pre code { background: none; padding: 0; font-size: .8rem; line-height: 1.55; }

.tool {
  align-self: stretch; margin-left: 2.3rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--fill);
  font-size: .8rem; transition: border-color var(--dur-2) ease;
}
.tool:hover, .tool[open] { border-color: var(--line-2); }
.tool + .tool { margin-top: -.4rem; }
.tool summary { display: flex; min-height: 36px; align-items: center; gap: .55rem; padding: .3rem .7rem; list-style: none; cursor: pointer; }
.tool summary::-webkit-details-marker { display: none; }
.tool-icon { display: inline-flex; color: var(--text-3); font-size: .95rem; }
.tool summary b { flex-shrink: 0; font-weight: 560; color: var(--text-2); }
.tool-sum { flex: 1; min-width: 0; overflow: hidden; color: var(--text-3); font-family: var(--mono); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.tool-state { display: inline-flex; flex-shrink: 0; color: var(--ok); font-size: .9rem; }
.tool-state .spinner { width: 13px; height: 13px; border-width: 2px; }
.tool.is-error .tool-state { color: var(--bad); }
.tool-out { max-height: 16rem; margin: 0; overflow: auto; border-top: 1px solid var(--line); padding: .6rem .75rem; white-space: pre-wrap; font: .74rem/1.5 var(--mono); color: var(--text-2); }

.perm {
  position: relative; align-self: stretch; margin-left: 2.3rem; overflow: hidden; border: 1px solid rgba(251, 191, 36, .28);
  border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(251, 191, 36, .09), rgba(251, 191, 36, .03));
  padding: .85rem .95rem .85rem 1.1rem; font-size: .88rem; box-shadow: var(--hi);
}
.perm::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--warn); }
.perm.done { border-color: var(--line); background: var(--fill); opacity: .75; }
.perm.done::before { background: var(--text-3); }
.perm-title { display: flex; align-items: center; gap: .4rem; margin-bottom: .35rem; font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #fcd34d; }
.perm.done .perm-title { color: var(--text-3); }
.perm details { margin-top: .35rem; }
.perm summary { color: var(--text-2); font-size: .8rem; cursor: pointer; }
.perm pre { max-height: 14rem; white-space: pre-wrap; font: .74rem/1.45 var(--mono); }
.perm-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.perm-actions .btn { min-width: 7.5rem; }
.perm-actions .muted { font-size: .82rem; }
.question + .question { margin-top: .75rem; }
.options { display: flex; flex-direction: column; gap: .4rem; margin-top: .45rem; }
.options button {
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--fill); padding: .55rem .75rem; text-align: left; font-weight: 560;
  transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease;
}
.options button:hover { background: var(--fill-2); }
.options button small { display: block; margin-top: .15rem; font-weight: 400; color: var(--text-2); }
.options button.picked { border-color: var(--accent-line); background: var(--accent-soft); }

.result { display: inline-flex; align-items: center; gap: .4rem; align-self: center; border: 1px solid rgba(74, 222, 128, .2); border-radius: 999px; background: rgba(74, 222, 128, .06); padding: .2rem .75rem; font-size: .74rem; font-weight: 520; color: #86efac; }
.result.is-error { border-color: rgba(248, 113, 113, .25); background: rgba(248, 113, 113, .06); color: #fca5a5; }
.typing { display: flex; align-self: flex-start; gap: .3rem; margin-left: 2.3rem; padding: .55rem 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-hi); animation: blink 1.2s infinite var(--ease-in-out); }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.notice { display: flex; flex-direction: column; align-items: center; gap: .5rem; align-self: center; max-width: 92%; border: 1px solid var(--line); border-radius: var(--r); background: var(--fill); padding: .55rem .9rem; font-size: .8rem; color: var(--text-2); text-align: center; }
.offline { display: flex; align-items: center; justify-content: center; gap: .5rem; border-bottom: 1px solid rgba(251, 191, 36, .25); background: rgba(251, 191, 36, .08); padding: .45rem .75rem; font-size: .8rem; font-weight: 520; color: #fde68a; }
.chat.is-offline .typing { display: none; }

.suggestions { display: flex; gap: .45rem; overflow-x: auto; padding: 0 max(.85rem, calc((100% - 780px) / 2)) .6rem; scrollbar-width: none; }
.suggestions::-webkit-scrollbar { display: none; }
.suggestions button {
  flex-shrink: 0; border: 1px solid var(--line-2); border-radius: 999px; background: var(--fill); padding: .45rem .85rem;
  font-size: .8rem; font-weight: 500; color: var(--text-2); transition: background-color var(--dur-2) ease, color var(--dur-2) ease, border-color var(--dur-2) ease;
}
.suggestions button:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }

/* caixa de texto: cápsula de vidro flutuando no rodapé */
.composer-dock { padding: 0 max(.6rem, calc((100% - 800px) / 2)) calc(.7rem + env(safe-area-inset-bottom)); }
.attachments { display: flex; gap: .45rem; overflow-x: auto; padding: 0 0 .5rem; scrollbar-width: none; }
.composer {
  display: flex; align-items: flex-end; gap: .35rem; border: 1px solid var(--line-2); border-radius: 22px;
  background: var(--glass); padding: .4rem; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--hi), var(--shadow-lg); transition: border-color var(--dur-2) ease, box-shadow var(--dur-2) ease;
}
.composer:focus-within { border-color: var(--accent-line); box-shadow: var(--hi), var(--shadow-lg), 0 0 0 4px rgba(139, 123, 255, .1); }
.composer textarea {
  flex: 1; min-height: 40px; max-height: 160px; resize: none; border: 0; background: transparent;
  padding: .55rem .35rem; font-size: 16px; line-height: 1.4; color: var(--text); outline: none;
}
.composer .attach { display: inline-flex; width: 40px; height: 40px; flex-shrink: 0; align-items: center; justify-content: center; border: 0; border-radius: 14px; background: none; font-size: 1.15rem; color: var(--text-2); transition: background-color var(--dur-2) ease, color var(--dur-2) ease; }
.composer .attach:hover { background: var(--fill-2); color: var(--text); }
.composer .send, .composer .stop {
  display: inline-flex; width: 40px; height: 40px; flex-shrink: 0; align-items: center; justify-content: center;
  border: 0; border-radius: 14px; font-size: 1.15rem; color: #fff;
  transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2) ease;
}
.composer .send { background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0)), var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 14px rgba(139, 123, 255, .4); }
.composer .send:hover { filter: brightness(1.08); }
.composer .send:active, .composer .stop:active { transform: scale(.92); }
.composer .stop { display: none; background: rgba(248, 113, 113, .16); color: #fca5a5; font-size: .9rem; }
.chat.is-busy .composer .send { display: none; }
.chat.is-busy .composer .stop { display: inline-flex; }
.att { display: flex; flex-shrink: 0; align-items: center; gap: .45rem; max-width: 15rem; border: 1px solid var(--line-2); border-radius: 12px; background: var(--glass); padding: .3rem .35rem .3rem .3rem; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.att.is-loading { opacity: .6; }
.att img, .att .att-icon { width: 36px; height: 36px; flex-shrink: 0; border-radius: 8px; object-fit: cover; }
.att .att-icon { display: inline-flex; align-items: center; justify-content: center; background: var(--fill-2); color: var(--text-2); }
.att-name { min-width: 0; overflow: hidden; font-size: .78rem; font-weight: 520; text-overflow: ellipsis; white-space: nowrap; }
.att-name small { display: block; font-weight: 400; color: var(--text-3); }
.att button { display: inline-flex; flex-shrink: 0; border: 0; background: none; padding: .25rem; color: var(--text-3); }
.msg-files { display: flex; flex-wrap: wrap; gap: .4rem; }
.msg-files + div { margin-top: .45rem; }
.msg-img { display: block; max-width: min(240px, 100%); max-height: 240px; border-radius: 10px; object-fit: cover; }
.msg-file { display: inline-flex; align-items: center; gap: .35rem; border-radius: 10px; background: rgba(255, 255, 255, .12); padding: .35rem .6rem; font-size: .82rem; color: #fff; text-decoration: none; }
.msg-file small { opacity: .75; }

.to-bottom {
  position: fixed; right: max(1rem, calc(50vw - 400px)); bottom: calc(6rem + env(safe-area-inset-bottom)); z-index: 20;
  display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--glass-strong); font-size: 1.1rem; color: var(--text);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-lg); animation: pop-in var(--dur-2) var(--ease-out);
}

/* ------------------------------------------------------------ terminal (tela cheia) */
.terminal { display: flex; height: 100dvh; flex-direction: column; }
.terminal iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: #000; }
.keys {
  display: flex; gap: .35rem; overflow-x: auto; border-top: 1px solid var(--line); background: rgba(7, 8, 13, .8);
  padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom)); scrollbar-width: none;
}
.keys::-webkit-scrollbar { display: none; }
.keys button {
  min-width: 46px; min-height: 38px; flex-shrink: 0; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--fill-2); padding: 0 .7rem; font: 560 .8rem var(--mono); color: var(--text-2);
}
.keys button:active { background: var(--accent-soft); color: var(--text); }

/* ------------------------------------------------------------ pedidos de push e diff */
.note { margin-top: .6rem; border-left: 2px solid var(--accent-line); padding: .2rem 0 .2rem .75rem; font-size: .9rem; color: #dcd8ff; }
.commits { margin: 0; padding-left: 1.1rem; font-size: .87rem; }
.commits li + li { margin-top: .25rem; }
.commits code { font: .78rem var(--mono); color: var(--text-3); }
pre.stat { margin: 0; white-space: pre; font: .75rem/1.5 var(--mono); color: var(--text-2); }
.diff-card summary, .card > summary { cursor: pointer; font-weight: 560; }
pre.diff { max-height: 60vh; margin-bottom: 0; white-space: pre; font: .72rem/1.55 var(--mono); }
pre.diff .add { color: #86efac; }
pre.diff .del { color: #fca5a5; }
pre.diff .hunk { color: #a5b4fc; }
pre.diff .file { color: #fde68a; font-weight: 600; }
.decide {
  position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1.4fr; gap: .6rem;
  background: linear-gradient(180deg, transparent, var(--bg) 40%); padding: 1rem 0 calc(.5rem + env(safe-area-inset-bottom));
}
.decide .btn { min-height: 50px; }

/* ------------------------------------------------------------ uso do Claude */
.usage-meta { margin: 0 0 .1rem; }
.meter-card { display: flex; flex-direction: column; gap: .5rem; }
.meter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.meter-head b { font-weight: 600; }
.meter-head small { display: block; margin-top: .1rem; font-size: .76rem; color: var(--text-3); }
.meter-state { display: inline-flex; flex-shrink: 0; align-items: center; gap: .3rem; border-radius: 999px; padding: .18rem .6rem; font-size: .74rem; font-weight: 560; }
.meter-state.ok { background: rgba(74, 222, 128, .08); color: #86efac; }
.meter-state.warning { background: rgba(251, 191, 36, .1); color: #fcd34d; }
.meter-state.critical { background: rgba(248, 113, 113, .12); color: #fca5a5; }
.meter-value { font-size: 2.1rem; font-weight: 680; line-height: 1.1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.meter-value small { font-size: .85rem; font-weight: 500; letter-spacing: 0; color: var(--text-3); }
.meter { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(139, 123, 255, .16); }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width var(--dur-4) var(--ease-out); }
.meter.warning { background: rgba(251, 191, 36, .16); }
.meter.warning i { background: var(--warn); }
.meter.critical { background: rgba(248, 113, 113, .16); }
.meter.critical i { background: var(--bad); }
.meter-reset { margin: 0; font-size: .84rem; color: var(--text-2); }
.share-list { display: flex; flex-direction: column; gap: .75rem; }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: .35rem .6rem; align-items: baseline; font-size: .85rem; }
.share-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.share-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .06); }
.share-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.day-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; align-items: end; height: 120px; }
.day { display: flex; height: 100%; flex-direction: column; align-items: stretch; gap: .3rem; border: 0; background: none; padding: 0; color: var(--text-3); }
.day-col { position: relative; flex: 1; border-bottom: 1px solid var(--line); }
.day-col i { position: absolute; bottom: 0; left: 20%; right: 20%; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--accent-hi), rgba(139, 123, 255, .35)); }
.day.is-picked .day-col i { background: linear-gradient(180deg, var(--cyan), rgba(94, 234, 212, .35)); }
.day small { font-size: .7rem; text-align: center; }
.day.is-picked small { color: var(--text); font-weight: 600; }

/* celular: etiqueta de estado da conversa vai para baixo do título */
@media (max-width: 599.98px) {
  .conv { grid-template-columns: auto 1fr; }
  .conv-state { grid-column: 2; grid-row: auto; justify-self: start; margin-top: .35rem; }
  .strip-item small { display: none; }
}

/* ------------------------------------------------------------ barra lateral (computador) */
.side { display: none; }
.only-desktop { display: none; }
#usage-strip:empty { display: none; }

/* ------------------------------------------------------------ movimento */
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sink { to { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } }
@keyframes shine { to { transform: translateX(100%); } }

/* mensagem nova na conversa (o histórico que chega em lote não anima) */
.enter { animation: enter var(--dur-3) var(--ease-out) both; }
/* listas: os primeiros itens entram em cascata quando chegam do servidor */
.list.appear > * { animation: enter var(--dur-3) var(--ease-out) both; }
.list.appear > :nth-child(2) { animation-delay: 30ms; }
.list.appear > :nth-child(3) { animation-delay: 60ms; }
.list.appear > :nth-child(4) { animation-delay: 90ms; }
.list.appear > :nth-child(5) { animation-delay: 120ms; }
.list.appear > :nth-child(n+6) { animation-delay: 150ms; }
/* folhas também saem animadas */
.sheet-wrap.is-closing { pointer-events: none; animation: fade-out var(--dur-2) var(--ease-in) forwards; }
.sheet-wrap.is-closing .sheet { animation: sink var(--dur-2) var(--ease-in) forwards; }
/* selo de contagem: pula ao aparecer */
.badge:not([hidden]) { animation: pop var(--dur-3) var(--ease-pop) both; }

/* esqueleto de carregamento */
.skel {
  position: relative; display: flex; flex-direction: column; gap: .55rem; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--fill); padding: .95rem 1rem;
}
.skel i { display: block; height: .65rem; border-radius: 6px; background: rgba(255, 255, 255, .07); }
.skel i:nth-child(1) { width: 30%; }
.skel i:nth-child(2) { width: 86%; height: .8rem; }
.skel i:nth-child(3) { width: 52%; }
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
  animation: shine 1.2s var(--ease-in-out) infinite;
}
.skel.row-skel { border-radius: var(--r); padding: .75rem; }
.skel.row-skel i:nth-child(3) { display: none; }

/* =====================================================================
   Painel de trabalho (terminal e, depois, Mudanças / Prévia / Arquivos)
   Computador: coluna da direita, com largura ajustável.
   Celular e tablet: folha que sobe de baixo; arrastar para baixo fecha.
   ===================================================================== */
.bench {
  position: fixed; z-index: 40; display: flex; flex-direction: column; visibility: hidden;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--hi), var(--shadow-lg);
  transition: transform var(--dur-3) var(--ease-in), visibility 0s linear var(--dur-3);
}
.bench.is-open { visibility: visible; transform: none; transition: transform var(--dur-3) var(--ease-out), visibility 0s; }
.bench.is-dragging { transition: none; }
.bench-head { display: flex; min-height: 60px; flex-shrink: 0; align-items: center; gap: .5rem; border-bottom: 1px solid var(--line); padding: .45rem .5rem .45rem .7rem; }
.seg { display: flex; flex-shrink: 0; gap: .2rem; border: 1px solid var(--line); border-radius: 11px; background: var(--fill); padding: .2rem; }
.seg button {
  display: inline-flex; align-items: center; gap: .4rem; border: 0; border-radius: 8px; background: none; padding: .35rem .7rem;
  font-size: .82rem; font-weight: 560; color: var(--text-2); transition: background-color var(--dur-2) ease, color var(--dur-2) ease;
}
.seg button:hover { color: var(--text); }
.seg button.is-on { background: var(--fill-3); color: var(--text); box-shadow: var(--hi); }
.bench-project { flex: 1; min-width: 0; overflow: hidden; font: .76rem var(--mono); color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
.bench-body { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.bench-pane[hidden] { display: none; }
.bench-pane { display: flex; flex: 1; min-height: 0; flex-direction: column; animation: fade var(--dur-2) var(--ease-out); }
.bench-pane iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: #000; }
.bench-pane .center { flex: 1; min-height: 0; }
.bench-bar { display: flex; flex-shrink: 0; align-items: center; gap: .5rem; border-top: 1px solid var(--line); padding: .4rem .5rem .4rem .8rem; font-size: .76rem; color: var(--text-3); }
.bench-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench .keys { background: transparent; padding-bottom: .45rem; }
.bench-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(3, 4, 10, .5); opacity: 0; pointer-events: none; transition: opacity var(--dur-3) ease; }
.bench-scrim.is-on { opacity: 1; pointer-events: auto; }

@media (max-width: 1023.98px) {
  .bench {
    inset: auto 0 0 0; height: 88dvh; border: 1px solid var(--line-2); border-bottom: 0; border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding-bottom: env(safe-area-inset-bottom); transform: translateY(100%);
  }
  .bench-grip { width: 38px; height: 4px; flex-shrink: 0; margin: .55rem auto 0; border-radius: 999px; background: rgba(255, 255, 255, .22); }
  .bench-head { touch-action: none; min-height: 52px; }
}
@media (min-width: 1024px) and (pointer: fine) { .bench .keys { display: none; } }
body.is-resizing { transition: none; cursor: col-resize; user-select: none; }
body.is-resizing iframe { pointer-events: none; }

/* =====================================================================
   Tablet e computador
   ===================================================================== */
@media (min-width: 720px) {
  /* folhas viram janela no meio da tela */
  .sheet-wrap { align-items: center; padding: 1.5rem; }
  .sheet { width: min(100%, 540px); max-height: 82dvh; border-bottom: 1px solid var(--line-2); border-radius: var(--r-xl); animation: pop-in var(--dur-3) var(--ease-out); }
  .sheet::before { display: none; }
  .sheet-head { padding-top: .8rem; }
  .sheet-wrap.is-closing .sheet { animation: pop-out var(--dur-2) var(--ease-in) forwards; }
  .msg { max-width: 80%; }
}

@media (min-width: 1024px) {
  body.has-side { padding-left: var(--side-w); }
  body.has-side .fab, body.has-side .tabs, body.has-side .bar-logo, body.has-side .m-only { display: none; }
  body.has-side .only-mobile { display: none; }
  body.has-side .only-desktop { display: inline; }
  .bar { min-height: 64px; padding: .5rem 1rem; background: rgba(7, 8, 13, .35); }
  .bar h1 { font-size: 1.1rem; }
  .chat, .terminal { height: 100dvh; }
  .home-top { margin-top: 1.1rem; }
  .list { padding-top: 1rem; }

  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: var(--side-w); flex-direction: column; gap: .2rem;
    border-right: 1px solid var(--line); background: rgba(10, 11, 18, .55); padding: .9rem .7rem .75rem;
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  }
  .side-brand { display: flex; align-items: center; gap: .6rem; padding: .2rem .45rem .9rem; font-size: 1rem; font-weight: 650; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
  .side-brand img { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 0 20px rgba(139, 123, 255, .4); }
  .side-new { justify-content: flex-start; margin-bottom: .7rem; padding: 0 .8rem; }
  .side-nav, .side-list { display: flex; flex-direction: column; gap: .1rem; }
  .side-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -.2rem; padding: 0 .2rem; }
  .side-label { margin: 1rem .55rem .35rem; font-size: .68rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
  .side-item {
    position: relative; display: flex; align-items: center; gap: .6rem; border-radius: 9px; padding: .48rem .6rem;
    font-size: .87rem; font-weight: 500; color: var(--text-2); text-decoration: none;
    transition: background-color var(--dur-2) ease, color var(--dur-2) ease;
  }
  .side-item .i { font-size: 1.02rem; color: var(--text-3); transition: color var(--dur-2) ease; }
  .side-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-item:hover { background: var(--fill-2); color: var(--text); }
  .side-item:hover .i { color: var(--text-2); }
  .side-item.is-current { background: var(--fill-3); color: var(--text); box-shadow: var(--hi); }
  .side-item.is-current .i { color: var(--accent-hi); }
  .side-item.is-current::before { content: ""; position: absolute; top: 25%; bottom: 25%; left: -.7rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
  .side-item em { min-width: 18px; border-radius: 999px; background: var(--accent); padding: 0 5px; font-size: .66rem; font-style: normal; font-weight: 700; line-height: 18px; color: #fff; text-align: center; }
  .side-user { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; border-top: 1px solid var(--line); padding: .75rem .3rem 0; }
  .side-user .avatar { margin: 0; }
  .side-user > span:not(.avatar) { flex: 1; min-width: 0; overflow: hidden; font-size: .8rem; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }

  .list.grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .home .list, .home-top { width: min(calc(100% - 3rem), 980px); }
  .checks { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
  .to-bottom { right: 1.5rem; }

  /* painel de trabalho */
  /* largura escolhida pela pessoa (--bench-user), sem esmagar a conversa */
  :root { --bench-w: clamp(340px, var(--bench-user, 42vw), max(340px, calc(100vw - 700px))); }
  body { transition: padding-right var(--dur-3) var(--ease-out); }
  body.has-bench { padding-right: var(--bench-w); }
  body.has-bench .to-bottom { right: calc(var(--bench-w) + 1.25rem); }
  .bench { inset: 0 0 0 auto; width: var(--bench-w); border-left: 1px solid var(--line); transform: translateX(100%); }
  .bench-grip { position: absolute; inset: 0 auto 0 -5px; z-index: 2; width: 10px; cursor: col-resize; }
  .bench-grip::after {
    content: ""; position: absolute; top: 50%; left: 4px; width: 2px; height: 44px; transform: translateY(-50%);
    border-radius: 2px; background: rgba(255, 255, 255, .3); opacity: 0; transition: opacity var(--dur-2) ease;
  }
  .bench-grip:hover::after, body.is-resizing .bench-grip::after { opacity: 1; }
  .bench-scrim { display: none; }
}

/* ------------------------------------------------------------ acessibilidade */
@media (prefers-reduced-transparency: reduce) {
  .bar, .composer, .sheet, .side, #toast, #update-bar, #net-bar, .to-bottom, .bench, .att, .login.glass-card {
    background: #12131d; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .bar, .composer, .sheet, .side, #toast, #update-bar, #net-bar, .to-bottom, .bench, .att, .login.glass-card { background: #12131d; }
}
/* quem pede menos movimento: tudo vira troca instantânea; o fundo para,
   o brilho do esqueleto some e o indicador de carregando gira devagar */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
  body::before { animation: none !important; }
  .skel::after { display: none; }
  .spinner { animation: spin 1.6s linear infinite !important; }
}

/* =====================================================================
   Aba Mudanças: lista de arquivos alterados com o diff de cada um
   ===================================================================== */
.changes { display: flex; flex: 1; min-height: 0; flex-direction: column; overflow-y: auto; transition: opacity var(--dur-2) ease; }
.changes.is-loading { opacity: .55; pointer-events: none; }
.changes > .skel { margin: .6rem .7rem 0; }
.ctool { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .45rem; border-bottom: 1px solid var(--line); background: var(--glass-strong); padding: .5rem .6rem; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.csource { position: relative; display: flex; flex: 1; min-width: 0; align-items: center; color: var(--text-3); }
.csource > .i:first-child { position: absolute; left: .65rem; pointer-events: none; }
.csource > .i:last-child { position: absolute; right: .6rem; pointer-events: none; }
.csource select {
  width: 100%; min-height: 34px; appearance: none; border: 1px solid var(--line-2); border-radius: 10px; background: var(--fill);
  padding: 0 2rem 0 2.1rem; font-size: .82rem; font-weight: 520; color: var(--text); text-overflow: ellipsis; cursor: pointer;
}
.csource select:focus { outline: none; border-color: var(--accent-line); }
.csource option, .csource optgroup { background: #12131d; color: var(--text); }
.seg.small button { padding: .3rem .5rem; font-size: .95rem; }
.csummary { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; padding: .7rem .8rem .3rem; }
.csummary .ctitle { flex-basis: 100%; font-weight: 600; }
.csummary .muted { flex: 1; }
.plus { color: #86efac; font-variant-numeric: tabular-nums; }
.minus { color: #fca5a5; font-variant-numeric: tabular-nums; }
.cfiles { display: flex; flex-direction: column; gap: .5rem; padding: .5rem .6rem 1rem; }
.cfiles .empty { margin-top: 1rem; }
.cfiles .empty b { color: var(--text); font-weight: 600; }
.dfile { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--fill); }
.dfile[open] { border-color: var(--line-2); }
.dfile > summary { display: flex; min-height: 40px; align-items: center; gap: .6rem; padding: .4rem .6rem; list-style: none; cursor: pointer; }
.dfile > summary::-webkit-details-marker { display: none; }
.dfile > summary:hover { background: var(--fill-2); }
.dstatus { display: inline-flex; flex-shrink: 0; align-items: center; gap: .25rem; border-radius: 6px; padding: .1rem .35rem; font-size: .7rem; }
.dstatus b { font-weight: 700; }
.dstatus.modified { background: rgba(251, 191, 36, .1); color: #fcd34d; }
.dstatus.added { background: rgba(74, 222, 128, .1); color: #86efac; }
.dstatus.deleted { background: rgba(248, 113, 113, .1); color: #fca5a5; }
.dstatus.renamed { background: rgba(96, 165, 250, .1); color: #93c5fd; }
.dpath { flex: 1; min-width: 0; overflow: hidden; font: 500 .8rem var(--mono); text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.dpath small { font-size: 1em; color: var(--text-3); }
.dcount { display: inline-flex; flex-shrink: 0; align-items: center; gap: .4rem; font: 600 .74rem var(--mono); }
.cbar { display: inline-flex; gap: 2px; }
.cbar i { width: 7px; height: 7px; border-radius: 2px; }
.cbar i.a { background: #4ade80; }
.cbar i.d { background: #f87171; }
.dchev { display: inline-flex; color: var(--text-3); transition: transform var(--dur-2) var(--ease-out); }
.dfile[open] .dchev { transform: rotate(180deg); }
.dbody { border-top: 1px solid var(--line); }
.dfile[open] .dbody { animation: fade var(--dur-2) var(--ease-out); }
.dscroll { max-height: 70vh; overflow: auto; background: rgba(0, 0, 0, .3); }
.dnote { display: flex; align-items: center; gap: .45rem; padding: .6rem .8rem; font-size: .8rem; color: var(--text-3); }
.dnote code { font: .78rem var(--mono); color: var(--text-2); }
.diff-table { width: 100%; min-width: max-content; border-collapse: collapse; font: .74rem/1.55 var(--mono); }
.diff-table .ln-col { width: 3.2em; }
.diff-table td { padding: 0 .55rem; vertical-align: top; white-space: pre; }
.diff-table td.ln { position: sticky; left: 0; min-width: 3.2em; padding: 0 .45rem; color: var(--text-3); text-align: right; user-select: none; background: rgba(12, 13, 20, .96); }
.diff-table td.ln + td.ln { left: 3.2em; }
.diff-table .dcode { color: #d4d4de; }
.diff-table .sign { display: inline-block; width: 1.1em; color: var(--text-3); user-select: none; }
.diff-table tr.add td, .diff-table td.add { background: rgba(74, 222, 128, .1); }
.diff-table tr.add td.ln, .diff-table td.ln.add { background: rgba(22, 50, 33, .96); color: #86efac; }
.diff-table tr.add .sign { color: #86efac; }
.diff-table tr.del td, .diff-table td.del { background: rgba(248, 113, 113, .1); }
.diff-table tr.del td.ln, .diff-table td.ln.del { background: rgba(56, 25, 28, .96); color: #fca5a5; }
.diff-table tr.del .sign { color: #fca5a5; }
.diff-table td.empty { background: rgba(255, 255, 255, .02); }
.diff-table .d-hunk td { padding: .2rem .7rem; background: rgba(139, 123, 255, .08); color: #b8b0ff; font-size: .7rem; }
.diff-table.split { min-width: 100%; table-layout: fixed; }
.diff-table.split td.dcode { white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-table.split td.ln { position: static; }
.diff-table.split td.dcode + td.ln { border-left: 1px solid var(--line); }

/* =====================================================================
   Dashboard: indicadores, colunas por dia, agentes e ranking
   ===================================================================== */
.dash { gap: .75rem; }
.dash-scope { display: flex; align-items: center; gap: .4rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; }
.tile {
  display: flex; flex-direction: column; gap: .2rem; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02)); padding: .9rem 1rem; box-shadow: var(--hi);
}
.tile-label { font-size: .78rem; font-weight: 520; color: var(--text-2); }
.tile-value { font-size: 1.9rem; font-weight: 640; line-height: 1.15; letter-spacing: -.035em; }
.delta { display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; color: var(--text-3); }
.delta.up .i { color: var(--ok); }
.delta.down .i { color: var(--bad); }

.cols { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; height: 150px; }
.col { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: .35rem; border: 0; border-radius: 8px; background: none; padding: .2rem 0 0; color: var(--text-3); }
.col-plot { position: relative; display: flex; width: 100%; flex: 1; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line-2); }
.col-plot i { display: block; width: min(24px, 60%); border-radius: 4px 4px 0 0; background: var(--accent); transition: filter var(--dur-2) ease, height var(--dur-4) var(--ease-out); }
.col-val { position: absolute; bottom: calc(100% + 2px); left: 0; right: 0; font-size: .72rem; font-weight: 600; color: var(--text); text-align: center; }
.col:hover .col-plot i, .col:focus-visible .col-plot i, .col.is-picked .col-plot i { filter: brightness(1.25); }
.col.is-picked small { color: var(--text); font-weight: 600; }
.col small { font-size: .72rem; }
.cols .col:has(.col-val) .col-plot { padding-top: 1.1rem; }
.chart-tip { min-height: 1.2em; margin-top: .5rem; }
.table-view { margin-top: .6rem; font-size: .8rem; }
.table-view summary { color: var(--text-2); cursor: pointer; }
.table-view table { width: 100%; margin-top: .5rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { border-bottom: 1px solid var(--line); padding: .35rem .4rem; text-align: right; }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-view th { font-weight: 560; color: var(--text-3); }

.ranks { display: flex; flex-direction: column; gap: .5rem; }
.rank { display: grid; grid-template-columns: minmax(6rem, 30%) 1fr auto; align-items: center; gap: .7rem; border-radius: 8px; font-size: .84rem; }
.rank:focus-visible { outline-offset: 4px; }
.rank-name { overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.rank-track { height: 10px; }
.rank-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.rank:hover .rank-track i { filter: brightness(1.2); }
.rank-val { min-width: 2.5rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .6rem; align-items: start; }
.agent { display: flex; flex-direction: column; gap: .6rem; }
.agent.is-on { grid-column: 1 / -1; }
.agent .card-head .chip { flex-shrink: 0; }
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .6rem; }
.meters .meter-card { border: 1px solid var(--line); border-radius: var(--r); background: rgba(0, 0, 0, .15); padding: .8rem .9rem; box-shadow: none; }
.meters .meter-value { font-size: 1.6rem; }

/* =====================================================================
   Primeiros passos: tour e cartão da tela inicial
   ===================================================================== */
.tour { position: relative; display: flex; max-width: 460px; flex-direction: column; align-items: center; gap: .55rem; padding: 2rem 1.6rem 1.5rem !important; text-align: center; }
.tour::before { display: none; }
.tour-skip { position: absolute; top: .6rem; right: .6rem; }
.tour-art {
  display: grid; width: 88px; height: 88px; place-items: center; margin-bottom: .4rem; border: 1px solid var(--accent-line); border-radius: 26px;
  background: radial-gradient(circle at 30% 25%, rgba(168, 156, 255, .35), rgba(139, 123, 255, .08) 60%), var(--fill);
  font-size: 2.3rem; color: var(--accent-hi); box-shadow: 0 0 50px rgba(139, 123, 255, .3), var(--hi);
  animation: pop-in var(--dur-4) var(--ease-out);
}
.tour-count { font-size: .74rem; font-weight: 560; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tour h2 { font-size: 1.35rem; font-weight: 650; letter-spacing: -.025em; }
.tour-text { max-width: 36ch; color: var(--text-2); line-height: 1.6; animation: fade var(--dur-3) var(--ease-out); }
.tour-text b { color: var(--text); font-weight: 600; }
.tour-dots { display: flex; gap: .4rem; margin: .6rem 0 .3rem; }
.tour-dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--line-3); transition: width var(--dur-3) var(--ease-out), background-color var(--dur-2) ease; }
.tour-dots i.on { width: 22px; background: var(--accent); }
.tour-actions { display: grid; width: 100%; grid-template-columns: 1fr 1.6fr; gap: .5rem; margin-top: .4rem; }
.tour-wrap .sheet { animation: pop-in var(--dur-3) var(--ease-out); }
@media (max-width: 719.98px) { .tour-wrap { align-items: center; padding: 1rem; } .tour-wrap .sheet { border-bottom: 1px solid var(--line-2); border-radius: var(--r-xl); } }

#first-steps:empty { display: none; }
.steps {
  border: 1px solid var(--accent-line); border-radius: var(--r-lg); padding: .85rem .9rem .5rem;
  background: linear-gradient(160deg, rgba(139, 123, 255, .14), rgba(94, 234, 212, .04) 70%), var(--fill); box-shadow: var(--hi), var(--shadow);
  animation: enter var(--dur-3) var(--ease-out);
}
.steps-head { display: flex; align-items: center; gap: .7rem; }
.steps-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-hi); font-size: 1.1rem; }
.steps-title { display: flex; flex: 1; flex-direction: column; }
.steps-title b { font-weight: 620; }
.steps-title small { font-size: .78rem; color: var(--text-2); }
.steps-bar { height: 4px; margin: .7rem 0 .3rem; overflow: hidden; border-radius: 999px; background: rgba(139, 123, 255, .16); }
.steps-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width var(--dur-4) var(--ease-out); }
.steps-list { display: flex; margin: 0; padding: 0; flex-direction: column; list-style: none; }
.steps-list li { display: flex; align-items: center; gap: .7rem; border-top: 1px solid var(--line); padding: .55rem 0; }
.steps-list li:first-child { border-top: 0; }
.step-check { display: grid; width: 28px; height: 28px; flex-shrink: 0; place-items: center; border: 1px solid var(--line-2); border-radius: 999px; font-size: .9rem; color: var(--text-2); }
.is-done .step-check { border-color: rgba(74, 222, 128, .35); background: rgba(74, 222, 128, .12); color: var(--ok); }
.step-text { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.step-text b { font-size: .88rem; font-weight: 560; }
.step-text small { font-size: .76rem; color: var(--text-3); }
.is-done .step-text b { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-3); }
.help-steps { margin: 0; padding-left: 1.2rem; line-height: 1.6; }
.help-steps li + li { margin-top: .35rem; }
.help-steps code { border-radius: 6px; background: var(--fill-3); padding: .05rem .35rem; font: .86em var(--mono); }

/* seletor de modelo e permissões na barra da conversa */
.model-pill .i { color: var(--cyan); }
.mode-pill.is-danger { border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .1); color: #fca5a5; }
.mode-pill.is-danger .i { color: #fca5a5; }
@media (max-width: 479.98px) {
  /* celular estreito: permissões viram só o ícone (o nome fica no toque) */
  #mode-text { display: none; }
  .model-pill > .i { display: none; }
  .model-pill { padding: .32rem .6rem; }
  .mode-pill { padding: .32rem .55rem; }
}
.start-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem; }
.pill-sep { color: var(--text-3); }
.effort-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.effort-grid button {
  min-height: 40px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--fill); padding: .35rem .4rem;
  font-size: .82rem; font-weight: 560; color: var(--text-2); transition: background-color var(--dur-2) ease, border-color var(--dur-2) ease, color var(--dur-2) ease;
}
.effort-grid button:hover { background: var(--fill-2); color: var(--text); }
.effort-grid button.is-on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.effort-help { min-height: 2.6em; }
