/* ============================================================================
   ZEUS · WORKSPACE — UI premium do app (/app).
   Identidade: trevas, mármore, olhos vermelhos. Cantos retos. Mono + display.
   Depende de /brand/tokens.css (cores + fontes). Nível de craft: site de vendas.
   ========================================================================== */

:root {
  /* superfícies */
  --bg: #141414;
  --panel: #161616;
  --surface: #1E1E1E;
  --surface-2: #242424;
  --inset: #131313;
  --olho-bg: #1A1313;

  /* texto */
  --text: #F1ECE1;
  --muted: #9A958C;
  --faint: #6E6A62;
  --faint-2: #6A665E;

  /* traços */
  --line: #3A3A3A;
  --line-soft: #242424;

  /* acento — o olho */
  --olho: #E3312B;
  --olho-dark: #B8231E;
  --olho-10: rgba(227, 49, 43, 0.10);
  --olho-18: rgba(227, 49, 43, 0.18);
  --olho-40: rgba(227, 49, 43, 0.40);
  --olho-55: rgba(227, 49, 43, 0.55);

  /* fontes (de tokens.css) */
  --disp: var(--zeus-fonte-titulo, "Big Shoulders Display", Impact, sans-serif);
  --mono: var(--zeus-fonte-rotulo, "JetBrains Mono", ui-monospace, monospace);
  --body: var(--zeus-fonte-texto, "Inter", system-ui, sans-serif);

  /* movimento — pesado */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 220ms;
  --t: 420ms;
  --t-heavy: 620ms;
  --glow: 0 0 26px rgba(227, 49, 43, 0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.app {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }
::selection { background: var(--olho); color: var(--text); }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* scrollbars discretas */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #2A2A2A; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #3A3A3A; }

/* ---------------------------------------------------------------- tipografia */
.rotulo {
  font-family: var(--mono); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted); margin: 0;
}
.disp {
  font-family: var(--disp); font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.02em; line-height: 0.88; margin: 0;
}
.vermelho { color: var(--olho); }

/* ---------------------------------------------------------------- atmosfera */
.atmosphere { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: var(--bg); }
.atmosphere canvas { width: 100%; height: 100%; display: block; }
.atmosphere-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(130% 90% at 50% -10%, transparent 42%, rgba(8, 7, 7, 0.55) 100%),
    linear-gradient(180deg, rgba(20, 20, 20, 0.15), rgba(16, 14, 14, 0.5));
}

