@font-face {
  font-family: KrakenApple;
  src: url('assets/SFArabic.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #080608;
  --panel: #151014;
  --line: rgba(225, 176, 194, .11);
  --muted: #a0949c;
  --text: #eee8ec;
  --red: #d53958;
  --font: KrakenApple, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
@supports (height: 100dvh) { body { height: 100dvh; } }
.no-script { position: fixed; z-index: 210; bottom: 28px; left: 20px; right: 20px; color: #cbb7c3; text-align: center; font-size: 13px; }
button, input, textarea, select { font: inherit; }
button { color: inherit; border: 0; background: none; cursor: pointer; }
button, input, textarea { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid #ce8298; outline-offset: 3px; }
button:disabled { cursor: default; opacity: .35; }
button:not(:disabled) { transition: color .18s, background .18s, border-color .18s, transform .18s; }
button:not(:disabled):active { transform: translateY(1px); }
svg { width: 18px; height: 18px; stroke-width: 1.6; vertical-align: middle; flex-shrink: 0; }
button > span[data-icon] { display: inline-flex; align-items: center; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 550; }
kbd { font: 10px var(--font); color: #96868f; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* The canvas and its fallback share one subdued crimson atmosphere. */
.atmosphere { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 43% 48%, rgba(113, 13, 40, .23), transparent 56%), radial-gradient(ellipse at 78% 68%, rgba(68, 9, 28, .19), transparent 49%), var(--bg); transition: opacity 0.8s ease, filter 0.8s ease; }
.atmosphere canvas { display: block; width: 100%; height: 100%; opacity: .72; transition: opacity 0.8s ease; }
.atmosphere-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 44%, transparent 20%, rgba(8, 6, 8, .65) 100%), linear-gradient(180deg, rgba(8, 6, 8, .28), transparent 42%, rgba(8, 6, 8, .62)); transition: opacity 0.8s ease; }

/* No chat ativo (com mensagens), o tom vermelho fica extremamente suave e discreto */
body.chat-active .atmosphere {
  opacity: 0.25;
  filter: saturate(0.6) brightness(0.6);
}
body.chat-active .atmosphere canvas {
  opacity: 0.18;
}
body.chat-active .atmosphere-shade {
  background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(8, 6, 8, .92) 100%), linear-gradient(180deg, rgba(8, 6, 8, .8), rgba(8, 6, 8, .9));
}
.app-shell, .workspace, .chat-view { height: 100%; min-height: 0; }
.app-shell { position: relative; }
.workspace { width: 100%; }
.chat-view { position: relative; display: flex; flex-direction: column; }
.chat-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scroll-behavior: auto; }
.welcome { position: absolute; top: 43%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.kraken-mark { position: relative; display: block; overflow: hidden; mix-blend-mode: screen; flex-shrink: 0; pointer-events: none; }
.kraken-mark img { position: absolute; width: 107%; height: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); mix-blend-mode: screen; }
.welcome-mark { width: 76px; height: 55px; filter: drop-shadow(0 0 9px rgba(210, 24, 49, .16)); animation: float-mark 5.6s ease-in-out infinite; }
.chat-view.has-messages .welcome { display: none; }
.composer-area { position: relative; z-index: 1; width: min(560px, calc(100% - 96px)); flex-shrink: 0; margin: 16px auto 49px; }
.composer { --composer-neon-angle: 0deg; position: relative; isolation: isolate; display: flex; align-items: flex-end; gap: 12px; padding: 13px 13px 13px 17px; border: 1px solid rgba(195, 129, 151, .15); border-radius: 17px; background: rgba(22, 14, 20, .87); box-shadow: 0 8px 38px rgba(0, 0, 0, .17), inset 0 1px 0 rgba(255, 255, 255, .02); transition: border-color .2s, box-shadow .2s; overflow: hidden; }
.composer::before { content: ''; position: absolute; z-index: 0; inset: 0; border-radius: inherit; pointer-events: none; padding: 2px; background: conic-gradient(from var(--composer-neon-angle), transparent 0deg 205deg, rgba(255, 39, 78, .28) 230deg, #ff274e 272deg, #ffd8df 286deg, #ff274e 300deg, transparent 326deg 360deg); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; filter: drop-shadow(0 0 4px rgba(255, 39, 78, .8)) drop-shadow(0 0 10px rgba(220, 30, 68, .28)); animation: kraken-composer-neon 3.2s linear infinite; opacity: .95; }
.composer::after { content: none; }
.composer > * { position: relative; z-index: 2; }
.composer.is-plan-mode { --composer-neon-angle: 0deg; border-color: rgba(72, 154, 255, .62); box-shadow: 0 8px 38px rgba(0, 0, 0, .2), 0 0 18px rgba(45, 126, 255, .12); }
.composer.is-plan-mode::before { background: conic-gradient(from var(--composer-neon-angle), transparent 0deg 205deg, rgba(62, 137, 255, .25) 230deg, #2d8cff 272deg, #dcecff 286deg, #1674ff 300deg, transparent 326deg 360deg); filter: drop-shadow(0 0 5px rgba(55, 140, 255, .95)) drop-shadow(0 0 12px rgba(45, 126, 255, .38)); animation-duration: 2.1s; }
.composer.is-plan-mode::after { content: none; }
@property --composer-neon-angle {
  syntax: '<angle>';
  inherits: true;
  initial-value: 0deg;
}
@keyframes kraken-composer-neon { to { --composer-neon-angle: 360deg; } }
.composer:focus-within { border-color: rgba(203, 113, 142, .44); box-shadow: 0 8px 38px rgba(0, 0, 0, .2), 0 0 0 3px rgba(181, 43, 82, .035); }
.composer textarea { display: block; flex: 1; min-width: 0; width: 100%; min-height: 27px; max-height: 160px; padding: 2px 0; border: 0; resize: none; background: transparent; color: #eee5eb; font-size: 12px; line-height: 23px; }
.composer textarea::placeholder { color: #a18e99; }
.attach-inline { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border: 1px solid rgba(195, 129, 151, .16); border-radius: 9px; color: #b995aa; }
.attach-inline svg { width: 16px; height: 16px; transition: transform .2s ease; }
.attach-inline:hover svg, .attach-inline[aria-expanded='true'] svg { transform: rotate(90deg); }
.attach-inline svg { width: 15px; height: 15px; }
.attach-inline:hover { border-color: rgba(203, 113, 142, .44); background: rgba(199, 91, 137, .12); color: #f1d5e1; }
.typing-indicator { display: inline-flex; align-items: center; gap: 5px; min-height: 20px; }
.typing-indicator i { display: block; width: 5px; height: 5px; border-radius: 50%; background: #d27096; animation: typing-pulse 1.05s ease-in-out infinite; }
.typing-indicator i:nth-child(2) { animation-delay: .14s; }
.typing-indicator i:nth-child(3) { animation-delay: .28s; }
.send-button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border: 1px solid rgba(239, 104, 143, .14); border-radius: 9px; background: #51182a; color: #efd0dc; }
.send-button:not(:disabled):hover { background: #6a2037; }
.send-button svg { width: 15px; height: 15px; stroke-width: 1.8; }
.send-button.is-loading { opacity: 1; background: #6a2037; }
.send-spinner { width: 13px; height: 13px; border: 2px solid rgba(239, 208, 220, .35); border-top-color: #efd0dc; border-radius: 50%; animation: send-spin .75s linear infinite; }
.composer-foot { margin-top: 10px; color: #8f7c88; text-align: center; font-size: 9px; letter-spacing: .06px; }
.context-tray { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.context-tray:empty { display: none; }
.context-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(34, 17, 27, .9); color: #c9a5b5; font-size: 10px; }
.context-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-chip svg { width: 13px; height: 13px; }
.context-chip button { flex-shrink: 0; padding: 0 2px; color: #c79bab; font-size: 15px; line-height: 17px; }
.skill-router-chip { color: #d3b9c5; border-color: rgba(195, 129, 151, .28); }
.skill-auto-chip { color: #ccaec0; background: rgba(35, 20, 28, .55); }

/* History and every secondary action live behind the single workspace button. */
.menu-trigger { position: fixed; z-index: 5; left: 22px; bottom: 22px; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(193, 147, 168, .1); border-radius: 12px; background: rgba(21, 13, 19, .7); color: #a58d9b; }
.menu-trigger svg { width: 17px; height: 17px; }
.menu-trigger:hover, .menu-trigger[aria-expanded='true'] { color: #e3bccd; border-color: rgba(196, 111, 144, .28); background: #25121e; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: #ae94a2; flex-shrink: 0; }
.icon-button:hover { color: #f0d8e2; background: rgba(205, 116, 152, .08); }
.icon-button svg { width: 16px; height: 16px; }
dialog { padding: 0; width: min(670px, calc(100vw - 64px)); max-height: calc(100vh - 80px); border: 1px solid rgba(190, 126, 153, .18); border-radius: 18px; background: #151015; color: var(--text); box-shadow: 0 24px 100px rgba(0, 0, 0, .62); }
dialog:not([open]) { display: none; }
dialog::backdrop { background: rgba(5, 2, 5, .56); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.workspace-panel { position: fixed; inset: auto auto 68px 22px; margin: 0; width: min(320px, calc(100vw - 44px)); max-height: calc(100vh - 104px); border-radius: 17px; background: rgba(23, 15, 22, .98); overflow: auto; }
.workspace-panel::backdrop { background: rgba(5, 2, 5, .23); backdrop-filter: none; -webkit-backdrop-filter: none; }
.quick-add-menu { position: fixed; inset: auto auto 111px max(22px, calc(50% - 280px)); margin: 0; width: min(320px, calc(100vw - 44px)); max-height: calc(100vh - 150px); border-radius: 16px; background: rgba(32, 30, 31, .985); border-color: rgba(220, 192, 204, .16); overflow: auto; }
.quick-add-menu::backdrop { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.quick-add-list { display: grid; gap: 2px; padding: 8px; }
.quick-add-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 36px; padding: 8px 10px; border-radius: 8px; color: #e3dce0; text-align: left; font-size: 12px; }
.quick-add-item:hover, .quick-add-item:focus-visible { background: rgba(198, 92, 135, .18); color: #fff2f7; outline: none; }
.quick-add-item svg { width: 17px; height: 17px; flex: 0 0 auto; color: #d9cbd2; }
.quick-add-item kbd { margin-left: auto; color: #a99aa2; font: 11px var(--font); }
.quick-add-chevron { margin-left: auto; color: #a99aa2; font-size: 21px; line-height: 12px; }
.quick-add-chevron-down { color: #b1d9ff; font-size: 18px; }
.panel-content { padding: 13px 11px 10px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 9px 9px; }
.panel-heading h2 { color: #ded0d8; font-size: 13px; font-weight: 550; letter-spacing: -.1px; }
.menu-section { display: grid; gap: 2px; }
.menu-section > h3, .menu-section > h4, .menu-section > p { padding: 7px 10px; color: #997b8b; font-size: 9px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
.menu-item { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #c4b3be; text-align: left; font-size: 11px; }
.menu-item svg { width: 15px; height: 15px; color: #b2859a; }
.menu-item:hover, .menu-item.active { color: #f0dce6; background: rgba(198, 92, 135, .08); }
.menu-shortcut { margin-left: auto; color: #8f7180; font-size: 9px; }
.menu-separator { height: 1px; margin: 9px 7px; border: 0; background: var(--line); }
.menu-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 10px 2px; color: #8f7784; font-size: 9px; }
.local-status { display: inline-flex; align-items: center; gap: 6px; color: #b496a4; font-size: 9px; }
.status-dot { display: inline-block; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: #bf768e; box-shadow: 0 0 7px rgba(185, 64, 103, .16); }
.nav-count { min-width: 19px; margin-left: auto; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; color: #bb94a5; font-size: 9px; line-height: 17px; text-align: center; }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 7px 3px 10px; color: #a58296; font-size: 8px; letter-spacing: 1.1px; }
.history-heading .icon-button { width: 25px; height: 25px; }
.history-heading svg { width: 13px; height: 13px; }
.history-search { width: calc(100% - 12px); margin: 5px 6px 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #100b10; color: var(--text); font-size: 11px; }
.history-search::placeholder { color: #8d7684; }
.history { max-height: 150px; overflow: auto; }
.history-empty { padding: 9px 10px; color: #9c8492; font-size: 10px; line-height: 1.8; }
.history-item { display: flex; align-items: center; margin-bottom: 2px; border-radius: 8px; }
.history-item:hover, .history-item.selected { background: rgba(198, 92, 135, .06); }
.history-item > button:first-child { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; padding: 9px 10px; color: #bca6b4; text-align: left; font-size: 10px; }
.history-item > button:first-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item > button:first-child svg { width: 13px; height: 13px; color: #947385; }
.delete-chat { display: grid; place-items: center; width: 27px; height: 27px; margin-right: 3px; color: #977080; opacity: .55; }
.history-item:hover .delete-chat, .history-item:focus-within .delete-chat { opacity: 1; }
.delete-chat svg { width: 12px; height: 12px; }

/* Conversation content stays narrow and lets the surrounding space breathe. */
.messages { width: min(650px, 100%); margin: auto; padding: 70px 34px 12px; }
.messages:empty { display: none; }
.message { margin-bottom: 31px; }
.message-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; color: #d7becb; font-size: 11px; }
.message-avatar { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(166, 108, 135, .1); border-radius: 8px; background: #251720; color: #d7b3c3; font-size: 9px; }
.message-avatar img { width: 16px; height: 16px; object-fit: contain; border-radius: 4px; }
.message.assistant .message-avatar { background: #351421; color: #df779b; }
.message-head small { color: #a08191; font-size: 9px; }
.message-response-time { color: #9f7184; font: 600 9px/1 ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; }
.message time { margin-left: auto; color: #9a7e8c; font-size: 9px; }
.message-body { padding-left: 33px; color: #cbb7c3; font-size: 12px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .message-body { color: #e6d8e1; }
.message-actions { display: flex; gap: 8px; padding-left: 33px; margin-top: 8px; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 3px 0; color: #a48294; font-size: 10px; }
.text-button:hover { color: #e0b7ca; }
.text-button svg { width: 12px; height: 12px; }

.beginner-response-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 30px;
  margin: 8px 0 2px 33px;
  color: #cbb7c3;
  font-size: 11px;
}
.beginner-response-status .run-question-open { margin-left: auto; }

.run-activity-thinking {
  display: grid;
  gap: 5px;
  margin: 10px 0 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(195, 129, 151, .12);
}
.thinking-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #eadbe1;
}
.thinking-brain {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: rgba(213, 57, 88, .16);
  color: var(--red);
}
.thinking-brain svg { width: 14px; height: 14px; }
.thinking-copy {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}
.thinking-copy .thinking-current {
  flex: 1 1 180px;
  min-width: 0;
  max-width: min(100%, 560px);
  overflow: hidden;
  color: #b99daa;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thinking-copy strong { flex: 0 0 auto; font-size: 11px; }
.thinking-dots { display: inline-flex; gap: 3px; }
.thinking-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9c3150;
  animation: typing-pulse 1.05s ease-in-out infinite;
}
.thinking-dots i:nth-child(2) { animation-delay: .14s; }
.thinking-dots i:nth-child(3) { animation-delay: .28s; }
.thinking-clock {
  flex: 0 0 auto;
  color: #d5aebf;
  font: 600 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.thinking-stop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 5px;
  min-height: 30px;
  margin: 0 auto;
  padding: 5px 12px;
  border: 1px solid rgba(213, 57, 88, .28);
  border-radius: 8px;
  background: transparent;
  color: #c39aaa;
  font-size: 10px;
}
.thinking-stop svg { width: 13px; height: 13px; }
.thinking-stop:hover { border-color: rgba(213,57,88,.5); background: rgba(213,57,88,.1); color: #f0c4d2; }

@media (max-width: 640px) {
  .thinking-copy { flex-wrap: wrap; gap: 4px 7px; }
  .thinking-copy .thinking-current { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .thinking-dots i { animation: none; }
}
.message-attachment { display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 33px); margin: 10px 0 0 33px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(49, 22, 36, .45); color: #c49aaf; font-size: 10px; overflow-wrap: anywhere; }
.evidence-list { display: grid; gap: 6px; max-width: min(620px, calc(100% - 33px)); margin: 12px 0 0 33px; }
.evidence-label { color: #d49ab6; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.evidence-card { border: 1px solid rgba(195, 129, 151, .16); border-radius: 8px; background: rgba(28, 14, 25, .72); color: #c9a5b5; overflow: hidden; }
.evidence-card summary { display: flex; align-items: center; gap: 8px; padding: 7px 9px; cursor: pointer; list-style: none; font-size: 10px; }
.evidence-card summary::-webkit-details-marker { display: none; }
.evidence-card summary span { color: #f0b0c9; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.evidence-card summary small { margin-left: auto; color: #8f7282; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.evidence-card pre { max-height: 180px; margin: 0; padding: 8px 9px; border-top: 1px solid rgba(195, 129, 151, .12); color: #bda6b2; font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow: auto; }
.message-attachment svg { width: 13px; height: 13px; }

/* Library, settings and future connections appear only in their options sheet. */
.options-sheet { width: min(780px, calc(100vw - 64px)); max-height: calc(100vh - 80px); overflow: hidden; }
.options-sheet[open] { display: flex; flex-direction: column; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-shrink: 0; padding: 20px 27px; border-bottom: 1px solid var(--line); }
.sheet-header h2 { color: #e1ccd8; font-size: 15px; letter-spacing: -.2px; }
.sheet-header p { margin-top: 4px; color: #a78a9b; font-size: 10px; }
.secondary-view { min-height: 0; overflow: auto; padding: 27px; }
.section-eyebrow { margin-bottom: 9px; color: #b28da1; font-size: 8px; letter-spacing: 1.7px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.page-heading h1 { color: #ead9e3; font-size: 25px; letter-spacing: -.7px; }
.page-heading p, .page-intro { margin-top: 8px; color: #b298a9; font-size: 11px; line-height: 1.8; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex-shrink: 0; padding: 9px 13px; border: 1px solid rgba(220, 137, 171, .19); border-radius: 8px; background: #713047; color: #f3d8e4; font-size: 10px; }
.primary-button:hover { background: #893b56; }
.secondary-button { background: #261720; color: #d0a7bb; border-color: var(--line); }
.secondary-button:hover { background: #34202c; }
.primary-button svg, .secondary-button svg { width: 14px; height: 14px; }
.search-box { display: flex; align-items: center; gap: 9px; max-width: 400px; padding: 10px 12px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 9px; background: #100b10; color: #a68396; }
.search-box:focus-within { border-color: #8a4d68; }
.search-box input { min-width: 0; width: 100%; border: 0; background: none; color: #e7d1df; font-size: 11px; }
.search-box input::placeholder { color: #9c7e8f; }
.search-box svg { width: 15px; height: 15px; }
.library-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: #a38194; font-size: 9px; }
.skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.skill-card { display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, #21131d, #181017); }
.skill-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.suggestion-icon { display: inline-flex; padding: 7px; border-radius: 8px; background: rgba(202, 103, 147, .07); color: #d49ab6; }
.suggestion-icon svg { width: 15px; height: 15px; }
.skill-tag { padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; color: #bc8fa5; font-size: 7px; letter-spacing: .8px; }
.skill-card h2 { margin-bottom: 7px; color: #e3cedb; font-size: 14px; font-weight: 500; }
.skill-card p { margin-bottom: 19px; color: #b192a5; font-size: 10px; line-height: 1.8; }
.skill-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.skill-card-footer > span { color: #a17a90; font-size: 9px; }
.skill-card-footer button { display: flex; align-items: center; gap: 5px; color: #d7a9c0; font-size: 10px; }
.skill-card-footer button:hover { color: #fff0f7; }
.skill-card-footer svg { width: 12px; height: 12px; }
.library-note { display: flex; gap: 8px; margin-top: 20px; color: #a6889a; font-size: 10px; line-height: 1.9; }
.library-note svg { width: 14px; height: 14px; margin-top: 2px; }
.empty-state { grid-column: 1 / -1; padding: 30px; border: 1px dashed #583044; border-radius: 12px; color: #bea0b1; font-size: 11px; text-align: center; }
.connection-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 19px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #24131e; }
.connection-banner > span { color: #d096b1; }
.connection-banner strong { color: #e4c6d7; font-size: 12px; font-weight: 500; }
.connection-banner p { margin-top: 4px; color: #b490a5; font-size: 10px; line-height: 1.8; }
.connection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.connection-card { min-width: 0; padding: 19px 16px; border: 1px solid var(--line); border-radius: 12px; background: #1c111a; }
.provider-logo { display: grid; place-items: center; width: 37px; height: 37px; margin-bottom: 18px; border-radius: 10px; background: #311b28; color: #d6a3be; font-size: 23px; }
.provider-logo.codex { font: 19px monospace; }
.connection-card h2 { color: #e4ccda; font-size: 14px; }
.connection-card p { min-height: 65px; margin-top: 7px; color: #b38da5; font-size: 10px; line-height: 1.9; }
.connection-state { display: inline-flex; align-items: center; gap: 6px; margin-top: 17px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; color: #bd92a9; font-size: 8px; }
.connection-state::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: #ae6c8b; }
.roadmap { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 25px; color: #bb91a8; font-size: 10px; }
.roadmap span { display: flex; align-items: center; gap: 7px; }
.roadmap b { display: grid; place-items: center; width: 19px; height: 19px; border: 1px solid #62384e; border-radius: 50%; color: #d8a6bf; font-size: 9px; font-weight: 400; }
.connection-details { margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); color: #b58fa7; font-size: 10px; line-height: 1.9; }
.connection-details strong { color: #d7b3c8; font-weight: 500; }
.settings-panel { padding: 0 20px; border: 1px solid var(--line); border-radius: 13px; background: #1c111a; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 23px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row h2 { color: #dfc5d5; font-size: 12px; font-weight: 500; }
.setting-row p { margin-top: 5px; color: #b48da4; font-size: 10px; }
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 35px; height: 20px; flex-shrink: 0; border: 1px solid #61364c; border-radius: 12px; background: #35202e; cursor: pointer; transition: background .2s; }
.switch::before { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #bd94ab; transition: transform .2s; }
.switch:checked { background: #973b60; }
.switch:checked::before { transform: translateX(15px); background: #f2d5e5; }
.about-card { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 13px 0; color: #b18ba2; }
.about-card .kraken-mark { width: 46px; height: 34px; }
.about-card strong { color: #dfbdd2; font-size: 12px; }
.about-card p { margin-top: 4px; font-size: 9px; }
.about-card > span { margin-left: auto; font-size: 9px; }

/* Source text stays plain text inside a scrollable, keyboard-accessible dialog. */
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 25px; border-bottom: 1px solid var(--line); }
.modal-header h2 { color: #e5cbdc; font-size: 20px; letter-spacing: -.5px; }
.modal-header p { margin-top: 6px; color: #b28aa3; font-size: 10px; overflow-wrap: anywhere; }
.modal-body { max-height: calc(100vh - 230px); padding: 22px 25px; overflow: auto; }
.modal-body > .page-intro { margin: 0 0 19px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 11px; padding: 16px 25px; border-top: 1px solid var(--line); }
.desktop-offer { text-align: center; }
.desktop-offer-mark { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 17px; border: 1px solid rgba(220, 137, 171, .22); border-radius: 15px; background: rgba(112, 48, 71, .32); color: #efb4ca; }
.desktop-offer-mark svg { width: 25px; height: 25px; }
.desktop-offer h3 { color: #f0dbe5; font-size: 18px; font-weight: 550; }
.desktop-offer p { max-width: 450px; margin: 11px auto 0; color: #b99eac; font-size: 11px; line-height: 1.8; }
.desktop-offer .desktop-offer-note { color: #d8aec1; }
.skill-source { margin: 0; color: #c0a2b5; font: 11px/1.9 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
.file-details { margin-top: 19px; padding-top: 13px; border-top: 1px solid var(--line); }
.file-details summary { color: #d4aec5; font-size: 11px; cursor: pointer; overflow-wrap: anywhere; }
.file-details pre { margin-top: 13px; }
.picker-row { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.picker-row input { width: 16px; height: 16px; flex-shrink: 0; accent-color: #c25786; }
.picker-row strong { display: block; color: #e2c5d8; font-size: 12px; font-weight: 500; }
.picker-row small { display: block; margin-top: 4px; color: #ae839e; font-size: 10px; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 110px)); padding: 11px 16px; border: 1px solid #694055; border-radius: 10px; background: #271521; box-shadow: 0 8px 35px #0008; color: #e6c9dc; font-size: 11px; }
.toast.error { border-color: #a24c69; background: #3b182a; }
.busy { opacity: .6; pointer-events: none; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { border-radius: 4px; background: #9e657c40; }
::selection { color: #fff; background: #9f436466; }

/* Static visibility does not depend on a compositor animation being scheduled. */
body.showing-splash .app-shell, body.showing-splash .menu-trigger { visibility: hidden; pointer-events: none; }
body.is-intro-active { overflow: hidden; }
.particle-intro { position: fixed; z-index: 160; inset: 0; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 48%, rgba(228, 30, 37, .12), transparent 27%), #080608; opacity: 1; transition: opacity .62s ease; }
.particle-intro.is-done { opacity: 0; pointer-events: none; }
.particle-intro canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.splash { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; background: rgba(8, 6, 8, .12); transition: opacity .65s ease; }
.splash-content { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 28px; margin-top: -28px; border-radius: 24px; isolation: isolate; }
.splash-content::before { content: ''; position: absolute; z-index: -1; width: 230px; height: 210px; left: 50%; top: -42px; transform: translateX(-50%); background: radial-gradient(ellipse, rgba(194, 15, 43, .08), transparent 69%); pointer-events: none; }
.splash-content:focus-visible { outline: 1px solid rgba(206, 130, 152, .55); outline-offset: 6px; }
.splash-content:not(:disabled):active { transform: none; }
.splash-mark { width: 116px; height: 84px; margin: 0 auto 12px; filter: drop-shadow(0 0 10px rgba(218, 19, 46, .15)); animation: float-mark 5.6s ease-in-out infinite; }
.shimmer-text { color: #fff; font-size: 26px; font-weight: 520; letter-spacing: -.65px; line-height: 1.25; background: linear-gradient(100deg, #fff 0%, #fff 40%, #a2aab7 48%, #f5f7fc 53%, #fff 60%, #fff 100%); background-size: 250% 100%; background-position: -100% 50%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: silver-pass 5.2s ease-in-out infinite; }
.splash.leaving { opacity: 0; pointer-events: none; }
.splash.dismissed { display: none; }
body.entering-workspace .app-shell { animation: workspace-in .8s ease-out; }
body.auth-locked .splash, body.auth-locked .app-shell, body.auth-locked #native-onboarding, body.auth-locked #welcome-greeting-screen { visibility: hidden !important; pointer-events: none !important; display: none !important; }
.account-gate { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 28px; background: rgba(8, 6, 8, .2); }
.account-card { position: relative; isolation: isolate; width: min(430px, 100%); padding: 31px; border: 1px solid transparent; border-radius: 28px; background: linear-gradient(145deg, rgba(28, 15, 27, .98), rgba(14, 9, 14, .98)) padding-box, linear-gradient(135deg, rgba(246, 151, 182, .24), rgba(117, 24, 55, .6), rgba(225, 65, 97, .16)) border-box; box-shadow: 0 24px 100px rgba(0, 0, 0, .68); }
.account-card::before { content: ''; position: absolute; z-index: -1; inset: -3px; padding: 2px; border-radius: inherit; background: conic-gradient(from var(--saber-angle), transparent 0deg 250deg, rgba(155, 24, 63, .12) 278deg, rgba(242, 91, 126, .86) 302deg, #fff0f6 314deg, rgba(220, 44, 86, .92) 326deg, rgba(105, 10, 41, .14) 350deg 360deg); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; filter: drop-shadow(0 0 3px rgba(236, 49, 92, .72)); animation: account-saber-flow 4.8s linear infinite; pointer-events: none; }
.account-card::after { content: none; }
.account-card > * { position: relative; z-index: 1; }
.account-eyebrow { margin-bottom: 10px; color: #bd91a7; font-size: 9px; letter-spacing: 1.8px; }
.account-card h1 { color: #f0dce7; font-size: 26px; letter-spacing: -.7px; }
.account-lead { margin-top: 8px; color: #b79aaa; font-size: 11px; line-height: 1.8; }
.account-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 20px;
}
.account-form label {
  display: block;
  margin-top: 14px;
  margin-bottom: 8px;
  color: #dfc5d5;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  line-height: 1.4;
}
.account-form label:first-child {
  margin-top: 0;
}
.account-form input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(225, 176, 194, .16);
  border-radius: 13px;
  background: rgba(9, 7, 10, .75);
  color: var(--text);
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none !important;
}
.account-form input:focus,
.account-form input:focus-visible {
  outline: none !important;
  border-color: rgba(236, 92, 130, .74);
  background: rgba(20, 9, 17, .9);
  box-shadow: 0 0 0 3px rgba(203, 35, 81, .15), 0 0 18px rgba(166, 15, 57, .16);
}
.account-form input:-webkit-autofill,
.account-form input:-webkit-autofill:hover, 
.account-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #09070a inset !important;
  -webkit-text-fill-color: #f0dce7 !important;
  caret-color: #ffffff;
  transition: background-color 5000s ease-in-out 0s;
}

/* Etapas de autenticação e badge */
.auth-step {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.auth-step label {
  display: block;
  margin-top: 14px;
  margin-bottom: 8px;
  color: #dfc5d5;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.auth-step label:first-child {
  margin-top: 0;
}
.auth-email-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 30, 86, 0.08);
  border: 1px solid rgba(255, 30, 86, 0.25);
  border-radius: 14px;
  margin-bottom: 20px;
  transition: border-color 0.2s, background-color 0.2s;
}
.auth-email-badge:hover {
  background: rgba(255, 30, 86, 0.12);
  border-color: rgba(255, 30, 86, 0.35);
}
.auth-email-badge-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 3px;
}
.auth-email-badge-label {
  font-size: 9px;
  color: #ff3366;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.auth-verified-email-text {
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
  word-break: break-all;
  letter-spacing: 0.2px;
}
.auth-change-email-btn {
  font-size: 11px;
  padding: 6px 10px;
  color: #ff85a2;
  border-radius: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: color 0.2s, background 0.2s;
}
.auth-change-email-btn:hover {
  color: #ffffff;
  background: rgba(255, 30, 86, 0.15);
}

/* Campo de senha com botão de visualização */
.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-field-wrapper input {
  width: 100%;
  padding-right: 46px !important;
}
.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 7px;
  margin: 0;
  cursor: pointer;
  color: #a8889c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s, background-color 0.2s, transform 0.1s;
  user-select: none;
}
.password-toggle-btn:hover {
  color: #ffffff;
  background: rgba(255, 30, 86, 0.18);
}
.password-toggle-btn:active {
  transform: translateY(-50%) scale(0.92);
}
.password-toggle-btn [data-icon] {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.password-toggle-btn [data-icon] svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Botões do formulário */
.account-form .primary-button {
  margin-top: 18px !important;
  width: 100%;
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 600;
}
.account-form .text-button {
  margin-top: 12px !important;
  width: 100%;
  text-align: center;
  color: #bd9bb0;
  font-size: 11px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 6px;
  transition: color 0.2s;
}
.account-form .text-button:hover {
  color: #fff0f6;
}
.account-form .account-terms { display: flex; align-items: flex-start; gap: 9px; margin-top: 7px; color: #c5aabb; font-size: 10px; line-height: 1.65; }
.account-form .account-terms input { flex: 0 0 15px; width: 15px; height: 15px; margin: 1px 0 0; accent-color: #df5077; }
.account-actions { display: flex; justify-content: center; gap: 14px; margin-top: 18px; }
.text-link { color: #d5a6bc; font-size: 10px; }
.text-link:hover { color: #fff0f7; }
.account-feedback { min-height: 18px; margin-top: 14px; color: #d8a7ba; font-size: 10px; line-height: 1.6; }
.account-feedback.error { color: #f39aab; }
.account-security { display: block; margin-top: 14px; color: #8f7785; font-size: 9px; line-height: 1.65; text-align: center; }
.created-code { position: relative; margin-top: 18px; padding: 16px; border: 1px solid rgba(237, 107, 145, .32); border-radius: 16px; background: linear-gradient(135deg, rgba(63, 20, 42, .84), rgba(32, 15, 28, .94)); color: #f2d4e1; font: 11px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 12px 32px rgba(0, 0, 0, .2); }
.created-code button { display: block; margin-top: 9px; color: #e5aac0; font: 10px var(--font); }
.created-code .primary-button { width: 100%; margin-top: 13px; color: #160d13; font: 600 11px var(--font); }
.profile-card { margin-top: 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 13px; background: #1c111a; }
.profile-card h2 { color: #dfc5d5; font-size: 12px; font-weight: 500; }
.profile-card p { margin-top: 5px; color: #a9899b; font-size: 10px; line-height: 1.7; }
.profile-fields { min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.profile-fields > label { display: block; margin: 12px 0 5px; color: #dfc5d5; font-size: 11px; }
.profile-fields > input, .profile-fields > select { width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #100b10; color: var(--text); font: 11px var(--font); }
.profile-fields:disabled { opacity: .7; }
.profile-locales { min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.profile-locales legend { padding: 0; color: #dfc5d5; font-size: 11px; }
.profile-locale-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 8px; margin-top: 6px; }
.profile-locale-option { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 40px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #100b10; color: var(--text); font-size: 11px; cursor: pointer; }
.profile-locale-option:has(input:checked) { border-color: #d3a6ba; background: #291824; }
.profile-locale-option:focus-within { outline: 2px solid #e5aac0; outline-offset: 2px; }
.profile-locale-option input { flex: 0 0 auto; margin: 0; accent-color: #d3a6ba; }
.profile-locale-option img { flex: 0 0 auto; width: 24px; height: 16px; object-fit: cover; }
.profile-locale-option span { overflow-wrap: anywhere; }
.profile-row { display: flex; gap: 8px; margin-top: 12px; }
.profile-row input { min-width: 0; flex: 1; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #100b10; color: var(--text); font-size: 11px; }
.profile-row button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #291824; color: #d3a6ba; font-size: 10px; }
.profile-row button:hover { background: #3b2230; }
body.authenticated .account-gate { display: none; }
@media (max-width: 450px) { .account-gate { padding: 18px; } .account-card { padding: 23px; } .profile-row { align-items: stretch; flex-direction: column; } }
@keyframes float-mark { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes send-spin { to { transform: rotate(360deg); } }
@keyframes typing-pulse { 0%, 60%, 100% { transform: translateY(0); opacity: .38; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes silver-pass { 0%, 15% { background-position: -100% 50%; } 75%, 100% { background-position: 200% 50%; } }
@keyframes workspace-in { from { transform: translateY(6px) scale(1.003); } to { transform: translateY(0) scale(1); } }
@property --saber-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes account-saber-flow { to { --saber-angle: 360deg; } }

@media (prefers-reduced-motion: reduce) {
  .account-card::before { animation: none; }
}

@media (max-height: 580px) {
  .welcome { top: 40%; }
  .composer-area { margin-bottom: 31px; }
  .messages { padding-top: 49px; }
  .options-sheet, dialog { max-height: calc(100vh - 52px); }
  .sheet-header { padding-top: 15px; padding-bottom: 15px; }
  .secondary-view { padding-top: 22px; }
  .history { max-height: 110px; }
}
@media (max-width: 680px) {
  .composer-area { width: calc(100% - 84px); max-width: 560px; }
  .options-sheet, dialog { width: calc(100vw - 40px); }
  .workspace-panel { width: min(320px, calc(100vw - 44px)); }
  .sheet-header { padding-left: 22px; padding-right: 22px; }
  .secondary-view { padding: 23px 22px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .page-heading h1 { font-size: 23px; }
  .connection-grid { grid-template-columns: 1fr; }
  .connection-card p { min-height: 0; }
  .provider-logo { margin-bottom: 13px; }
  .connection-card { padding: 18px; }
  .setting-row { gap: 15px; }
  .settings-panel { padding: 0 16px; }
  .modal-header, .modal-body { padding: 20px; }
  .modal-footer { padding: 14px 20px; }
}
@media (max-width: 450px) {
  .composer-area { width: calc(100% - 38px); margin-bottom: calc(83px + env(safe-area-inset-bottom)); }
  .menu-trigger { left: max(22px, env(safe-area-inset-left)); bottom: calc(22px + env(safe-area-inset-bottom)); }
  .workspace-panel { bottom: calc(68px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 104px - env(safe-area-inset-bottom)); }
  .composer textarea, .search-box input, .history-search { font-size: 16px; }
  .welcome { top: 40%; }
  .messages { padding: 47px 20px 8px; }
  .message-body, .message-actions { padding-left: 0; }
  .message-attachment { margin-left: 0; }
  .skill-grid { grid-template-columns: 1fr; }
  .library-meta > span:last-child { display: none; }
  .setting-row { align-items: flex-start; }
  .setting-row .secondary-button { padding: 8px; font-size: 9px; }
  .about-card > span { max-width: 72px; text-align: right; }
  .modal-footer { flex-wrap: wrap; }
  .toast { bottom: 72px; max-width: calc(100vw - 38px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Miniaturas de imagem colada/anexada */
.context-chip .chip-thumb{width:26px;height:26px;object-fit:cover;border-radius:4px;flex-shrink:0}
.message-attachment.is-image{flex-direction:column;align-items:flex-start;gap:6px}
.message-attachment .att-thumb{width:160px;max-width:100%;max-height:160px;height:auto;object-fit:cover;border-radius:8px;display:block}

/* Estado visual para Drag and Drop de arquivos */
body.is-dragging-files::after {
  content: "Solte arquivos ou imagens aqui para anexar";
  position: fixed;
  inset: 16px;
  background: rgba(18, 12, 18, 0.88);
  border: 2px dashed rgba(220, 100, 140, 0.7);
  border-radius: 20px;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 500;
  pointer-events: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 40px rgba(220, 100, 140, 0.25);
  animation: pulse-drag 1.5s infinite alternate ease-in-out;
}

@keyframes pulse-drag {
  from { border-color: rgba(220, 100, 140, 0.4); }
  to { border-color: rgba(220, 100, 140, 0.9); }
}

/* ==========================================================================
   BARRA LATERAL (SIDEBAR) KRAKEN AI — EXPANSÃO E RETRAÇÃO
   ========================================================================== */
.app-shell {
  display: flex !important;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.workspace {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  margin-left: 68px;
  width: calc(100vw - 68px);
  max-width: calc(100vw - 68px);
}

.kraken-sidebar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 260px;
  min-width: 260px;
  height: 100%;
  background: rgba(14, 10, 14, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(195, 129, 151, 0.16);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  box-sizing: border-box;
  z-index: 120;
  box-shadow: 18px 0 45px rgba(0, 0, 0, 0.75);
  transition: width .28s cubic-bezier(0.4, 0, 0.2, 1), min-width .28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow .28s ease, padding .28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Estado Retraído / Colapsado */
.kraken-sidebar.collapsed {
  width: 68px;
  min-width: 68px;
  padding: 16px 8px;
  box-shadow: none;
}

.kraken-sidebar.collapsed .sidebar-label,
.kraken-sidebar.collapsed .sidebar-brand-name,
.kraken-sidebar.collapsed .sidebar-section-title span,
.kraken-sidebar.collapsed .sidebar-search-btn,
.kraken-sidebar.collapsed .sidebar-search-input,
.kraken-sidebar.collapsed .chat-actions-group {
  display: none !important;
}

.kraken-sidebar.collapsed .sidebar-new-btn {
  justify-content: center;
  padding: 10px 0;
}

.kraken-sidebar.collapsed .sidebar-user-info {
  justify-content: center;
}

.kraken-sidebar.collapsed .sidebar-logout-btn {
  justify-content: center;
}

.kraken-sidebar.collapsed .history-item > button:first-child span {
  display: none;
}

.kraken-sidebar.collapsed .history-item > button:first-child {
  justify-content: center;
  padding: 8px 0;
}

/* Topo do Sidebar (Logo e Toggle) */
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  min-height: 38px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-decoration: none;
  min-width: 0;
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(220, 24, 60, 0.4));
}

.kraken-sidebar.collapsed .sidebar-top {
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.kraken-sidebar.collapsed .sidebar-brand {
  justify-content: center;
  width: 100%;
}

.sidebar-brand-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid rgba(195, 129, 151, 0.14);
  color: #b995aa;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .2s ease;
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: rgba(200, 60, 100, 0.15);
  color: #fff;
  border-color: rgba(220, 100, 140, 0.4);
}

.sidebar-toggle-btn svg {
  width: 14px;
  height: 14px;
}

/* Botão Nova Conversa */
.sidebar-actions {
  margin-bottom: 16px;
}

.sidebar-new-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(220, 30, 70, 0.22), rgba(160, 20, 50, 0.12));
  border: 1px solid rgba(230, 80, 120, 0.35);
  border-radius: 12px;
  color: #f7e6ee;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.sidebar-new-btn:hover {
  background: linear-gradient(135deg, rgba(220, 30, 70, 0.4), rgba(160, 20, 50, 0.25));
  border-color: rgba(240, 100, 140, 0.6);
  color: #fff;
  transform: translateY(-1px);
}

.sidebar-new-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Área de Histórico */
.sidebar-history-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 12px;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: #a48194;
}

.sidebar-search-btn {
  background: transparent;
  border: none;
  color: #a48194;
  cursor: pointer;
  padding: 2px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  transition: color .2s;
}

.sidebar-search-btn:hover {
  color: #fff;
}

.sidebar-search-btn svg {
  width: 13px;
  height: 13px;
}

.sidebar-search-input {
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(195, 129, 151, 0.15);
  border-radius: 8px;
  background: rgba(20, 12, 18, 0.9);
  color: #eee;
  font-size: 11px;
}

.sidebar-history-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
}

.sidebar-history-list::-webkit-scrollbar {
  width: 4px;
}

.sidebar-history-list::-webkit-scrollbar-thumb {
  background: rgba(200, 80, 120, 0.2);
  border-radius: 4px;
}

.sidebar-history-list .history-item {
  display: flex;
  align-items: center;
  border-radius: 10px;
  padding: 2px 4px;
  transition: background .2s ease;
  position: relative;
}

.sidebar-history-list .history-item:hover,
.sidebar-history-list .history-item.selected {
  background: rgba(210, 50, 90, 0.14);
}

.sidebar-history-list .history-item.selected {
  border: 1px solid rgba(220, 80, 120, 0.28);
}

.sidebar-history-list .history-item > button:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: #d1bdca;
  text-align: left;
  font-size: 11px;
  padding: 7px 6px;
  cursor: pointer;
}

.sidebar-history-list .history-item > button:first-child svg {
  width: 14px;
  height: 14px;
  color: #b08298;
  flex-shrink: 0;
}

.sidebar-history-list .history-item > button:first-child span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Grupo de Ações do Item de Conversa (Editar + Excluir) */
.chat-actions-group {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity .18s ease;
  margin-left: auto;
}

.sidebar-history-list .history-item:hover .chat-actions-group,
.sidebar-history-list .history-item:focus-within .chat-actions-group {
  opacity: 1;
}

.btn-chat-action {
  background: transparent;
  border: none;
  color: #a48194;
  cursor: pointer;
  padding: 4px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  transition: all .2s;
}

.btn-chat-action:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-chat-action.delete:hover {
  color: #ff6b81;
  background: rgba(255, 107, 129, 0.15);
}

.btn-chat-action svg {
  width: 12px;
  height: 12px;
}

/* Rodapé do Sidebar (Perfil do Usuário e Botão Sair) */
.sidebar-footer {
  border-top: 1px solid rgba(195, 129, 151, 0.12);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d82b54, #73122c);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(216, 43, 84, 0.3);
}

.sidebar-user-name {
  font-size: 11px;
  color: #e5d4de;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout-btn {
  background: transparent;
  border: 1px solid rgba(195, 129, 151, 0.15);
  border-radius: 8px;
  color: #c4a1b3;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background: rgba(220, 50, 80, 0.18);
  border-color: rgba(220, 50, 80, 0.4);
  color: #ff94ab;
}

.sidebar-logout-btn svg {
  width: 14px;
  height: 14px;
}

/* Backdrop escuro para sobreposição do menu lateral no mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Seção de Ferramentas dentro do Menu Lateral (exclusiva para Mobile) */
.sidebar-mobile-tools {
  display: none;
  border-top: 1px solid rgba(195, 129, 151, 0.12);
  padding: 12px 0;
  margin-top: 8px;
}

.sidebar-mobile-tools-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.sidebar-mobile-tool-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(195, 129, 151, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: #f0e4ec;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-align: left;
}

.sidebar-mobile-tool-btn:hover {
  background: rgba(220, 50, 90, 0.18);
  border-color: rgba(220, 50, 90, 0.4);
  color: #fff;
}

.sidebar-mobile-tool-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #e5a4bf;
}

/* Botão Hambúrguer Mobile */
.mobile-hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(195, 129, 151, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #f0e6ec;
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 10px;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
}

.mobile-hamburger-btn:hover {
  background: rgba(220, 50, 90, 0.2);
  border-color: rgba(220, 50, 90, 0.45);
}

.mobile-hamburger-btn svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   BARRA SUPERIOR DO CHAT (HEADER COM TÍTULO E BOTÃO LIMPAR CONVERSA)
   ========================================================================== */
.chat-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(195, 129, 151, 0.1);
  background: rgba(14, 10, 14, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
  min-height: 48px;
}

.chat-title-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.chat-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2ed573;
  box-shadow: 0 0 8px #2ed573;
  flex-shrink: 0;
}

.active-chat-title {
  font-size: 13px;
  font-weight: 500;
  color: #eedde7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-context-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 4px 8px;
  border: 1px solid rgba(195, 129, 151, .3);
  border-radius: 999px;
  background: rgba(35, 20, 28, .6);
  color: #e7cbd7;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.browser-context-indicator svg { width: 13px; height: 13px; }
.browser-context-indicator:hover { background: rgba(220, 40, 70, .16); border-color: rgba(220, 80, 110, .4); }
.browser-context-indicator[hidden] { display: none !important; }

.chat-top-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-tools-trigger {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(35, 20, 28, 0.7);
  border: 1px solid rgba(195, 129, 151, 0.22);
  color: #ccaec0;
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 0;
  transition: all 0.2s ease;
}

.chat-tools-trigger:hover,
.chat-tools-trigger[aria-expanded="true"] {
  background: rgba(220, 40, 70, 0.18);
  border-color: rgba(220, 80, 110, 0.45);
  color: #ff8ca3;
}

.chat-tools-chevron {
  transition: transform 0.2s ease;
}

.chat-tools-trigger[aria-expanded="true"] .chat-tools-chevron {
  transform: rotate(180deg);
}

.chat-tools-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: #181014;
  border: 1px solid rgba(195, 129, 151, 0.25);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  padding: 5px;
  z-index: 999;
  border-radius: 0;
}

.chat-tools-dropdown-menu.hidden {
  display: none !important;
}

.chat-tools-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #d8c2ce;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.16s ease;
}

.chat-tools-item:hover {
  background: rgba(255, 39, 78, 0.14);
  color: #ffffff;
}

.chat-tools-item svg {
  width: 14px;
  height: 14px;
  color: #b993a4;
  flex-shrink: 0;
}

.chat-tools-item:hover svg {
  color: #ff274e;
}

.chat-tools-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 6px;
}

.chat-tools-item-danger {
  color: #ff5e7e;
}

.chat-tools-item-danger:hover {
  background: rgba(255, 39, 78, 0.2);
  color: #ffffff;
}

.chat-action-btn {
  background: rgba(35, 20, 28, 0.6);
  border: 1px solid rgba(195, 129, 151, 0.18);
  border-radius: 8px;
  color: #ccaec0;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  cursor: pointer;
  transition: all .2s ease;
}

.chat-action-btn:hover {
  background: rgba(220, 40, 70, 0.16);
  border-color: rgba(220, 80, 110, 0.4);
  color: #ff8ca3;
}

.chat-action-btn.active,
.chat-action-btn[aria-pressed="true"] {
  background: rgba(220, 40, 70, 0.28);
  border-color: rgba(220, 80, 110, 0.6);
  color: #ff8ca3;
  box-shadow: 0 0 12px rgba(220, 40, 70, 0.2);
}

.chat-action-btn svg {
  width: 13px;
  height: 13px;
}

/* ==========================================================================
   FORMATAÇÃO PREMIUM DE MENSAGENS E CAIXAS DE CÓDIGO
   ========================================================================== */
.message-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.68;
  color: #eee0e8;
  letter-spacing: 0.05px;
}

.message.user .message-body {
  color: #f7eef3;
  background: rgba(38, 22, 32, 0.5);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(195, 129, 151, 0.1);
  display: inline-block;
  max-width: 100%;
}

.message.assistant .message-body {
  color: #e5d8e1;
}

/* Títulos dentro das respostas */
.message-body .md-h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 16px 0 8px;
  letter-spacing: -0.3px;
  border-bottom: 1px solid rgba(195, 129, 151, 0.15);
  padding-bottom: 6px;
}

.message-body .md-h2 {
  font-size: 15px;
  font-weight: 600;
  color: #ffd6e4;
  margin: 14px 0 6px;
}

.message-body .md-h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: #e6b8cb;
  margin: 12px 0 4px;
}

.message-body .md-p {
  margin: 0 0 10px;
}

.message-body .md-p:last-child {
  margin-bottom: 0;
}

/* Listas estilizadas */
.message-body .md-ul {
  margin: 6px 0 10px 18px;
  padding: 0;
  list-style-type: disc;
}

.message-body .md-li {
  margin-bottom: 4px;
  line-height: 1.55;
  color: #e3d2dc;
}

/* Destaque de código em linha (inline code) */
.message-body .inline-code {
  background: rgba(220, 50, 90, 0.15);
  border: 1px solid rgba(220, 80, 120, 0.25);
  color: #ff9cb2;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, Monaco, monospace;
  font-size: 12px;
}

/* Citações */
.message-body .md-quote {
  border-left: 3px solid rgba(220, 50, 90, 0.6);
  padding: 6px 14px;
  margin: 8px 0;
  color: #caaebf;
  background: rgba(25, 15, 22, 0.4);
  border-radius: 0 8px 8px 0;
}

/* ==========================================================================
   CAIXA DE CÓDIGO E PLANOS COM BOTÃO COPIAR (COMPACTA, ELEGANTE E DISCRETA)
   ========================================================================== */
.code-container {
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid rgba(195, 129, 151, 0.16);
  background: #0d070b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.code-container.is-plan-block {
  border-color: rgba(213, 57, 88, 0.3);
  background: #10080d;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: rgba(22, 13, 19, 0.95);
  border-bottom: 1px solid rgba(195, 129, 151, 0.1);
  min-height: 28px;
  order: -1;
  margin: 0;
}

.code-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.code-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d53958;
  opacity: 0.85;
}

.code-lang {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #cca4b7;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.code-lang-label {
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #cca4b7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.code-copy-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(195, 129, 151, 0.14);
  color: #bfa5b4;
  border-radius: 4px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  cursor: pointer;
  line-height: 1;
  transition: all .15s ease;
}

.code-copy-btn:hover {
  background: rgba(213, 57, 88, 0.18);
  border-color: rgba(213, 57, 88, 0.38);
  color: #fff;
}

.code-copy-btn svg {
  width: 11px;
  height: 11px;
}

.code-body {
  padding: 8px 12px;
  margin: 0;
  overflow-x: auto;
  background: transparent;
}

.code-body code {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  color: #ede0e8;
  white-space: pre;
}

.code-body::-webkit-scrollbar {
  height: 4px;
}

.code-body::-webkit-scrollbar-thumb {
  background: rgba(200, 70, 110, 0.2);
  border-radius: 3px;
}

/* ==========================================================================
   DESTAQUES DE COR E SINTAXE (SYNTAX HIGHLIGHTING)
   ========================================================================== */
.hl-keyword { color: #ff7597; font-weight: 600; }
.hl-tag { color: #ff7597; font-weight: 600; }
.hl-attr { color: #ffb86c; }
.hl-string { color: #1ed760; }
.hl-comment { color: #6272a4; font-style: italic; }
.hl-func { color: #8be9fd; font-weight: 500; }
.hl-builtin { color: #bd93f9; }
.hl-atom { color: #f1fa8c; }
.hl-number { color: #bd93f9; }
.hl-selector { color: #50fa7b; font-weight: 600; }
.hl-property { color: #8be9fd; }
.hl-color { padding: 0 2px; border-radius: 2px; }

/* ==========================================================================
   ALINHAMENTO DE CONVERSA (USUÁRIO À DIREITA, AGENTE À ESQUERDA)
   ========================================================================== */
.messages {
  width: min(780px, 100%) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 28px !important;
  padding: 32px 34px 20px !important;
}

.message {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  margin-bottom: 0 !important;
}

/* Mensagem do Usuário (Alinhada à Direita) */
.message.user {
  align-items: flex-end !important;
  text-align: right !important;
}

.message.user .message-head {
  flex-direction: row-reverse !important;
  justify-content: flex-start !important;
  gap: 8px !important;
}

.message.user .message-head time {
  margin-left: 0 !important;
  margin-right: 8px !important;
}

.message.user .message-body {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 15px !important;
  line-height: 1.7 !important;
  color: #ffffff !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  text-align: right !important;
  max-width: 85% !important;
}

.message.user .message-actions {
  justify-content: flex-end !important;
  padding-left: 0 !important;
}

/* Mensagem do Agente Kraken (Alinhada à Esquerda) */
.message.assistant {
  align-items: flex-start !important;
  text-align: left !important;
}

.message.assistant .message-head {
  flex-direction: row !important;
  justify-content: flex-start !important;
}

.message.assistant .message-body {
  background: transparent !important;
  border: none !important;
  padding-left: 0 !important;
  font-size: 15px !important;
  line-height: 1.7 !important;
  color: #e6dbe2 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  text-align: left !important;
  width: 100% !important;
  max-width: 100% !important;
}

.message.assistant .message-actions {
  padding-left: 0 !important;
}

/* Tipografia de Cabeçalhos e Parágrafos nas Respostas */
.message.assistant .message-body .md-h1 {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin: 18px 0 10px !important;
}

.message.assistant .message-body .md-h2 {
  font-size: 17px !important;
  font-weight: 600 !important;
  color: #ffccd9 !important;
  margin: 16px 0 8px !important;
}

.message.assistant .message-body .md-h3 {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #f1b3cb !important;
  margin: 14px 0 6px !important;
}

.message.assistant .message-body .md-h4 {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #e5a4bf !important;
  margin: 12px 0 5px !important;
}

.message.assistant .message-body .md-p {
  font-size: 15px !important;
  line-height: 1.72 !important;
  color: #e7dbe3 !important;
  margin: 0 0 12px !important;
}

.message.assistant .message-body .md-ul,
.message.assistant .message-body .md-ol {
  margin: 0 0 14px 0 !important;
  padding-left: 24px !important;
}

.message.assistant .message-body .md-li {
  font-size: 15px !important;
  line-height: 1.68 !important;
  color: #e5d8e1 !important;
  margin-bottom: 6px !important;
}

.message.assistant .message-body .inline-code {
  font-size: 13.5px !important;
  padding: 3px 7px !important;
}

/* ==========================================================================
   PAINEL LATERAL DE DOCUMENTOS E ARQUIVOS DO PROJETO (SEMPRE AO LADO DO MENU)
   ========================================================================== */
:root {
  --files-panel-width: 280px;
}

.project-files-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--files-panel-width);
  min-width: 200px;
  max-width: 650px;
  background: rgba(14, 9, 13, 0.98);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-right: 1px solid rgba(195, 129, 151, 0.22);
  display: none;
  flex-direction: column;
  z-index: 110;
  left: 68px;
  border-radius: 0;
  box-shadow: 18px 0 45px rgba(0, 0, 0, 0.75);
}

.kraken-sidebar.collapsed ~ .project-files-panel {
  left: 68px;
}

.app-shell.files-right .project-files-panel {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid rgba(195, 129, 151, 0.22);
  box-shadow: -18px 0 45px rgba(0, 0, 0, 0.75);
}

.project-files-panel.is-open {
  display: flex !important;
}

/* O painel de arquivos sobrepõe a tela (overlay) sem empurrar o workspace */

/* Linha / Alça de redimensionamento da largura do painel */
.project-files-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: -3px;
  width: 6px;
  cursor: col-resize;
  z-index: 100;
  transition: background 0.2s;
}

.project-files-resizer:hover,
.project-files-resizer.is-resizing {
  background: rgba(220, 50, 90, 0.6);
}

.app-shell.files-right .project-files-resizer {
  right: auto;
  left: -3px;
}

/* ==========================================================================
   BOTÃO DE EXPANDIR E LIGHTBOX DE IMAGENS / DOCUMENTOS
   ========================================================================== */
.attachment-preview-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.expand-media-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(195, 129, 151, 0.25);
  color: #eedee7;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.expand-media-btn:hover {
  background: rgba(213, 57, 88, 0.25);
  border-color: rgba(213, 57, 88, 0.5);
  color: #ffffff;
}

/* Modal Lightbox de Visualização em Alta Resolução */
.media-viewer-modal {
  border: 1px solid rgba(195, 129, 151, 0.25);
  border-radius: 14px;
  padding: 0;
  background: rgba(12, 7, 11, 0.96);
  backdrop-filter: blur(35px);
  color: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  max-width: 90vw;
  max-height: 90vh;
  outline: none;
}

.media-viewer-modal::backdrop {
  background: rgba(4, 2, 4, 0.85);
  backdrop-filter: blur(10px);
}

.media-viewer-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.media-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(195, 129, 151, 0.12);
  background: rgba(25, 15, 22, 0.8);
}

.media-viewer-title {
  font-size: 12px;
  font-weight: 600;
  color: #e5b3cb;
  letter-spacing: 0.5px;
}

.media-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-viewer-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  max-width: 86vw;
  max-height: 80vh;
}

.media-viewer-body img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease-out;
}

.project-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(195, 129, 151, 0.1);
  background: rgba(22, 13, 20, 0.6);
}

.project-files-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #eedde7;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-files-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-files-search-box {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(195, 129, 151, 0.08);
}

.project-files-tree {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  color: #c9b4c2;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.tree-item:hover {
  background: rgba(213, 57, 88, 0.12);
  color: #ffffff;
}

.tree-dir > summary {
  list-style: none;
}
.tree-dir > summary::-webkit-details-marker {
  display: none;
}

.tree-arrow {
  font-size: 11px;
  color: #8f7281;
  display: inline-block;
  width: 10px;
  transition: transform 0.2s ease;
}
.tree-dir[open] > summary .tree-arrow {
  transform: rotate(90deg);
}

.tree-sub {
  padding-left: 14px;
  border-left: 1px solid rgba(195, 129, 151, 0.08);
  margin-left: 7px;
}

.file-tree-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tree-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   SEÇÃO DE HISTÓRICO DE DOCUMENTOS & MÍDIAS DA SESSÃO
   ========================================================================== */
.project-docs-history-section {
  border-top: 1px solid rgba(195, 129, 151, 0.15);
  display: flex;
  flex-direction: column;
  max-height: 40%;
  background: rgba(18, 12, 17, 0.7);
}

.project-docs-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(26, 17, 24, 0.9);
  border-bottom: 1px solid rgba(195, 129, 151, 0.08);
}

.project-docs-history-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #df9cb5;
}

.docs-count-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(213, 57, 88, 0.2);
  color: #ff7597;
}

.project-docs-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(195, 129, 151, 0.06);
  cursor: grab;
  transition: all 0.15s ease;
  user-select: none;
}

.doc-history-item:hover {
  background: rgba(213, 57, 88, 0.12);
  border-color: rgba(213, 57, 88, 0.3);
  transform: translateX(2px);
}

.doc-history-item:active {
  cursor: grabbing;
}

.doc-history-thumb {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.doc-history-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.doc-history-name {
  font-size: 11px;
  font-weight: 500;
  color: #e5d7e0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-history-meta {
  font-size: 9.5px;
  color: #8f7786;
}

.doc-history-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.doc-history-item:hover .doc-history-actions {
  opacity: 1;
}

.doc-action-btn {
  background: none;
  border: none;
  color: #df9cb5;
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-action-btn:hover {
  background: rgba(213, 57, 88, 0.25);
  color: #fff;
}

/* ==========================================================================
   MENU AUTOCOMPLETE DE MENÇÃO @ NO PROMPT
   ========================================================================== */
.mention-autocomplete-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 20px;
  width: min(380px, 92%);
  max-height: 260px;
  overflow-y: auto;
  background: rgba(20, 13, 19, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(213, 57, 88, 0.35);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 3px;
}

.mention-autocomplete-menu.hidden {
  display: none !important;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #e5d7e0;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.mention-item:hover, .mention-item.selected {
  background: rgba(213, 57, 88, 0.25);
  color: #fff;
}

.mention-thumb {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
}

.mention-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-badge {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #df9cb5;
  margin-left: auto;
}

/* Área de Drop no Composer */
.composer.drag-over {
  border-color: #1ed760 !important;
  background: rgba(30, 215, 96, 0.08) !important;
  box-shadow: 0 0 16px rgba(30, 215, 96, 0.25) !important;
}

/* ==========================================================================
   CARD DE ARQUIVOS ALTERADOS / DIFF (ESTILO CURSOR / AGENT)
   ========================================================================== */
.changed-files-pill {
  width: min(540px, 100%);
  margin: 6px 0 12px 0;
  border-radius: 10px;
  background: #140d12;
  border: 1px solid rgba(195, 129, 151, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.project-preview-card {
  display: grid;
  gap: 8px;
  width: min(540px, 100%);
  margin: 6px 0 12px;
  padding: 11px 13px;
  border: 1px solid rgba(112, 211, 176, 0.3);
  border-radius: 10px;
  background: rgba(15, 38, 31, 0.48);
}

.project-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #d7f7e9;
  font-size: 12px;
}

.project-preview-heading a {
  color: #79e1b5;
  font-weight: 700;
  text-decoration: none;
}

.project-preview-heading a:hover {
  text-decoration: underline;
}

.project-preview-heading a:focus-visible {
  outline: 2px solid #79e1b5;
  outline-offset: 3px;
}

.project-preview-card code {
  overflow-wrap: anywhere;
  color: #a7cbbd;
  font-size: 11px;
}

.changed-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(28, 17, 25, 0.85);
  border-bottom: 1px solid rgba(195, 129, 151, 0.1);
  font-size: 11.5px;
}

.changed-files-count {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #eedee7;
  font-weight: 600;
}

.diff-add {
  color: #4ade80;
  font-weight: 700;
  font-size: 11px;
}

.diff-del {
  color: #f87171;
  font-weight: 700;
  font-size: 11px;
}

.open-diff-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(195, 129, 151, 0.18);
  color: #c9b0be;
  font-size: 10.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.open-diff-btn:hover {
  background: rgba(213, 57, 88, 0.2);
  border-color: rgba(213, 57, 88, 0.4);
  color: #fff;
}

.changed-files-list {
  padding: 4px 6px;
}

.changed-file-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 11px;
  color: #c4b0bd;
  cursor: pointer;
  transition: background 0.15s ease;
}

.changed-file-row:hover {
  background: rgba(213, 57, 88, 0.1);
  color: #ffffff;
}

.code-file-viewer-modal {
  width: min(920px, calc(100vw - 32px));
  height: min(78vh, 760px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  background: rgba(12, 8, 12, .98);
  color: #eadfe6;
  box-shadow: 0 28px 90px rgba(0,0,0,.72), 0 0 0 1px rgba(213,57,88,.08);
}
.code-file-viewer-shell { height: 100%; display: flex; flex-direction: column; }
.code-file-viewer-header { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.code-file-viewer-heading { min-width: 0; display: flex; align-items: center; gap: 10px; }
.code-file-viewer-heading > div { min-width: 0; display: grid; gap: 3px; }
.code-file-viewer-heading strong { font-size: 13px; }
.code-file-viewer-heading span:last-child { color: #a995a0; font: 10px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.code-file-viewer-icon { display: inline-flex; color: #e06484; }
.code-file-viewer-icon svg { width: 18px; height: 18px; }
.code-file-viewer-actions { flex: none; display: flex; gap: 6px; }
.code-file-viewer-status { flex: none; padding: 7px 14px; border-bottom: 1px solid rgba(255,255,255,.06); color: #bfaab4; font-size: 10px; }
.code-file-viewer-body { flex: 1; min-height: 0; margin: 0; padding: 18px; overflow: auto; white-space: pre; tab-size: 2; color: #dcd1d7; font: 12px/1.62 ui-monospace, SFMono-Regular, Consolas, monospace; background: #100c10; }
.code-file-viewer-body code { color: inherit; }
.run-activity-toggle { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: rgba(255,255,255,.04); color: #c4aeba; cursor: pointer; }
.run-activity-toggle svg { width: 14px; height: 14px; transition: transform .18s ease; }
.run-activity-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }
.run-activity-details.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .composer::before { animation-duration: 12s; }
}

.file-icon-mini {
  display: flex;
  align-items: center;
}
.file-icon-mini svg {
  width: 13px;
  height: 13px;
}

.changed-file-name {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-diff-stat {
  font-size: 10px;
  display: flex;
  gap: 4px;
}

/* ==========================================================================
   TABELAS E ALERTAS EXECUTIVOS NO CHAT DO KRAKEN
   ========================================================================== */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid rgba(195, 129, 151, 0.16);
  border-radius: 4px;
  background: rgba(18, 11, 16, 0.7);
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
  color: #eedee7;
}

.md-table th {
  background: rgba(45, 20, 32, 0.85);
  color: #fff;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(195, 129, 151, 0.25);
  white-space: nowrap;
}

.md-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(195, 129, 151, 0.08);
  line-height: 1.5;
}

.md-table tr:hover td {
  background: rgba(220, 40, 80, 0.08);
}

.md-alert {
  padding: 10px 14px;
  margin: 12px 0;
  border-left: 3px solid;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.55;
}

.md-alert.alert-important {
  background: rgba(220, 40, 70, 0.12);
  border-color: #e63956;
  color: #ffe6ec;
}

.md-alert.alert-note {
  background: rgba(60, 100, 200, 0.12);
  border-color: #3b82f6;
  color: #e0edff;
}
   /* ==========================================================================
   Preserva apenas o avatar do usuário e spinners em formato arredondado
   ========================================================================== */
.composer,
.chat-action-btn,
.sidebar-new-btn,
.sidebar-history-list .history-item,
.message.user .message-body,
.code-block,
.code-block-header,
.account-card,
.account-form input,
.history-search,
.primary-button,
.secondary-button,
.context-chip,
.changed-files-pill,
.project-files-panel,
.project-files-header,
.media-viewer-modal,
.media-viewer-container,
.btn-chat-action,
.sidebar-toggle-btn,
.sidebar-logout-btn,
.tree-item,
.sidebar-search-input,
.quick-add-item,
.menu-item,
.dialog,
dialog,
.toast {
  border-radius: 4px !important;
}

/* Preservação estrita dos elementos circulares */
.sidebar-user-avatar,
.chat-status-dot,
.typing-indicator i,
.status-dot,
.send-spinner {
  border-radius: 50% !important;
}

/* ==========================================================================
   CONTAINER DO FLUXOGRAMA MERMAID KRAKEN (TOPO FIXO E RENDERIZAÇÃO LIMPA)
   ========================================================================== */
.mermaid-container {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  margin: 16px 0 !important;
  border-radius: 8px !important;
  background: #10080d !important;
  border: 1px solid rgba(213, 57, 88, 0.3) !important;
  overflow: hidden !important;
}

.mermaid-container .code-header {
  order: -1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 14px !important;
  background: #180c13 !important;
  border-bottom: 1px solid rgba(213, 57, 88, 0.25) !important;
  margin: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.mermaid-diagram-body {
  padding: 24px 16px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  overflow-x: auto !important;
  min-height: 120px !important;
  background: transparent !important;
}

.mermaid-diagram-body svg {
  display: block !important;
  flex: 0 0 auto;
  width: min(100%, 960px) !important;
  max-width: 100% !important;
  height: auto !important;
}

.mermaid-diagram-body .flowchart-link,
.mermaid-diagram-body .edgePath .path {
  stroke-dasharray: 8 20;
  animation: mermaid-flow 24s linear infinite;
}

@keyframes mermaid-flow {
  to { stroke-dashoffset: -28; }
}

@media (prefers-reduced-motion: reduce) {
  .mermaid-diagram-body .flowchart-link,
  .mermaid-diagram-body .edgePath .path {
    animation: none !important;
  }
}

/* Agenda and inbox use the existing secondary-view and button tokens. */
.native-surface { display: grid; gap: 14px; }
.native-form { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.native-form label { display: grid; gap: 6px; color: var(--text); }
.native-form input, .native-form textarea { width: 100%; min-width: 0; padding: 9px; color: var(--text); background: var(--bg); border: 1px solid #806674; border-radius: 6px; }
.native-form input:focus-visible, .native-form textarea:focus-visible { outline: 2px solid #ce8298; outline-offset: 3px; }
.native-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.native-list { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; }
.native-item { display: grid; gap: 6px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.native-surface .primary-button, .native-surface .secondary-button { font-size: 13px; color: var(--text); }
.native-surface [role="status"] { color: #f3d8e4; }
.native-agent-panel { position: absolute; z-index: 25; inset: 0 0 0 auto; width: min(440px, 100%); overflow: auto; padding: 18px; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -18px 0 45px rgba(0,0,0,.45); }
.native-agent-panel[hidden] { display: none; }
.native-agent-panel .browser-panel-header { margin-bottom: 16px; }
.native-agent-panel button:focus-visible { outline: 2px solid #ce8298; outline-offset: 3px; }

/* ==========================================================================
   ESTILOS PREMIUM: TAREFAS DE SUBAGENTES & TRACE
   ========================================================================== */
.subagent-task-card {
  background: rgba(25, 16, 22, 0.85);
  border: 1px solid rgba(195, 129, 151, 0.18);
  border-radius: 0;
  padding: 12px 14px;
  gap: 8px;
  transition: all 0.2s ease;
}

.subagent-task-card:hover {
  border-color: rgba(255, 39, 78, 0.4);
  background: rgba(35, 20, 29, 0.95);
}

.subagent-task-card.is-running {
  border-color: rgba(255, 39, 78, 0.6);
  box-shadow: 0 0 16px rgba(255, 39, 78, 0.18);
}

.subagent-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subagent-card-header strong {
  font-size: 13px;
  color: #f5e4ec;
  font-weight: 600;
  line-height: 1.35;
}

.subagent-status-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 0;
  border: 1px solid currentColor;
}

.subagent-status-tag.status-completed {
  color: #2ed573;
  background: rgba(46, 213, 115, 0.12);
}

.subagent-status-tag.status-running,
.subagent-status-tag.status-queued {
  color: #ff9f1a;
  background: rgba(255, 159, 26, 0.12);
}

.subagent-status-tag.status-failed,
.subagent-status-tag.status-interrupted {
  color: #ff4757;
  background: rgba(255, 71, 87, 0.12);
}

.subagent-meta-time {
  font-size: 11px;
  color: #9d8392;
  margin: 0;
}

.subagent-goal-box {
  font-size: 11.5px;
  line-height: 1.45;
  color: #ded1d8;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.25);
  border-left: 2px solid #ff274e;
}

.subagent-tag-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.subagent-group-label {
  color: #a48c9b;
  font-weight: 600;
}

.subagent-badge {
  background: rgba(255, 39, 78, 0.18);
  border: 1px solid rgba(255, 39, 78, 0.4);
  color: #ff8ca3;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 0;
}

.subagent-skill-pill {
  background: rgba(142, 68, 173, 0.2);
  border: 1px solid rgba(155, 89, 182, 0.4);
  color: #e8c5f5;
  padding: 2px 7px;
  font-size: 10px;
  border-radius: 0;
}

.subagent-tool-pill {
  background: rgba(41, 128, 185, 0.2);
  border: 1px solid rgba(52, 152, 219, 0.4);
  color: #bcdffb;
  padding: 2px 7px;
  font-size: 10px;
  border-radius: 0;
}

.subagent-delivery-card {
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 10px;
  border-radius: 0;
}

.subagent-delivery-card summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #f0e1e9;
}

.subagent-delivery-snippet {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #eedde7;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(10, 5, 8, 0.6);
  padding: 8px;
}

.subagent-trace-btn {
  margin-top: 6px;
  padding: 6px 12px;
  background: rgba(255, 39, 78, 0.08);
  border: 1px solid rgba(255, 39, 78, 0.3);
  color: #f5d4df;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.subagent-trace-btn:hover {
  background: rgba(255, 39, 78, 0.22);
  border-color: #ff274e;
  color: #ffffff;
}

.subagent-trace-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.subagent-trace-section h3 {
  font-size: 12px;
  font-weight: 600;
  color: #eedbe5;
  margin-bottom: 8px;
}

.subagent-event-item {
  background: rgba(20, 12, 17, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  font-size: 11px;
  border-radius: 0;
}

/* ==========================================================================
   COMPOSER SIDE CONTROLS & CONTEXT METER
   ========================================================================== */
.composer-side-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.audio-record-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(195, 129, 151, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #f0e4ec;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.audio-record-btn:hover {
  background: rgba(255, 39, 78, 0.18);
  border-color: rgba(255, 39, 78, 0.45);
  color: #ffffff;
}

.audio-record-btn.is-recording {
  background: #ff274e;
  border-color: #ff274e;
  color: #ffffff;
  animation: krakenMicPulse 1.2s infinite ease-in-out;
}

@keyframes krakenMicPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 6px rgba(255, 39, 78, 0.6); }
  50% { transform: scale(1.12); box-shadow: 0 0 14px rgba(255, 39, 78, 0.95); }
}

.audio-record-btn svg {
  width: 15px;
  height: 15px;
}

.composer-action-column {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.context-meter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(195, 129, 151, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #ded1d8;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.context-meter-btn:hover {
  background: rgba(255, 39, 78, 0.12);
  border-color: rgba(255, 39, 78, 0.35);
  color: #ffffff;
}

.context-meter-svg {
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
}

.context-meter-bg {
  stroke: rgba(255, 255, 255, 0.15);
}

.context-meter-fill {
  stroke: #d53958;
  stroke-linecap: round;
  transition: stroke-dasharray 0.3s ease;
}
.sidebar-actions .sidebar-mobile-tool-btn { margin-top: 6px; }
.native-context-open { margin: 4px 0 8px; font-size: 13px; color: var(--text); }
.native-context-provenance { display: grid; gap: 4px; max-height: 100px; overflow: auto; overflow-wrap: anywhere; color: var(--text); }
.native-context-fieldset { display: grid; gap: 10px; min-width: 0; border: 1px solid #806674; border-radius: 8px; }
.native-context-choice { display: flex; align-items: flex-start; gap: 8px; overflow-wrap: anywhere; }
.native-context-choice span { white-space: pre-wrap; min-width: 0; }
#native-onboarding { width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; color: var(--text); background: var(--panel); border: 1px solid #806674; border-radius: 12px; }
#native-onboarding::backdrop { background: rgba(0,0,0,.8); }
#native-onboarding h2 { margin-bottom: 16px; }
.native-onboarding-choices { display: grid; gap: 8px; }
.native-onboarding-choices button { justify-content: flex-start; font-size: 14px; color: var(--text); }
.native-onboarding-choices img { object-fit: cover; flex-shrink: 0; }

.run-activity {
  margin: 12px 0 0 33px;
  padding: 4px 0;
  border: 0;
  background: transparent;
}

.chat-topic-rail {
  position: absolute;
  top: 38%;
  left: 28px;
  z-index: 20;
  display: flex;
  width: 18px;
  max-height: calc(100% - 32px);
  flex-direction: column;
  align-items: center;
  gap: 7px;
  overflow: visible;
}

.chat-topic-item {
  position: relative;
  display: flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.chat-topic-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.08);
}

.chat-topic-item:hover .chat-topic-dot,
.chat-topic-item:focus-visible .chat-topic-dot {
  box-shadow: 0 0 0 4px rgba(255,255,255,.18), 0 0 10px rgba(255,255,255,.65);
}

.chat-topic-icon,
.chat-topic-icon svg {
  width: 15px;
  height: 15px;
}

.chat-topic-text,
.chat-topic-tooltip {
  pointer-events: none;
  position: absolute;
  left: 38px;
}

.chat-topic-text { display: none; }

.chat-topic-tooltip {
  visibility: hidden;
  width: max-content;
  max-width: min(360px, 48vw);
  padding: 7px 9px;
  border: 1px solid rgba(213, 57, 88, .28);
  border-radius: 7px;
  background: #100d10;
  color: #eadbe1;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity .12s ease, transform .12s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .38);
}

.chat-topic-item:hover .chat-topic-tooltip,
.chat-topic-item:focus-visible .chat-topic-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
}

.run-activity-heading,
.run-trace-intro,
.trace-run-header,
.run-event-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.run-activity-heading {
  color: #e7d2dc;
  font-size: 11px;
}

.run-activity-icon,
.run-event-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d986a1;
}

.run-activity-icon svg,
.run-event-icon svg,
.run-event-file svg {
  width: 14px;
  height: 14px;
}

.run-activity-status {
  margin-left: auto;
  color: #b995a5;
  font-size: 10px;
}

.run-activity-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.run-activity-details {
  overflow: visible;
}

.run-activity-details.is-compact .run-activity-list {
  margin-top: 7px;
}
.run-activity-details.is-compact .run-event-meta {
  white-space: nowrap;
}
.run-activity-details.is-compact .run-event-meta span {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.run-activity-details.is-compact .run-event-content > p {
  display: -webkit-box;
  max-height: 34px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.run-activity-details.is-compact .run-event-details,
.run-activity-details.is-compact .run-event-file,
.run-activity-details.is-compact .run-event-content > small:not(.run-event-file),
.run-activity-details.is-compact .run-event-payload,
.run-activity-details.is-compact .run-event-children,
.run-activity-details.is-compact .run-event-meta time {
  display: none;
}

.run-event {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.run-event-icon {
  flex: 0 0 16px;
  margin-top: 2px;
}

.run-event-content {
  flex: 1;
  min-width: 0;
}

.run-event-children {
  display: grid;
  gap: 9px;
  margin: 9px 0 0;
  padding: 9px 0 0 12px;
  border-top: 1px solid rgba(195, 129, 151, .12);
  border-left: 1px solid rgba(195, 129, 151, .2);
}

.run-event-payload {
  margin-top: 8px;
  border: 1px solid rgba(195, 129, 151, .16);
  border-radius: 6px;
  background: rgba(8, 6, 8, .48);
}

.run-event-payload summary {
  padding: 7px 9px;
  color: #c7a8b7;
  font-size: 10px;
  cursor: pointer;
}

.run-event-payload pre {
  max-height: 360px;
  margin: 0;
  padding: 9px;
  overflow: auto;
  border-top: 1px solid rgba(195, 129, 151, .12);
  color: #d3c3ca;
  font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.run-context-manifest {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(195, 129, 151, .12);
}

.run-context-manifest h4 {
  margin: 4px 0 0;
  color: #e0cbd5;
  font-size: 10px;
  font-weight: 600;
}

.run-context-manifest p,
.run-context-policy,
.run-context-empty {
  margin: 0;
  color: #bda8b2;
  font-size: 10px;
  line-height: 1.5;
}

.run-context-policy {
  padding: 7px 9px;
  border-left: 2px solid rgba(213, 57, 88, .45);
  background: rgba(213, 57, 88, .06);
}

.run-context-messages,
.run-context-skills,
.run-context-sources {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.run-context-messages li,
.run-context-skills li,
.run-context-sources li {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(195, 129, 151, .1);
  border-radius: 6px;
  background: rgba(255, 255, 255, .018);
}

.run-context-messages li > strong,
.run-context-skills li > strong {
  color: #dfc7d2;
  font-size: 10px;
}

.run-context-messages li > small,
.run-context-skills li > small,
.run-context-sources li > small,
.run-context-omitted {
  color: #927d88;
  font-size: 9px;
}

.run-context-manifest .run-context-messages pre {
  max-height: 160px;
  margin: 2px 0 0;
  padding: 7px;
  overflow: auto;
  border: 1px solid rgba(195, 129, 151, .08);
  border-radius: 5px;
  background: rgba(0, 0, 0, .18);
  color: #cbb8c2;
  font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.run-context-sources li {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.run-context-sources code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #d3b9c5;
  font: 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.run-event-suppressed {
  display: block;
  margin-top: 6px;
  color: #9c8791;
  font-size: 9px;
}

.run-event-meta {
  flex-wrap: wrap;
  color: #a88d9b;
  font-size: 10px;
}

.run-event-meta strong {
  color: #e0cbd5;
  font-weight: 600;
}

.run-event-meta time {
  margin-left: auto;
  color: #806d77;
  font-variant-numeric: tabular-nums;
}

.run-event-content p,
.run-activity-empty,
.run-activity-error {
  margin: 3px 0 0;
  color: #c4b1bb;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.run-event-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  margin-top: 4px;
  color: #9dc9bd;
  font: 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.run-event-content > small:not(.run-event-file) {
  display: block;
  margin-top: 3px;
  color: #806d77;
  font-size: 9px;
}

.run-activity-empty {
  color: #97838d;
}

.run-activity-error,
.run-question-error {
  color: #ff9aab;
}

.run-question-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 9px;
  border: 1px solid rgba(213, 57, 88, .3);
  border-radius: 6px;
  color: #f0c4d2;
  font-size: 10px;
}

.run-question-open:hover {
  background: rgba(213, 57, 88, .12);
}

.run-question-open svg {
  width: 13px;
  height: 13px;
}

.run-trace-modal {
  padding: 18px 22px;
}

.run-trace-intro {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.run-trace-intro p {
  max-width: 48rem;
  color: #ae98a3;
  font-size: 11px;
  line-height: 1.55;
}

.run-trace-list {
  display: grid;
  gap: 12px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 4px;
}

dialog.run-activity-fullscreen-dialog[open] {
  display: flex;
  width: min(1200px, calc(100vw - 48px));
  height: min(850px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  flex-direction: column;
}

.run-activity-fullscreen-dialog #modal-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.run-activity-fullscreen-dialog .run-activity-focused {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.run-activity-fullscreen-dialog .run-trace-list {
  min-height: 0;
  max-height: none;
  flex: 1;
}

.trace-run {
  padding: 12px;
  border: 1px solid rgba(195, 129, 151, .14);
  border-radius: 8px;
  background: rgba(10, 7, 10, .42);
}

.trace-run-header {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.trace-run-header > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.trace-run-header strong {
  color: #e7d2dc;
  font-size: 11px;
}

.trace-run-header span,
.trace-run-header code {
  color: #9d8290;
  font-size: 9px;
}

.trace-run-header code {
  overflow-wrap: anywhere;
}

.trace-empty {
  padding: 22px 10px;
}

.run-question-label {
  display: block;
  margin: 13px 0 6px;
  color: #d8c3ce;
  font-size: 11px;
}

.run-question-answer {
  width: 100%;
  min-height: 96px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 6, 8, .8);
  color: var(--text);
  resize: vertical;
}

.run-question-or {
  margin-top: 9px;
  color: #95818b;
  font-size: 10px;
}

.run-question-error {
  min-height: 1.4em;
  margin-top: 6px;
  font-size: 11px;
}

.workspace-content {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.workspace-content > .chat-view {
  flex: 1;
  min-width: 0;
}

.browser-companion-panel {
  display: flex;
  flex: 0 0 min(44%, 680px);
  flex-direction: column;
  min-width: 320px;
  min-height: 0;
  padding: 14px;
  border-left: 1px solid rgba(195, 129, 151, .18);
  background: rgba(13, 9, 13, .94);
}

.browser-companion-panel.is-expanded {
  position: fixed;
  z-index: 100;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  max-height: 100vh;
  max-height: 100dvh;
  flex: 0 0 auto;
  overflow: hidden;
  border: 0;
  padding: clamp(12px, 2vw, 24px);
  background: rgba(8, 6, 8, .985);
}

.browser-companion-panel.is-expanded .browser-screen-viewer {
  min-height: 0;
}

.browser-companion-panel[hidden] {
  display: none !important;
}

.browser-panel-header,
.browser-target-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.browser-panel-header h2 {
  color: #ead9e1;
  font-size: 13px;
}

.browser-panel-header p,
.browser-panel-status,
.browser-screen-empty {
  color: #a48d99;
  font-size: 10px;
  line-height: 1.5;
}

.browser-panel-header p {
  margin-top: 3px;
}

.browser-url-form {
  display: flex;
  gap: 7px;
  margin: 12px 0 8px;
}

.browser-url-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(195, 129, 151, .2);
  border-radius: 6px;
  background: #100b10;
  color: var(--text);
  font-size: 11px;
}

.browser-url-form .primary-button {
  padding: 6px 12px;
}

.browser-panel-status {
  min-height: 1.5em;
  margin: 0 0 8px;
}

.browser-panel-status.is-error {
  color: #ff9aab;
}

.browser-observation-toggle {
  align-self: flex-start;
  margin-bottom: 5px;
  padding: 6px 9px;
  border-color: rgba(195, 129, 151, .22);
  font-size: 10px;
}

.browser-observation-toggle[aria-pressed="true"] {
  border-color: rgba(95, 190, 160, .45);
  color: #b7ead9;
}

.browser-current-page {
  overflow: hidden;
  margin: 0 0 8px;
  color: #bfaab5;
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-analysis-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 4px;
}

.browser-analysis-actions .secondary-button {
  min-width: 0;
  padding: 7px 8px;
  font-size: 9px;
}

.browser-analysis-note {
  margin: 0 0 8px;
  color: #897783;
  font-size: 9px;
  line-height: 1.45;
}

.browser-screen-viewer {
  display: flex;
  flex: 1 1 auto;
  gap: 7px;
  min-height: 220px;
}

.browser-screen-wrap {
  position: relative;
  display: grid;
  flex: 1 1 auto;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(195, 129, 151, .16);
  border-radius: 7px;
  background: #080608;
}

.browser-screen-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  cursor: crosshair;
}

.browser-fullscreen-toggle {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(225, 176, 194, .25);
  border-radius: 8px;
  background: rgba(8, 6, 8, .82);
  color: #ead9e1;
  backdrop-filter: blur(8px);
}

.browser-fullscreen-toggle:hover {
  border-color: rgba(213, 57, 88, .6);
  color: #fff;
}

.browser-fullscreen-toggle svg {
  width: 16px;
  height: 16px;
}

.browser-page-scroll {
  flex: 0 0 18px;
  width: 18px;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 2px 0;
  accent-color: #bf768e;
  cursor: ns-resize;
  direction: ltr;
  writing-mode: vertical-lr;
}

#browser-page-scroll:disabled {
  cursor: default;
  opacity: .35;
}

#browser-screen[hidden] {
  display: none !important;
}

.browser-screen-empty {
  max-width: 260px;
  padding: 20px;
  text-align: center;
}

.browser-target-section {
  display: flex;
  flex: 0 1 200px;
  flex-direction: column;
  min-height: 100px;
  margin-top: 12px;
}

.browser-target-heading h3 {
  color: #d7becb;
  font-size: 10px;
  font-weight: 600;
}

.browser-targets {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 0;
  margin-top: 7px;
  overflow: auto;
}

.browser-target {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid rgba(195, 129, 151, .12);
  border-radius: 5px;
  background: rgba(32, 19, 28, .55);
  color: #d9c6d0;
  text-align: left;
  font-size: 10px;
}

.browser-target:hover {
  border-color: rgba(213, 57, 88, .38);
  background: rgba(213, 57, 88, .09);
}

.browser-target svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: #c87b95;
}

.browser-target-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-target-ref {
  color: #897783;
  font: 9px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.browser-panel-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(195, 129, 151, .12);
}

.browser-panel-actions .secondary-button {
  padding: 6px 8px;
  font-size: 9px;
}

@media (max-width: 768px) {
  .mobile-hamburger-btn {
    display: inline-flex !important;
  }

  .chat-top-actions {
    display: flex !important;
    top: 54px !important;
    right: 12px !important;
    left: auto !important;
    z-index: 25 !important;
  }

  .workspace.has-side-panel .chat-top-actions {
    top: 10px !important;
    left: 56px !important;
    right: auto !important;
    z-index: 30 !important;
  }

  .workspace {
    margin-left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .kraken-sidebar {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 86vw !important;
    z-index: 300 !important;
    transform: translateX(-100%);
    box-shadow: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  }

  .kraken-sidebar.mobile-open {
    transform: translateX(0) !important;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.9) !important;
  }

  .kraken-sidebar.mobile-open .sidebar-label,
  .kraken-sidebar.mobile-open .sidebar-brand-name,
  .kraken-sidebar.mobile-open .sidebar-section-title span,
  .kraken-sidebar.mobile-open .sidebar-search-btn {
    display: inline-block !important;
  }

  .kraken-sidebar.mobile-open .sidebar-new-btn,
  .kraken-sidebar.mobile-open .sidebar-user-info,
  .kraken-sidebar.mobile-open .sidebar-logout-btn {
    justify-content: flex-start !important;
  }

  .kraken-sidebar.mobile-open .history-item > button:first-child span {
    display: inline-block !important;
  }

  .sidebar-mobile-tools {
    display: block !important;
  }

  .project-files-panel {
    left: 0 !important;
    width: 100% !important;
    max-width: 90vw !important;
    z-index: 280 !important;
  }

  .chat-top-bar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .run-activity {
    margin-left: 0;
    padding: 10px;
  }

  .run-trace-modal {
    padding: 14px;
  }

  .run-trace-intro {
    flex-direction: column;
  }

  .run-event-meta time {
    margin-left: 0;
  }

  .browser-companion-panel,
  .native-agent-panel {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 290 !important;
    border-left: none !important;
    box-shadow: none !important;
  }

  .workspace.has-side-panel .chat-view {
    margin-right: 0 !important;
  }

  .kraken-sidebar .sidebar-top {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .kraken-sidebar .sidebar-brand {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .kraken-sidebar .sidebar-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: auto !important;
  }
}

/* ==========================================================================
   ESTILIZAÇÃO DE NOTIFICAÇÕES NÃO LIDAS & PAINEL DE CONFIGURAÇÕES MODERNO
   ========================================================================== */
.sidebar-mobile-tool-btn.has-unread {
  border-color: rgba(255, 193, 7, 0.45) !important;
  background: rgba(255, 193, 7, 0.08) !important;
}

.sidebar-mobile-tool-btn.has-unread svg {
  color: #ffc107 !important;
  filter: drop-shadow(0 0 6px rgba(255, 193, 7, 0.6));
  animation: krakenUnreadPulse 1.8s infinite ease-in-out;
}

@keyframes krakenUnreadPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.18); opacity: 1; filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.9)); }
}

.profile-locale-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.profile-locale-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 12px;
  color: #ded1d8;
}

.profile-locale-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.profile-locale-item.is-selected {
  background: rgba(255, 39, 78, 0.12);
  border-color: rgba(255, 39, 78, 0.45);
  color: #ffffff;
}

.setting-card {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 10px;
}

.setting-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.setting-card-header h2 {
  font-size: 13px;
  font-weight: 600;
  color: #eedde7;
  margin-bottom: 3px;
}

.setting-card-header p {
  font-size: 11.5px;
  color: #9d8995;
  line-height: 1.4;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 0;
}

.badge-success {
  background: rgba(46, 213, 115, 0.14);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.35);
  box-shadow: 0 0 10px rgba(46, 213, 115, 0.2);
}

.upgrade-btn-highlight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: #ff9f1a;
  color: #0b0709;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  border-radius: 0;
  box-shadow: 0 0 14px rgba(255, 159, 26, 0.45);
  transition: all 0.2s ease;
}

.upgrade-btn-highlight:hover {
  background: #ffa834;
  box-shadow: 0 0 20px rgba(255, 159, 26, 0.7);
  transform: translateY(-1px);
}

.lgpd-danger-card {
  border-color: rgba(255, 39, 78, 0.25);
  background: rgba(255, 39, 78, 0.03);
}

.text-danger {
  color: #ff476d !important;
}

.danger-button {
  padding: 7px 14px;
  background: transparent;
  color: #ff476d;
  border: 1px solid rgba(255, 39, 78, 0.4);
  border-radius: 0;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.danger-button:hover {
  background: rgba(255, 39, 78, 0.16);
  border-color: #ff476d;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 39, 78, 0.3);
}

.profile-footer-actions {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   TELA DE BOAS-VINDAS / GREETING SCREEN (PRIMEIRO ACESSO E RETORNO)
   ========================================================================== */
.welcome-greeting-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(255, 39, 78, 0.08) 0%, rgba(11, 7, 9, 0.98) 75%, #080507 100%);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  padding: 24px;
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
}

.welcome-greeting-screen.hidden {
  display: none !important;
}

.welcome-greeting-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.welcome-greeting-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 520px;
  width: 100%;
  padding: 48px 36px 40px;
  background: rgba(20, 13, 18, 0.88);
  border: 1px solid rgba(255, 39, 78, 0.28);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8), 0 0 32px rgba(255, 39, 78, 0.12);
  border-radius: 0;
  animation: krakenGreetingCardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes krakenGreetingCardIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.welcome-greeting-logo {
  position: relative;
  width: 140px;
  height: 105px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
  pointer-events: none;
  filter: drop-shadow(0 0 16px rgba(255, 39, 78, 0.85)) drop-shadow(0 0 35px rgba(255, 39, 78, 0.45));
  animation: krakenLogoPulse 3.2s ease-in-out infinite alternate;
}

.welcome-greeting-canvas {
  position: absolute;
  inset: -25px;
  width: calc(100% + 50px);
  height: calc(100% + 50px);
  pointer-events: none;
  z-index: 1;
}

.welcome-greeting-logo img {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  mix-blend-mode: screen;
  display: block;
}

@keyframes krakenLogoPulse {
  0% {
    transform: scale(0.97);
    filter: drop-shadow(0 0 12px rgba(255, 39, 78, 0.75)) drop-shadow(0 0 24px rgba(255, 39, 78, 0.35));
  }
  100% {
    transform: scale(1.03);
    filter: drop-shadow(0 0 24px rgba(255, 39, 78, 1)) drop-shadow(0 0 45px rgba(255, 60, 100, 0.65));
  }
}

.welcome-greeting-headline {
  margin: 0 0 10px;
  font-family: var(--font);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff 30%, #ff8ca3 70%, #ff274e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: krakenFadeReveal 4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes krakenFadeReveal {
  0% {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(14px) scale(0.97);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

.welcome-greeting-username {
  margin: 0 0 26px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  color: #ccaec0;
  letter-spacing: 0.2px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.welcome-greeting-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  margin-left: 3px;
  background: #ff274e;
  box-shadow: 0 0 8px #ff274e;
  vertical-align: middle;
  animation: krakenBlinkCursor 0.8s infinite;
}

@keyframes krakenBlinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.welcome-greeting-progress-bar {
  width: 100%;
  max-width: 280px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
}

.welcome-greeting-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff274e 0%, #ff9f1a 50%, #2ed573 100%);
  background-size: 280px 100%;
  box-shadow: 0 0 12px rgba(255, 39, 78, 0.7);
  transition: width 0.06s linear;
}

.welcome-greeting-percentage {
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  color: #f0e6ec;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.welcome-greeting-status-msg {
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 450;
  color: #a48b9b;
  letter-spacing: 0.3px;
  margin-bottom: 22px;
  min-height: 18px;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.welcome-greeting-status-msg.completed {
  color: #2ed573;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(46, 213, 115, 0.4);
}

.welcome-greeting-redirect-hint {
  display: none;
}

.welcome-greeting-skip-btn {
  padding: 8px 24px;
  background: transparent;
  border: 1px solid rgba(255, 39, 78, 0.35);
  color: #f5d4df;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.2s ease;
}

.welcome-greeting-skip-btn:hover {
  background: rgba(255, 39, 78, 0.16);
  border-color: #ff274e;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 39, 78, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  .kraken-sidebar,
  .sidebar-backdrop {
    transition-duration: .01ms !important;
  }

  .run-activity *,
  .run-trace-modal * {
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