/* ---------------------------------------------------------------- botões */
.primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.12em;
  background: var(--text); color: var(--bg);
  border: 1.5px solid var(--text); border-radius: 0;
  min-height: 50px; padding: 0 26px; cursor: pointer;
  transition: box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease), color var(--t) var(--ease);
}
.primary-button:hover { box-shadow: 0 0 34px var(--olho-55); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { opacity: 0.4; cursor: default; box-shadow: none; transform: none; }
.primary-button:focus-visible { outline: 2px solid var(--olho); outline-offset: 3px; }

.secondary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.12em;
  background: transparent; color: var(--text);
  border: 1.5px solid #4A4A4A; border-radius: 0;
  min-height: 50px; padding: 0 22px; cursor: pointer;
  transition: border-color var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.secondary-button:hover { border-color: var(--olho); color: var(--olho); }
.secondary-button:disabled { opacity: 0.4; cursor: default; }
.secondary-button.danger { border-color: #4A2320; color: var(--olho); }
.secondary-button.danger:hover { border-color: var(--olho); box-shadow: 0 0 22px var(--olho-40); }

.text-link {
  background: none; border: 0; cursor: pointer; padding: 6px 0;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--olho); transition: color var(--t-fast) var(--ease);
}
.text-link:hover { color: var(--text); }

.icon-round, .icon-button {
  flex: 0 0 auto; display: grid; place-items: center; cursor: pointer;
  border-radius: 0; background: transparent; color: var(--muted);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.icon-round { width: 40px; height: 40px; border: 1px solid var(--line); }
.icon-round:hover { color: var(--text); border-color: var(--olho); }
.icon-round svg { width: 18px; height: 18px; }
.icon-button { width: 36px; height: 36px; border: 0; }
.icon-button:hover { color: var(--text); }
.icon-button svg { width: 18px; height: 18px; }

/* ================================================================ SPLASH */
.splash {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  padding: 24px; overflow: hidden;
  background: rgba(10, 9, 9, 0.62); backdrop-filter: blur(8px);
  transition: opacity 0.7s var(--ease), visibility 0.7s var(--ease);
}
.splash.dismissed { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-content {
  position: relative; z-index: 2; background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 22px; color: var(--text);
}
.splash-mark { width: min(230px, 46vw); position: relative; }
.splash-mark img { width: 100%; filter: drop-shadow(0 0 42px rgba(227, 49, 43, 0.42)); }
.splash-word {
  font-family: var(--disp); font-weight: 900; font-size: clamp(3rem, 11vw, 6.4rem);
  letter-spacing: 0.06em; line-height: 0.78; text-transform: uppercase;
}
.splash-hint {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 10px;
}
.splash-hint::before { content: ""; width: 20px; height: 2px; background: var(--olho); }
.splash-sign {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--faint); margin-top: 2px;
}
.z-flash {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 42%, rgba(227, 49, 43, 0.2), transparent 60%);
  transition: opacity 120ms var(--ease);
}
.z-flash.on { opacity: 1; }
.fx-bolt-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

/* ================================================================ GATE */
.account-gate {
  position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 24px;
  background: rgba(10, 9, 9, 0.78); backdrop-filter: blur(12px);
}
.account-card {
  position: relative; width: 100%; max-width: 480px;
  background: var(--panel); border: 1px solid var(--line); padding: 40px 36px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6), 0 0 60px rgba(227, 49, 43, 0.08);
}
.account-card::before {
  content: ""; position: absolute; top: -1px; left: -1px; width: 46px; height: 3px; background: var(--olho);
}
.account-head { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.account-head img { height: 30px; width: auto; filter: drop-shadow(0 0 12px rgba(227, 49, 43, 0.5)); }
.account-eyebrow {
  font-family: var(--mono); font-weight: 700; font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--olho);
}
.account-card h1 {
  font-family: var(--disp); font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em;
  font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 0.92; margin: 0 0 12px;
}
.account-lead { color: var(--muted); font-size: 0.95rem; margin: 0 0 26px; max-width: 42ch; }
.account-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.account-form label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.field {
  background: var(--inset); border: 1px solid var(--line); border-radius: 0;
  padding: 14px 15px; color: var(--text); font-family: var(--mono); font-size: 0.95rem; outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field::placeholder { color: var(--faint); letter-spacing: 0; }
.field:focus { border-color: var(--olho); box-shadow: 0 0 0 2px var(--olho-18); }
.account-form .primary-button { margin-top: 6px; width: 100%; }

.created-code { border: 1px dashed var(--olho); background: var(--olho-bg); padding: 20px; margin: 4px 0 14px; }
.created-code > strong {
  display: block; font-family: var(--mono); font-weight: 700; font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.created-code .code-words {
  display: block; font-family: var(--mono); font-size: 0.95rem; line-height: 1.9;
  color: var(--text); word-spacing: 3px; margin-bottom: 16px;
}
.created-code .text-link { margin-right: 18px; }
.created-code .primary-button { margin-top: 8px; }

.account-actions { display: flex; gap: 18px; margin-top: 8px; flex-wrap: wrap; }
.account-feedback { color: var(--olho); font-family: var(--mono); font-size: 12px; min-height: 1.3em; margin: 12px 0 0; letter-spacing: 0.02em; }
.account-feedback.ok { color: var(--text); }
.account-security { display: block; color: var(--faint); font-size: 0.78rem; margin-top: 20px; line-height: 1.5; }
.account-sign {
  display: block; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint);
}

/* ================================================================ CHROME: menu trigger + brand */
.menu-trigger {
  position: fixed; top: 16px; left: 16px; z-index: 30; width: 44px; height: 44px;
  border: 1px solid var(--line); background: rgba(20, 20, 20, 0.72); backdrop-filter: blur(10px);
  color: var(--text); cursor: pointer; display: grid; place-items: center;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.menu-trigger:hover { border-color: var(--olho); box-shadow: 0 0 18px var(--olho-40); }
.menu-trigger svg { width: 20px; height: 20px; }
.brand-badge {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 9px; pointer-events: none;
  font-family: var(--disp); font-weight: 900; font-size: 1.1rem; letter-spacing: 0.06em; color: var(--text);
}
.brand-badge img { height: 22px; width: auto; filter: drop-shadow(0 0 8px rgba(227, 49, 43, 0.45)); }
.brand-badge .tag {
  font-family: var(--mono); font-weight: 700; font-size: 9px; letter-spacing: 0.06em;
  background: var(--olho); color: var(--bg); padding: 2px 5px; align-self: flex-start; margin-top: 2px;
}

/* ================================================================ WORKSPACE SHELL */
.app-shell { display: none; height: 100vh; height: 100dvh; }
body.authenticated .app-shell { display: block; }
.workspace { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.chat-view { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.chat-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; }
.chat-inner { max-width: 840px; margin: 0 auto; padding: 84px 20px 28px; display: flex; flex-direction: column; gap: 26px; }

/* estado vazio */
.welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 54vh; gap: 4px; }
.welcome-mark { position: relative; margin-bottom: 20px; }
.welcome-mark img { width: 96px; filter: drop-shadow(0 0 26px rgba(227, 49, 43, 0.45)); }
.welcome h1 {
  font-family: var(--disp); font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em;
  font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 0.86; margin: 0;
}
.welcome .welcome-sign {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--olho); margin: 16px 0 14px; display: inline-flex; align-items: center; gap: 12px;
}
.welcome .welcome-sign::before, .welcome .welcome-sign::after { content: ""; width: 26px; height: 1px; background: var(--line); }
.welcome p { color: var(--muted); max-width: 46ch; margin: 0; font-size: 0.98rem; }

/* ---------------------------------------------------------------- mensagens */
.messages { display: flex; flex-direction: column; gap: 26px; }
.msg { display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg.user .body {
  max-width: 82%; background: var(--surface); border: 1px solid var(--line);
  border-left: 2px solid var(--olho); padding: 13px 16px; font-size: 0.97rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.msg.bot .row { display: flex; gap: 14px; }
.avatar {
  flex: 0 0 auto; width: 34px; height: 34px; background: var(--olho); display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 0 18px rgba(227, 49, 43, 0.35);
}
.avatar img { width: 25px; }
.msg.bot .content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding-top: 3px; }
.msg.bot .text { font-size: 0.99rem; line-height: 1.68; color: var(--text); }
.msg.bot .text p { margin: 0 0 13px; }
.msg.bot .text p:last-child { margin-bottom: 0; }
.msg.bot .text strong { color: var(--text); font-weight: 600; }
.msg.bot .text code {
  font-family: var(--mono); font-size: 0.86em; background: var(--inset);
  border: 1px solid var(--line-soft); padding: 1px 6px; color: var(--text);
}
.msg.bot .text pre {
  background: var(--inset); border: 1px solid var(--line); border-left: 2px solid var(--olho);
  padding: 15px 16px; overflow-x: auto; margin: 0 0 13px;
}
.msg.bot .text pre code { background: none; border: 0; padding: 0; font-size: 0.85rem; line-height: 1.55; color: #D8D3C8; }

/* pílula de status (etapa ao vivo) */
.statuspill {
  display: inline-flex; align-items: center; gap: 9px; width: fit-content;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); padding: 6px 12px;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease), opacity var(--t) var(--ease);
}
.statuspill .dot { width: 7px; height: 7px; background: var(--olho); border-radius: 50%; box-shadow: 0 0 10px var(--olho); animation: zpulse 1.1s var(--ease) infinite; }
.statuspill.done { color: var(--text); border-color: #4A4A4A; }
.statuspill.done .dot { background: var(--text); box-shadow: none; animation: none; }
@keyframes zpulse { 50% { opacity: 0.25; } }

/* ---------------------------------------------------------------- raciocínio */
details.thinking {
  border: 1px dashed var(--line); background: rgba(227, 49, 43, 0.035); overflow: hidden;
}
details.thinking > summary {
  cursor: pointer; list-style: none; padding: 11px 14px; display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
details.thinking > summary::-webkit-details-marker { display: none; }
details.thinking > summary::before { content: ""; width: 6px; height: 6px; background: var(--olho); transform: rotate(45deg); }
.tk-body {
  padding: 0 16px 14px 30px; color: var(--faint); font-family: var(--mono); font-size: 0.82rem; line-height: 1.6;
  white-space: pre-wrap; max-height: 280px; overflow-y: auto;
}

/* ---------------------------------------------------------------- MOTOR / ferramentas (engine room) */
details.engine {
  border: 1px solid var(--line); background: var(--inset); overflow: hidden;
}
details.engine > summary {
  cursor: pointer; list-style: none; padding: 12px 15px; display: flex; align-items: center; gap: 11px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text);
  border-bottom: 1px solid transparent; background: var(--surface);
}
details.engine[open] > summary { border-bottom-color: var(--line); }
details.engine > summary::-webkit-details-marker { display: none; }
.eng-led { width: 8px; height: 8px; background: var(--olho); border-radius: 50%; box-shadow: 0 0 10px var(--olho); animation: zpulse 1.1s var(--ease) infinite; }
.eng-title { color: var(--text); }
.eng-title b { color: var(--olho); font-weight: 700; }
.eng-count { margin-left: auto; color: var(--faint); font-size: 10px; letter-spacing: 0.14em; }
.eng-list { display: flex; flex-direction: column; }

details.tool { border-top: 1px solid var(--line-soft); }
details.tool:first-child { border-top: 0; }
details.tool > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 11px 15px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.02em;
}
details.tool > summary::-webkit-details-marker { display: none; }
details.tool > summary:hover { background: rgba(255, 255, 255, 0.02); }
.tool .dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.tool .dot.run { background: var(--olho); box-shadow: 0 0 9px var(--olho); animation: zpulse 1.1s var(--ease) infinite; }
.tool .dot.done { background: var(--text); }
.tool .dot.err { background: var(--olho); box-shadow: 0 0 9px var(--olho); }
.tool .verb { color: var(--olho); text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; }
.tool .name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool .state { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.tool .state.ok { color: var(--muted); }
.tool .state.err { color: var(--olho); }
.t-body { padding: 0 15px 13px 33px; display: flex; flex-direction: column; gap: 9px; }
.t-body pre {
  margin: 0; background: #0E0E0E; border: 1px solid var(--line-soft); padding: 11px 12px;
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.55; color: #C7C2B8;
  max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.t-body pre.input { border-left: 2px solid var(--line); }
.t-body pre.preview { border-left: 2px solid var(--olho); }

/* avisos + travas */
.notice {
  display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; color: var(--muted); border: 1px solid var(--line); padding: 9px 12px;
}
.notice::before { content: "!"; flex: 0 0 auto; width: 16px; height: 16px; display: grid; place-items: center; background: var(--olho); color: var(--bg); font-weight: 700; }
.notice.err { color: var(--olho); border-color: #4A2320; }

.lock-card { border: 1px solid var(--olho); background: var(--olho-bg); padding: 22px; position: relative; }
.lock-card::before { content: ""; position: absolute; top: -1px; left: -1px; width: 40px; height: 3px; background: var(--olho); }
.lock-card .lk-title { font-family: var(--disp); font-weight: 900; text-transform: uppercase; font-size: 1.4rem; color: var(--olho); margin: 0 0 8px; letter-spacing: 0.01em; }
.lock-card p { color: var(--muted); font-size: 0.9rem; margin: 0 0 16px; line-height: 1.55; }

/* ---------------------------------------------------------------- composer */
.composer-area { flex: 0 0 auto; padding: 8px 20px 18px; }
.context-tray { max-width: 840px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.context-tray:empty { display: none; }
.file-chip {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 0.78rem;
  background: var(--surface); border: 1px solid var(--line); padding: 7px 10px 7px 12px; color: var(--text); max-width: 290px;
}
.file-chip.up { border-color: var(--olho-40); }
.file-chip .fc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip .fc-size { color: var(--faint); font-size: 0.72rem; letter-spacing: 0.06em; }
.file-chip .fc-x { cursor: pointer; border: 0; background: none; color: var(--muted); padding: 0 2px; display: grid; place-items: center; }
.file-chip .fc-x:hover { color: var(--olho); }
.file-chip .fc-x svg { width: 12px; height: 12px; }

.composer {
  max-width: 840px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line);
  padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.composer:focus-within { border-color: var(--olho); box-shadow: 0 0 0 1px var(--olho), 0 0 30px rgba(227, 49, 43, 0.12); }
.composer textarea {
  width: 100%; resize: none; border: 0; background: none; color: var(--text);
  font-family: var(--body); font-size: 1rem; line-height: 1.5; max-height: 220px; outline: none; padding: 4px 4px 2px;
}
.composer textarea::placeholder { color: var(--faint); }
.composer-bar { display: flex; align-items: center; gap: 8px; }
.composer-flex { flex: 1 1 auto; }
.send-button {
  flex: 0 0 auto; width: 44px; height: 40px; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--text); color: var(--bg); transition: box-shadow var(--t) var(--ease);
}
.send-button:hover { box-shadow: 0 0 24px var(--olho-55); }
.send-button:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.send-button svg { width: 19px; height: 19px; }
.composer-hint {
  max-width: 840px; margin: 9px auto 0; text-align: center; color: var(--faint);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; line-height: 1.5;
}

/* seletor de esforço (popover) */
.effort { position: relative; }
.effort-trigger {
  display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line);
  color: var(--muted); cursor: pointer; padding: 0 12px; height: 32px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.effort-trigger:hover { border-color: var(--olho); color: var(--text); }
.effort-trigger b { color: var(--text); font-weight: 700; }
.effort-trigger .chev { width: 10px; height: 10px; }
.effort-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 25; min-width: 190px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: none; flex-direction: column; padding: 4px;
}
.effort.open .effort-menu { display: flex; }
.effort-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  background: none; border: 0; cursor: pointer; padding: 10px 12px; color: var(--muted);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.effort-menu button:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.effort-menu button .lv { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.effort-menu button.active { color: var(--text); background: var(--olho-bg); }
.effort-menu button.active .lv { color: var(--olho); }

/* ================================================================ PAINEL LATERAL */
.workspace-panel {
  position: fixed; inset: 0 auto 0 0; height: 100vh; height: 100dvh; width: 340px; max-width: 90vw; margin: 0;
  z-index: 60; border: 0; border-right: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 0; overflow: hidden; box-shadow: 40px 0 80px rgba(0, 0, 0, 0.5);
  transform: translateX(-102%); transition: transform var(--t-heavy) var(--ease);
}
.workspace-panel[open] { transform: none; }
.workspace-panel::backdrop { background: rgba(5, 5, 5, 0.6); backdrop-filter: blur(2px); }
.panel-content { height: 100%; overflow-y: auto; padding: 20px 16px 16px; display: flex; flex-direction: column; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding: 0 4px; }
.panel-heading h2 { font-family: var(--disp); font-weight: 900; text-transform: uppercase; font-size: 1.3rem; display: flex; align-items: center; gap: 9px; letter-spacing: 0.04em; }
.panel-heading h2 img { height: 24px; width: auto; filter: drop-shadow(0 0 8px rgba(227, 49, 43, 0.5)); }

.menu-section { display: flex; flex-direction: column; gap: 1px; }
.menu-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: 0; color: var(--text); cursor: pointer; padding: 11px 12px; font-size: 0.92rem;
  transition: background var(--t-fast) var(--ease);
}
.menu-item::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--olho); transform: scaleY(0); transform-origin: center; transition: transform var(--t-fast) var(--ease); }
.menu-item:hover { background: rgba(255, 255, 255, 0.03); }
.menu-item:hover::before { transform: scaleY(1); }
.menu-item:disabled { opacity: 0.4; cursor: default; }
.menu-item svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.menu-item .nav-count {
  margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  background: var(--olho-10); color: var(--olho); padding: 2px 8px;
}
.menu-separator { height: 1px; background: var(--line-soft); margin: 14px 4px; }

.menu-plan { padding: 6px 6px 2px; }
.mp-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.mp-head .rotulo { font-size: 10px; }
.mp-name { font-family: var(--disp); font-weight: 900; text-transform: uppercase; font-size: 1.25rem; color: var(--olho); letter-spacing: 0.02em; }
.mp-usage { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 12px; letter-spacing: 0.04em; }
.mp-up { width: 100%; min-height: 44px; }
.menu-plan.paid .mp-usage, .menu-plan.paid .mp-up { display: none; }
.menu-plan.paid .mp-name { color: var(--text); }

.history-heading { display: flex; align-items: center; justify-content: space-between; margin: 4px 6px 10px; }
.history-heading span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.history-search {
  width: 100%; background: var(--inset); border: 1px solid var(--line); padding: 10px 12px; color: var(--text);
  font-family: var(--mono); font-size: 12px; outline: none; margin-bottom: 8px;
}
.history-search::placeholder { color: var(--faint); }
.history-search:focus { border-color: var(--olho); }
.history { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.history-empty { color: var(--faint); font-size: 0.84rem; padding: 14px 10px; line-height: 1.55; }
.history-item {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer;
  color: var(--muted); font-size: 0.9rem; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.history-item:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.history-item.active { background: var(--olho-bg); color: var(--text); box-shadow: inset 2px 0 0 var(--olho); }
.history-item .h-title { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item .del { flex: 0 0 auto; display: grid; place-items: center; width: 20px; height: 20px; opacity: 0; color: var(--faint); transition: opacity var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.history-item .del svg { width: 12px; height: 12px; pointer-events: none; }
.history-item:hover .del { opacity: 1; }
.history-item .del:hover { color: var(--olho); }

.menu-footer {
  margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between;
  color: var(--faint); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
}
.local-status { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--olho); box-shadow: 0 0 8px var(--olho); }

/* ================================================================ DIÁLOGOS (paywall + folha) */
.options-sheet {
  width: min(720px, 92vw); max-height: 88vh; margin: auto; padding: 0; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); overflow: hidden; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}
.options-sheet::backdrop { background: rgba(5, 5, 5, 0.72); backdrop-filter: blur(5px); }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 28px 20px; border-bottom: 1px solid var(--line); }
.sheet-header h2 { font-family: var(--disp); font-weight: 900; text-transform: uppercase; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 0.92; letter-spacing: 0.01em; margin: 0; }
.sheet-sub { color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; margin: 10px 0 0; }
.sheet-body { padding: 24px 28px 28px; overflow-y: auto; max-height: calc(88vh - 110px); }

/* paywall */
.paywall .sheet-header h2 .vermelho { color: var(--olho); }
.pw-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); border: 1px solid var(--line); }
.pw-plan { position: relative; padding: 26px 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: background var(--t) var(--ease); }
.pw-plan:last-child { border-right: 0; }
.pw-plan:hover { background: #181818; }
.pw-plan.destaque { background: var(--olho-bg); box-shadow: inset 0 0 0 1px var(--olho); }
.pw-badge { font-family: var(--mono); font-weight: 700; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--olho); min-height: 14px; margin-bottom: 12px; }
.pw-plan .nome { font-family: var(--disp); font-weight: 900; text-transform: uppercase; font-size: 1.7rem; line-height: 0.9; }
.pw-plan .preco { font-family: var(--disp); font-weight: 900; font-size: 2.6rem; line-height: 1; margin: 14px 0 2px; }
.pw-plan .preco small { font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.pw-plan .tagline { color: var(--muted); font-size: 0.86rem; margin: 10px 0 16px; }
.pw-plan ul { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 10px; }
.pw-plan li { font-size: 0.84rem; color: var(--text); display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; }
.pw-plan li::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; background: var(--olho); margin-top: 6px; }
.pw-plan .primary-button, .pw-plan .secondary-button { margin-top: auto; width: 100%; }

.pw-redeem { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.pw-redeem .rotulo { display: block; margin-bottom: 12px; color: var(--muted); }
.pw-redeem-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pw-redeem-row .field { flex: 1 1 200px; letter-spacing: 0.08em; text-transform: uppercase; }
.pw-redeem-row .secondary-button { flex: 0 0 auto; }

/* folha: conexões / skills / preferências */
.conn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.conn-card { border: 1px solid var(--line); background: var(--surface); padding: 20px; }
.conn-card .logo { width: 38px; height: 38px; border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 1rem; color: var(--olho); margin-bottom: 14px; }
.conn-card h3 { font-family: var(--disp); font-weight: 900; text-transform: uppercase; font-size: 1.15rem; margin: 0 0 6px; letter-spacing: 0.01em; }
.conn-card p { color: var(--muted); font-size: 0.86rem; margin: 0; line-height: 1.5; }
.conn-card p code { font-family: var(--mono); font-size: 0.8rem; color: var(--text); }
.conn-state { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--olho); }
.conn-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.conn-state.off { color: var(--faint); }

.skill-row, .pref-row { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.skill-row:last-child, .pref-row:last-child { border-bottom: 0; }
.skill-row .s-ic { width: 42px; height: 42px; border: 1px solid var(--line); display: grid; place-items: center; flex: 0 0 auto; background: var(--surface); }
.skill-row .s-main, .pref-row .p-main { flex: 1 1 auto; min-width: 0; }
.skill-row h3, .pref-row h3 { font-size: 1rem; margin: 0 0 3px; }
.skill-row p, .pref-row p { color: var(--muted); font-size: 0.85rem; margin: 0; line-height: 1.45; }
.badge-on { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--olho); border: 1px solid var(--olho); padding: 4px 10px; }
.sheet-note { color: var(--faint); font-size: 0.82rem; margin: 18px 0 0; line-height: 1.55; }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); gap: 0; }
.seg button {
  border: 0; background: none; color: var(--muted); padding: 9px 13px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  border-left: 1px solid var(--line); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg button:first-child { border-left: 0; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--olho-bg); color: var(--text); box-shadow: inset 0 -2px 0 var(--olho); }

/* ================================================================ TOAST + SUCESSO */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(12px); z-index: 90;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 2px solid var(--olho); color: var(--text);
  padding: 12px 18px; font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.02em;
  opacity: 0; pointer-events: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.welcome-paid {
  position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 24px;
  background: rgba(10, 9, 9, 0.82); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: opacity var(--t-heavy) var(--ease), visibility var(--t-heavy) var(--ease);
}
.welcome-paid.show { opacity: 1; visibility: visible; }
.welcome-paid .wp-card { text-align: center; max-width: 440px; }
.welcome-paid img { width: 110px; margin: 0 auto 22px; filter: drop-shadow(0 0 34px rgba(227, 49, 43, 0.55)); }
.welcome-paid .wp-eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--olho); }
.welcome-paid h2 { font-family: var(--disp); font-weight: 900; text-transform: uppercase; font-size: clamp(2.4rem, 7vw, 3.6rem); line-height: 0.88; margin: 14px 0 12px; }
.welcome-paid p { color: var(--muted); margin: 0 0 26px; font-size: 0.95rem; }

/* ================================================================ spinner + reveal base */
.spinner { width: 13px; height: 13px; border: 2px solid rgba(227, 49, 43, 0.3); border-top-color: var(--olho); border-radius: 50%; animation: spin 0.7s linear infinite; }
.mini-spin { width: 12px; height: 12px; border: 2px solid rgba(227, 49, 43, 0.3); border-top-color: var(--olho); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================ RESPONSIVO */
@media (max-width: 680px) {
  .brand-badge { display: none; }
  .chat-inner { padding: 72px 16px 24px; }
  .composer-area { padding: 8px 16px 16px; }
  .msg.user .body { max-width: 90%; }
  .conn-grid { grid-template-columns: 1fr; }
  .account-card { padding: 32px 22px; }
  .sheet-header, .sheet-body { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 480px) {
  .effort-trigger .lbl-full { display: none; }
  .pw-plans { grid-template-columns: 1fr; }
  .pw-plan { border-right: 0; border-bottom: 1px solid var(--line); }
  .pw-plan:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .statuspill .dot, .eng-led, .tool .dot.run, .spinner, .mini-spin { animation: none !important; }
  .workspace-panel { transition: none; }
  * { scroll-behavior: auto !important; }
}

/* BYOK — cartão da chave Anthropic do cliente (aba Conexões) */
.keycard { border: 1px solid var(--border, #3A3A3A); background: #161616; padding: 18px; margin-bottom: 18px; }
.keycard.on { border-color: var(--olho, #E3312B); background: #1A1313; }
.keycard .kc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.keycard .kc-head h3 { margin: 0; font-family: var(--display, "Big Shoulders Display"), sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.keycard p { color: var(--muted, #9A958C); font-size: 13px; margin: 0 0 14px; }
.keycard strong { color: var(--text, #F1ECE1); }
.key-row { display: flex; gap: 10px; }
.key-row input { flex: 1 1 auto; min-width: 0; background: #141414; border: 1px solid var(--border, #3A3A3A); color: var(--text, #F1ECE1); padding: 11px 13px; font-family: var(--mono, "JetBrains Mono"), monospace; letter-spacing: .04em; outline: none; }
.key-row input:focus { border-color: var(--olho, #E3312B); }
.key-fb { margin-top: 10px; font-family: var(--mono, "JetBrains Mono"), monospace; font-size: 12px; color: var(--muted, #9A958C); min-height: 1em; }
.key-fb.ok { color: var(--text, #F1ECE1); }
.key-fb.err { color: var(--olho, #E3312B); }

/* Paywall x1 — aviso de acesso por código (sem preço/checkout) */
.pw-note { border: 1px solid var(--olho, #E3312B); background: #1A1313; padding: 20px; }
.pw-note-title { font-family: var(--display, "Big Shoulders Display"), sans-serif; font-weight: 900; text-transform: uppercase; font-size: 20px; color: var(--olho, #E3312B); margin-bottom: 8px; }
.pw-note p { color: var(--muted, #9A958C); font-size: 14px; margin: 0; }
.pw-note strong { color: var(--text, #F1ECE1); }
