:root {
  --bg: #0b0d10; --bg-2: #12151a; --panel: #161a20; --panel-2: #1c2129;
  --border: #262c36; --text: #e8eaed; --muted: #8b93a1;
  --accent: #e76719; --accent-2: #ff8a3d; --user-bubble: #24304d;
  --ok: #35c08a; --danger: #ff6b6b; --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
.screen { height: 100dvh; }
.hidden { display: none !important; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; object-fit: contain; padding: 5px;
  background: #12151a; box-shadow: 0 6px 20px rgba(231,103,25,.30); }
.brand-mark.small { width: 30px; height: 30px; border-radius: 9px; padding: 4px; box-shadow: none; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }

/* LOGIN */
.login-screen { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(231,103,25,.14), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: 22px; padding: 30px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.login-card .brand { justify-content: center; }
.login-sub { text-align: center; color: var(--muted); margin: 10px 0 26px; font-size: 14px; }
#login-form { display: flex; flex-direction: column; }
#login-form label { font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
#login-form input { background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 12px; padding: 14px; font-size: 16px; outline: none; transition: border-color .15s; }
#login-form input:focus { border-color: var(--accent); }
#login-btn { margin-top: 22px; padding: 15px; border: none; border-radius: 12px; cursor: pointer; font-size: 16px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); transition: transform .06s, opacity .15s; }
#login-btn:active { transform: scale(.98); }
#login-btn:disabled { opacity: .6; }
.error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 16px; text-align: center; }

/* APP LAYOUT */
.app-screen { position: relative; overflow: hidden; }
.chat-col { display: flex; flex-direction: column; height: 100dvh; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 18; opacity: 0; transition: opacity .2s; }
.scrim.show { opacity: 1; }

/* DRAWER */
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 82%; max-width: 320px; z-index: 20;
  background: var(--bg-2); border-right: 1px solid var(--border); transform: translateX(-102%); transition: transform .24s ease;
  display: flex; flex-direction: column; padding: calc(14px + var(--safe-top)) 12px calc(12px + var(--safe-bottom)); }
.drawer.open { transform: translateX(0); box-shadow: 12px 0 40px rgba(0,0,0,.5); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 14px; }
.new-chat { width: 100%; padding: 13px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer; }
.new-chat:active { background: var(--panel-2); }
.proj-filter { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 0 10px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-2); }
.proj-filter .pf-icon { font-size: 14px; }
.proj-filter select { flex: 1; padding: 11px 4px; background: transparent; border: none; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; outline: none; -webkit-appearance: none; appearance: none; }
.proj-filter select option { background: var(--panel); color: var(--text); }
.chat-list { flex: 1; overflow-y: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.chat-item { padding: 12px 12px; border-radius: 11px; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--text); }
.chat-item:active, .chat-item.active { background: var(--panel); }
.chat-item .title { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .del { color: var(--muted); font-size: 16px; opacity: .6; padding: 2px 4px; }
.chat-empty { padding: 18px 12px; font-size: 13px; color: var(--muted); text-align: center; }

/* Busca global nos chats */
.chat-search { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 0 10px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-2); }
.chat-search .cs-icon { font-size: 13px; opacity: .8; }
.chat-search input { flex: 1; min-width: 0; padding: 11px 2px; background: transparent; border: none; color: var(--text); font-size: 14px; outline: none; -webkit-appearance: none; appearance: none; }
.chat-search input::-webkit-search-cancel-button { display: none; }
.chat-search .cs-clear { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 4px 6px; }
.search-results .sr-item { padding: 11px 12px; border-radius: 11px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.search-results .sr-item:active { background: var(--panel); }
.search-results .sr-top { display: flex; align-items: center; gap: 8px; }
.search-results .sr-title { flex: 1; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .sr-count { font-size: 11px; color: var(--muted); background: var(--panel-2); border-radius: 6px; padding: 2px 6px; flex-shrink: 0; }
.search-results .sr-snippet { font-size: 12px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results .sr-snippet mark { background: rgba(231,103,25,.28); color: var(--text); border-radius: 3px; padding: 0 1px; }
.search-results .sr-proj { font-size: 11px; color: var(--muted); }

/* Destaque da mensagem que casou com a busca ao abrir o chat */
.msg.msg-flash { animation: msgFlash 2.4s ease; }
@keyframes msgFlash {
  0%, 30% { background: rgba(231,103,25,.22); box-shadow: 0 0 0 2px rgba(231,103,25,.5); border-radius: 12px; }
  100% { background: transparent; box-shadow: none; }
}
.drawer-logout { margin-top: 10px; padding: 12px; border-radius: 11px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }

/* medidor de uso do Claude */
.usage-box { margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.usage-box .u-title { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.usage-box .u-title .u-refresh { cursor: pointer; opacity: .6; }
.usage-row { margin-bottom: 10px; }
.usage-row:last-child { margin-bottom: 0; }
.usage-row .u-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.usage-row .u-label .u-pct { color: var(--text); font-weight: 700; }
.usage-bar { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.usage-bar > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--ok), var(--accent)); }
.usage-bar > i.warn { background: linear-gradient(90deg, #e0a63a, var(--danger)); }
.usage-row .u-reset { font-size: 10px; color: var(--muted); margin-top: 3px; }
.usage-box { cursor: pointer; }
.usage-box .u-conn { font-size: 11px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.usage-box .u-conn.off { color: var(--danger); }
.usage-box .u-conn.on { color: var(--ok); }
#claude-conn-body .conn-state { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
#claude-conn-body .conn-state.off { color: var(--danger); }
#claude-conn-body .conn-state.on { color: var(--ok); }
#claude-conn-body .conn-sub { font-size: 13px; color: var(--muted); margin: 0 0 16px; line-height: 1.5; }
.conn-btn { width: 100%; padding: 14px; border: none; border-radius: 12px; font-size: 15px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); cursor: pointer; }
.conn-btn-sec { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 12px; font-size: 14px; color: var(--muted); background: transparent; cursor: pointer; margin-top: 10px; }
.conn-link { display: block; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--accent); color: var(--accent); text-align: center; font-weight: 700; text-decoration: none; margin: 12px 0 10px; }
.conn-code-row { display: flex; gap: 8px; margin-top: 8px; }
.conn-code-row input { flex: 1; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 11px; padding: 12px; font-size: 15px; outline: none; }
.conn-code-row button { padding: 0 18px; border: none; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; cursor: pointer; }
#conn-result, #conn-flow { font-size: 13px; margin-top: 12px; line-height: 1.5; }
.conn-usage { margin: 8px 0 16px; }

/* TOPBAR */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + var(--safe-top)) 12px 10px;
  background: rgba(11,13,16,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.agent-picker { display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--border); padding: 4px; border-radius: 12px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.agent-picker::-webkit-scrollbar { display: none; }
.agent-btn[data-agent="auto"].active { color: #7ee0b8; }
.agent-btn[data-agent="jarvis"].active { color: #e76719; }
.agent-btn { border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.agent-btn.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.agent-picker.locked .agent-btn:not(.active) { opacity: .35; pointer-events: none; }
.agent-picker.locked .agent-btn.active { cursor: default; }
.agent-btn .dot { font-size: 10px; color: var(--accent-2); font-weight: 700; }
.icon-btn { background: var(--panel); border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 11px; font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.icon-btn.round { border-radius: 50%; width: 44px; height: 44px; flex-shrink: 0; }

/* MESSAGES */
.messages { flex: 1; overflow-y: auto; padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 14px; -webkit-overflow-scrolling: touch; }
.empty-state { margin: auto; text-align: center; max-width: 320px; padding: 20px; position: relative; }
.empty-glow { position: absolute; inset: -40px 0 auto; height: 160px; background: radial-gradient(circle at 50% 0, rgba(231,103,25,.22), transparent 70%); filter: blur(10px); z-index: -1; }
.empty-state h2 { font-size: 24px; margin: 0 0 10px; letter-spacing: -.4px; }
.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: var(--radius); font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--user-bubble); border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg.assistant.monark { border-color: rgba(231,103,25,.4); }
.msg .meta { display: block; font-size: 11px; color: var(--muted); }
.msg .msg-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.msg .msg-foot .meta { margin-top: 0; }
.reply-copy { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; background: var(--bg-2); border: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; cursor: pointer; line-height: 1; -webkit-tap-highlight-color: transparent; transition: color .15s, border-color .15s; }
.reply-copy svg { flex: none; }
.reply-copy:active { background: var(--panel-2); }
.reply-copy.copied { color: var(--accent); border-color: var(--accent); }
.msg img.att-img { max-width: 100%; border-radius: 10px; margin-bottom: 8px; display: block; }
.msg .att-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; margin-bottom: 8px; color: var(--muted); }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2){ animation-delay: .2s } .typing i:nth-child(3){ animation-delay: .4s }
@keyframes blink { 0%,60%,100%{opacity:.3} 30%{opacity:1} }

/* ATTACH TRAY */
.att-tray { display: flex; gap: 8px; padding: 8px 12px; overflow-x: auto; background: rgba(11,13,16,.9); border-top: 1px solid var(--border); }
.att-pill { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.att-pill img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.att-pill .x { color: var(--muted); cursor: pointer; font-weight: 700; padding: 0 2px; }
.att-pill.rec { color: var(--danger); }

/* COMPOSER */
.composer { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 12px calc(10px + var(--safe-bottom)); background: rgba(11,13,16,.9); backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
.composer-tools { display: flex; gap: 8px; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer-tools .icon-btn.round { width: 40px; height: 40px; }
.composer textarea { flex: 1; resize: none; max-height: 140px; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 14px; padding: 13px 14px; font-size: 16px; outline: none; font-family: inherit; line-height: 1.4; }
.composer textarea:focus { border-color: var(--accent); }
#mic-btn.recording { background: var(--danger); color: #fff; border-color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(255,107,107,.5) } 50%{ box-shadow: 0 0 0 8px rgba(255,107,107,0) } }
#send { width: 46px; height: 46px; flex-shrink: 0; border: none; border-radius: 13px; color: #fff; font-size: 18px; cursor: pointer; background: linear-gradient(135deg, var(--accent), var(--accent-2)); transition: transform .06s, opacity .15s; }
#send:active { transform: scale(.95); } #send:disabled { opacity: .5; cursor: not-allowed; }
#send.stop { background: var(--danger); }
.composer.editing textarea { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(231,103,25,.25); }

/* chat item: custo */
.chat-item .ci-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow: hidden; }
.chat-item .ci-titlerow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-item .ci-sub { display: flex; align-items: center; gap: 8px; }
.chat-item .ci-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.chat-item .cost { font-size: 11px; color: var(--muted); background: var(--panel-2); border-radius: 6px; padding: 2px 6px; flex-shrink: 0; }

/* botão editar na mensagem do usuário */
.msg.user { position: relative; }
.edit-btn { position: absolute; left: -32px; bottom: 4px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel); color: var(--muted); font-size: 13px; cursor: pointer; opacity: .7; }
.edit-btn:active { background: var(--panel-2); }

/* markdown */
.msg.assistant h3 { font-size: 17px; margin: 14px 0 8px; letter-spacing: -.2px; }
.msg.assistant h4 { font-size: 15px; margin: 12px 0 6px; color: #cfd4dc; }
.msg.assistant p { margin: 8px 0; }
.msg.assistant ul, .msg.assistant ol { margin: 8px 0; padding-left: 22px; }
.msg.assistant li { margin: 4px 0; }
.msg.assistant a { color: var(--accent); }
.msg.assistant strong { color: #fff; font-weight: 700; }
.msg.assistant code.inline { background: var(--bg-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.code-block { margin: 10px 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #0d1117; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: #11161d; border-bottom: 1px solid var(--border); }
.code-head .lang { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.copy-btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: 12px; padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.copy-btn:active { background: var(--accent); }
.code-block pre { margin: 0; padding: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.code-block code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; color: #e6edf3; white-space: pre; }
.table-wrap { margin: 10px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 10px; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 13px; }
.table-wrap th, .table-wrap td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap th { background: var(--bg-2); color: #fff; font-weight: 700; white-space: nowrap; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tbody tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.msg.generating { color: var(--text); }
.route-hint { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }

/* drawer nav + tasks */
.drawer-nav { width: 100%; margin-top: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; }
.drawer-nav:active { background: var(--panel); }
.tasks-box { margin-top: 10px; border: 1px solid rgba(231,103,25,.35); border-radius: 12px; padding: 10px; background: rgba(231,103,25,.06); }
.tasks-box .t-head { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.task-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 9px; cursor: pointer; animation: taskIn .22s ease both; }
.task-item:active { background: var(--panel); }
.task-item .t-cancel { flex-shrink: 0; width: 26px; height: 26px; border: none; border-radius: 8px; background: transparent; color: var(--danger); font-size: 13px; cursor: pointer; opacity: .75; transition: background .15s, opacity .15s; }
.task-item .t-cancel:hover { background: rgba(255,107,107,.14); opacity: 1; }
.task-item .t-cancel:disabled { opacity: .35; cursor: not-allowed; }
@keyframes taskIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.task-item .spin { width: 12px; height: 12px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.task-item .t-info { flex: 1; min-width: 0; }
.task-item .t-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-item .t-meta { font-size: 11px; color: var(--muted); }
.menu-badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
#menu-btn { position: relative; }

/* monitor */
.monitor { display: flex; flex-direction: column; height: 100dvh; z-index: 25; position: fixed; inset: 0; background: var(--bg); }
.mon-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
/* Dashboard */
.dash-hero { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; padding: 18px; border-radius: 16px; border: none; cursor: pointer; color: #fff; background: linear-gradient(135deg, #e76719, #ff9d4d); box-shadow: 0 8px 24px rgba(231,103,25,.28); }
.dash-hero:active { filter: brightness(.95); }
.dash-hero-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.18); font-size: 26px; font-weight: 300; flex: none; }
.dash-hero-txt { display: flex; flex-direction: column; gap: 2px; }
.dash-hero-txt b { font-size: 17px; }
.dash-hero-txt small { font-size: 12px; opacity: .85; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dash-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; }
.dash-card:active { background: var(--panel-2); }
.dash-card .dash-ico { font-size: 24px; margin-bottom: 4px; }
.dash-card b { font-size: 14px; }
.dash-card small { font-size: 11px; color: var(--muted); }
.vps-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.vps-card .vc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.vps-card .vc-name { font-weight: 700; font-size: 16px; }
.vps-card .vc-host { font-size: 12px; color: var(--muted); }
.vc-badge { font-size: 10px; padding: 3px 8px; border-radius: 6px; background: var(--panel-2); color: var(--muted); }
.vc-badge.brain { background: rgba(231,103,25,.15); color: var(--accent); }
.metric { margin-bottom: 12px; }
.metric .m-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; color: var(--muted); }
.metric .m-label b { color: var(--text); }
.metric .bar { height: 8px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.metric .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), var(--accent)); }
.metric .bar > i.warn { background: linear-gradient(90deg, #e0a63a, var(--danger)); }
.svc-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 14px 0 8px; }
.svc-row { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; background: var(--bg-2); }
.svc-row .s-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.svc-row .s-dot.off { background: var(--muted); }
.svc-row .s-name { flex: 1; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-row .s-meta { font-size: 11px; color: var(--muted); }
.svc-row .s-logs { font-size: 11px; background: var(--panel); border: 1px solid var(--border); color: var(--text); padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.vc-loading { color: var(--muted); font-size: 13px; }

/* Domínios (Cloudflare) */
.dom-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; background: var(--panel); color: var(--text); cursor: pointer; text-align: left; }
.dom-row:active { background: var(--panel-2); }
.dom-row .s-info { flex: 1; min-width: 0; }
.dom-row .s-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dom-row .s-meta { font-size: 11px; color: var(--muted); }
.dom-caret { color: var(--muted); font-size: 20px; flex-shrink: 0; }
.dns-list { overflow-y: auto; max-height: 68dvh; display: flex; flex-direction: column; gap: 6px; }
.dns-row { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); }
.dns-type { font-size: 11px; font-weight: 700; color: var(--accent); background: rgba(231,103,25,.12); padding: 3px 7px; border-radius: 6px; min-width: 44px; text-align: center; flex-shrink: 0; }
.dns-info { flex: 1; min-width: 0; }
.dns-name { font-size: 13px; font-weight: 600; word-break: break-all; }
.dns-content { font-size: 11px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.dns-proxied { flex-shrink: 0; font-size: 14px; }
.logs-content { background: #0d1117; border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; line-height: 1.5; color: #e6edf3; white-space: pre-wrap; word-break: break-all; overflow-y: auto; max-height: 60dvh; margin: 0; }

/* agente Claudio desabilitado */
.agent-btn:disabled { opacity: .4; }
.agent-btn[data-agent="claudio"].active { color: #ffd591; }

/* barra de projeto */
.subbar { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.subbar .project-bar { flex: 1; border-bottom: none; min-width: 0; }
.project-bar { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 14px; background: var(--bg-2); border: none; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 13px; cursor: pointer; text-align: left; }
.project-bar .pb-icon { font-size: 14px; }
.project-bar #project-name { flex: 1; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-bar .pb-caret { color: var(--muted); }
/* Seletor de modelo de IA (sub-barra) */
.model-pill { display: flex; align-items: center; gap: 6px; padding: 0 12px 0 12px; background: var(--bg-2); border-left: 1px solid var(--border); flex-shrink: 0; max-width: 46%; }
.model-pill .mp-icon { font-size: 14px; }
.model-pill select { max-width: 128px; padding: 8px 2px; background: transparent; border: none; color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer; outline: none; -webkit-appearance: none; appearance: none; text-overflow: ellipsis; }
.model-pill select option { background: var(--panel); color: var(--text); font-weight: 600; }

/* Permissões (admin) */
.ac-user { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); overflow: hidden; }
.ac-user + .ac-user { margin-top: 12px; }
.ac-user-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--bg-2); border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.ac-user-head .ac-count { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); }
.ac-proj { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.ac-proj + .ac-proj { border-top: 1px solid var(--border); }
.ac-proj .ac-info { flex: 1; min-width: 0; }
.ac-proj .ac-name { font-size: 14px; font-weight: 600; }
.ac-proj .ac-slug { font-size: 11px; color: var(--muted); }
.ac-switch { width: 42px; height: 24px; border-radius: 13px; background: var(--border); position: relative; flex-shrink: 0; transition: background .15s; }
.ac-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.ac-proj.on .ac-switch { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.ac-proj.on .ac-switch::after { transform: translateX(18px); }
.ac-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }
/* etiqueta de dono do chat (visão admin) */
.ci-owner { font-size: 10px; font-weight: 700; color: var(--accent); background: rgba(231,103,25,.12); padding: 1px 6px; border-radius: 6px; margin-left: 6px; }

/* Fluxograma da estrutura do projeto */
.proj-tree { background: var(--bg-2); border-bottom: 1px solid var(--border); max-height: 40vh; overflow: auto; padding: 0 12px 10px; font-size: 13px; }
.proj-tree.collapsed { max-height: none; overflow: visible; padding-bottom: 8px; }
.proj-tree.collapsed > .pt-tree, .proj-tree.collapsed > .pt-empty { display: none; }
.pt-head { position: sticky; top: 0; z-index: 2; background: var(--bg-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 2px 7px; margin-bottom: 2px; cursor: pointer; user-select: none; border-bottom: 1px solid var(--border); }
.pt-head .pt-title { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-head .pt-toggle { color: var(--muted); font-size: 12px; flex: none; }
.pt-head .pt-load { color: var(--muted); font-size: 11px; flex: none; }
.pt-empty { color: var(--muted); font-size: 12px; padding: 6px 0 4px; }
.pt-tree { list-style: none; margin: 0; padding: 0; }
.pt-tree .pt-tree { margin-left: 9px; padding-left: 10px; border-left: 1px solid var(--border); }
.pt-tree .pt-tree.collapsed { display: none; }
.pt-tree li { position: relative; }
.pt-node { display: flex; align-items: center; gap: 6px; padding: 4px 7px; margin: 1px 0; border-radius: 8px; line-height: 1.35; cursor: default; }
.pt-node.has-kids { cursor: pointer; }
.pt-node.has-kids:hover, .pt-node.has-kids:active { background: var(--panel); }
.pt-caret { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 12px; font-size: 9px; color: var(--muted); transition: transform .14s ease; }
.pt-caret.empty { visibility: hidden; }
.pt-node.open > .pt-caret { transform: rotate(90deg); }
.pt-node .pt-ic { flex: none; font-size: 12px; }
.pt-node.dir .pt-nm { color: var(--text); font-weight: 600; }
.pt-node.file .pt-nm { color: var(--muted); }
.pt-node.skipped { opacity: .55; }
.pt-node.skipped .pt-nm { font-weight: 500; }
.pt-node .pt-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pt-node .pt-ext { flex: none; margin-left: auto; padding: 1px 6px; border-radius: 6px; background: var(--panel); border: 1px solid var(--border); color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .3px; font-weight: 600; }
.pt-node.file:hover .pt-ext { color: var(--text); }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; background: var(--panel); border-top-left-radius: 22px; border-top-right-radius: 22px; border-top: 1px solid var(--border); padding: 12px 18px calc(20px + var(--safe-bottom)); max-height: 80dvh; overflow-y: auto; animation: slideup .22s ease; }
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 4px auto 14px; }
.sheet-card h3 { margin: 0 0 6px; font-size: 18px; }
.sheet-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; line-height: 1.5; }
.proj-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.proj-opt { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); cursor: pointer; }
.proj-opt.active { border-color: var(--accent); }
.proj-opt .p-name { flex: 1; font-weight: 600; }
.proj-opt .p-path { font-size: 11px; color: var(--muted); }
.proj-new { display: flex; gap: 8px; margin-bottom: 10px; }
.proj-new input { flex: 1; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 11px; padding: 12px; font-size: 15px; outline: none; }
.proj-new button { padding: 0 18px; border: none; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; cursor: pointer; }
.proj-none { width: 100%; padding: 12px; border: 1px dashed var(--border); border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }

/* GitHub */
.gh-row { display: flex; align-items: center; gap: 10px; padding: 13px 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; background: var(--panel); }
.gh-row .s-info { flex: 1; min-width: 0; }
.gh-row .s-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gh-row .gh-desc { font-size: 12px; color: var(--text); opacity: .8; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gh-row .s-meta { font-size: 11px; color: var(--muted); }
.gh-badge { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--ok); }
.gh-import { flex-shrink: 0; padding: 9px 14px; border: none; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; }
.gh-import:disabled { opacity: .6; cursor: default; }
.gh-empty { text-align: center; padding: 40px 18px; color: var(--muted); }
.gh-empty-emoji { font-size: 44px; }
.gh-empty h3 { color: var(--text); margin: 12px 0 8px; }
.gh-empty p { font-size: 13px; line-height: 1.6; }
.gh-empty code { background: var(--bg-2); padding: 2px 6px; border-radius: 6px; color: var(--text); }
.gh-empty a { color: var(--accent-2); }

/* ---------- Navegador ao vivo (preview do agent-browser) ---------- */
.browser-live{
  position:fixed; right:14px; bottom:96px; z-index:15;
  width:min(92vw,380px);
  background:rgba(16,19,24,.96); border:1px solid #2a2f38; border-radius:14px;
  box-shadow:0 12px 40px rgba(0,0,0,.55); overflow:hidden; backdrop-filter:blur(8px);
  animation:blIn .25s ease;
}
@keyframes blIn{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.browser-live.hidden{display:none}
.bl-head{display:flex;align-items:center;gap:8px;padding:9px 11px;cursor:pointer;user-select:none;border-bottom:1px solid #22262e}
.bl-dot{width:9px;height:9px;border-radius:50%;background:#ff4d4d;box-shadow:0 0 0 0 rgba(255,77,77,.6);animation:blPulse 1.4s infinite;flex:0 0 auto}
@keyframes blPulse{0%{box-shadow:0 0 0 0 rgba(255,77,77,.55)}70%{box-shadow:0 0 0 8px rgba(255,77,77,0)}100%{box-shadow:0 0 0 0 rgba(255,77,77,0)}}
.bl-title{font-size:13px;font-weight:700;color:#e8eaed;flex:0 0 auto}
.bl-url{font-size:11px;color:var(--muted,#9aa0aa);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}
.bl-btn{background:none;border:none;color:#cfd3da;font-size:16px;cursor:pointer;padding:2px 4px;line-height:1;flex:0 0 auto}
.bl-close{font-size:14px;color:#9aa0aa;border-radius:6px}
.bl-close:hover,.bl-close:active{color:#fff;background:rgba(255,77,77,.85)}
.bl-body{background:#000;line-height:0;max-height:60vh;overflow:hidden}
.bl-body img{width:100%;display:block;object-fit:contain}
.browser-live.collapsed .bl-body{display:none}
.browser-live.collapsed .bl-toggle{transform:rotate(180deg)}

/* ---------- Check-up das VPS ---------- */
.hc-running { display:flex; align-items:center; gap:10px; background:var(--panel); border:1px solid var(--border); border-radius:14px; padding:14px 16px; font-size:14px; color:var(--text); }
.hc-spin { width:16px; height:16px; border-radius:50%; border:2px solid var(--border); border-top-color:var(--accent); animation:hc-rot .8s linear infinite; flex-shrink:0; }
@keyframes hc-rot { to { transform:rotate(360deg); } }
.hc-empty { text-align:center; color:var(--muted); padding:40px 16px; }
.hc-empty-emoji { font-size:44px; }
.hc-empty h3 { margin:10px 0 6px; color:var(--text); }
.hc-card { cursor:pointer; }
.hc-card:active { background:var(--panel-2); }
.hc-row { display:flex; align-items:center; gap:10px; }
.hc-pill { font-size:12px; font-weight:700; padding:4px 10px; border-radius:8px; white-space:nowrap; }
.hc-pill.big { font-size:14px; padding:6px 12px; }
.hc-when { font-size:12px; color:var(--muted); }
.hc-row .dom-caret { margin-left:auto; color:var(--muted); }
.hc-summary { margin-top:10px; font-size:14px; color:var(--text); line-height:1.45; }
.hc-detail-top { display:flex; align-items:center; gap:12px; margin-bottom:4px; }
.hc-resumo { font-size:15px; line-height:1.5; color:var(--text); margin:12px 0 4px; }
.hc-action { background:var(--panel); border:1px solid var(--border); border-left:3px solid var(--accent); border-radius:12px; padding:12px 14px; margin-bottom:10px; }
.hc-action-h { display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.hc-sev { font-size:12px; }
.hc-action-t { font-weight:700; font-size:14px; }
.hc-action-d { font-size:13px; color:var(--muted); line-height:1.45; margin-top:3px; }
.hc-vps .hc-row { margin-bottom:6px; }
.hc-list { list-style:none; padding:0; margin:4px 0 0; }
.hc-list li { font-size:13px; line-height:1.5; color:var(--text); padding:2px 0; }
.hc-list li.hc-fix { color:var(--ok); }
.hc-fix-foot { margin-top:10px; display:flex; flex-direction:column; gap:8px; align-items:flex-start; }
.hc-resolve-btn { background:var(--accent); color:#fff; border:none; border-radius:10px; padding:8px 16px; font-size:13px; font-weight:700; cursor:pointer; }
.hc-resolve-btn:disabled { opacity:.6; cursor:default; }
.hc-fix-status { font-size:13px; line-height:1.5; border-radius:10px; padding:8px 10px; width:100%; box-sizing:border-box; }
.hc-fix-status.running { display:flex; align-items:center; gap:8px; background:var(--panel); border:1px solid var(--border); color:var(--text); }
.hc-fix-status.done { background:color-mix(in srgb, var(--ok) 12%, transparent); color:var(--ok); }
.hc-fix-status.error { background:color-mix(in srgb, #e5484d 12%, transparent); color:#e5484d; }

/* ---------- Aba Plano + botão de notificações ---------- */
.agent-btn[data-agent="plano"].active { color: #ffcf6d; }
#push-btn.on { border-color: var(--ok); color: var(--ok); }

/* ---------- Modo Plano: cards de operação ---------- */
.op-card { margin: 8px 0 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); overflow: hidden; }
.op-card.run   { border-color: #7a4a2a; box-shadow: 0 0 0 1px #7a4a2a55, 0 6px 22px -14px var(--accent); }
.op-card.done  { border-color: #2a6a52; }
.op-card.error { border-color: #7a3b3b; }
.op-card.wait  { border-color: #7a6a2a; }
.op-card.cancel{ opacity: .85; }

.op-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.op-badge { font-size: 20px; }
.op-h-main { flex: 1; min-width: 0; }
.op-title { font-weight: 700; font-size: 15px; color: var(--text); }
.op-status { margin-top: 2px; }
.op-pill { font-size: 12px; font-weight: 600; color: var(--muted); }
.op-card.run .op-pill { color: #ffb787; }
.op-card.done .op-pill { color: var(--ok); }
.op-card.error .op-pill { color: var(--danger); }
.op-card.wait .op-pill { color: #e0b64a; }

.op-summary { padding: 0 14px 8px; color: var(--muted); font-size: 13px; line-height: 1.4; }

.op-bar { height: 6px; background: var(--panel-2); margin: 4px 14px 10px; border-radius: 6px; overflow: hidden; }
.op-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 6px; transition: width .4s ease; }

.op-steps { padding: 2px 12px 6px; display: flex; flex-direction: column; gap: 2px; }
.op-step { display: flex; gap: 9px; padding: 7px 8px; border-radius: 10px; align-items: flex-start; }
.op-step.running { background: #1b2233; }
.op-step.done .op-step-t { color: var(--muted); }
.op-step.done .op-step-t { text-decoration: none; }
.op-step-ic { font-size: 14px; line-height: 1.5; width: 18px; text-align: center; flex-shrink: 0; }
.op-step.running .op-step-ic { animation: opspin 1.4s linear infinite; }
.op-step-main { min-width: 0; }
.op-step-t { font-size: 13.5px; font-weight: 600; color: var(--text); }
.op-step-d { font-size: 12px; color: var(--muted); margin-top: 1px; line-height: 1.35; }

.op-questions { margin: 6px 14px 4px; padding: 10px; border: 1px solid #7a6a2a55; background: #221f11; border-radius: 12px; }
.op-q-title { font-size: 13px; font-weight: 700; color: #e0b64a; margin-bottom: 4px; }
.op-q { font-size: 13px; color: var(--text); margin: 2px 0; }
.op-answer { width: 100%; margin-top: 8px; background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; resize: vertical; box-sizing: border-box; }

.op-log { margin: 4px 12px 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.op-log > summary { cursor: pointer; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.op-log pre { margin: 0; padding: 0 10px 10px; max-height: 220px; overflow: auto; font-size: 11.5px;
  white-space: pre-wrap; word-break: break-word; color: #b9c1cf; }

.op-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px 14px; }
.op-btn { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit;
  font-size: 13px; font-weight: 600; padding: 9px 14px; border-radius: 10px; cursor: pointer; }
.op-btn.primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border: none; color: #fff; }
.op-btn.danger { background: transparent; border-color: #7a3b3b; color: var(--danger); }
.op-btn:disabled { opacity: .6; cursor: default; }
.op-done-tag { font-size: 13px; font-weight: 600; color: var(--ok); }
.op-spin { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: opspin .8s linear infinite; display: inline-block; }
@keyframes opspin { to { transform: rotate(360deg); } }

/* ---------- Gestor de Tarefas ---------- */
.td-add { display: flex; gap: 8px; padding: 12px 14px 6px; }
.td-add input[type=text] { flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 12px; padding: 12px 14px; font-size: 15px; outline: none; }
.td-add input[type=text]:focus { border-color: var(--accent); }
.td-add input[type=date] { background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 12px; padding: 11px 10px; font-size: 13px; outline: none; -webkit-appearance: none; }
.td-add input[type=date]:focus { border-color: var(--accent); }
.td-add select { background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 12px; padding: 11px 8px; font-size: 13px; outline: none; -webkit-appearance: none; }
.td-add select:focus { border-color: var(--accent); }
.td-add-btn, #td-add-btn { width: 46px; border: none; border-radius: 12px; cursor: pointer; font-size: 22px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.td-add-btn:disabled { opacity: .5; }

.td-tabs { display: flex; gap: 8px; padding: 6px 14px 10px; }
.td-tab { flex: 1; padding: 9px 6px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.td-tab.active { background: var(--panel); color: var(--text); border-color: var(--accent); }

.td-summary { font-size: 13px; color: var(--muted); margin: 2px 4px 12px; }
.td-summary b { color: var(--text); }
.td-summary .td-over { color: var(--danger); }

.td-group { display: flex; align-items: center; gap: 8px; margin: 18px 4px 9px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.td-group-n { background: var(--bg-2); border: 1px solid var(--border); border-radius: 20px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.td-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 13px; margin-bottom: 9px; }
.td-row.done { opacity: .55; }
.td-check { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--border); background: var(--bg-2); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.td-check.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.td-info { flex: 1; min-width: 0; cursor: pointer; }
.td-name { font-size: 15px; color: var(--text); word-break: break-word; }
.td-row.done .td-name { text-decoration: line-through; }
.td-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.td-meta span { font-size: 12px; padding: 2px 8px; border-radius: 20px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--border); }
.td-due.over { color: var(--danger); border-color: var(--danger); }
.td-due.soon { color: var(--accent); border-color: var(--accent); }
.td-prio.hi { color: #ffb454; border-color: #ffb454; }
.td-prio.ur { color: var(--danger); border-color: var(--danger); }

.td-lbl { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.td-inp { width: 100%; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 11px; padding: 12px; font-size: 15px; outline: none; -webkit-appearance: none; box-sizing: border-box; }
.td-inp:focus { border-color: var(--accent); }
textarea.td-inp { resize: vertical; font-family: inherit; }
.td-sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.td-save-btn { flex: 1; padding: 14px; border: none; border-radius: 12px; cursor: pointer; font-size: 15px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.td-del-btn { padding: 14px 16px; border: 1px solid var(--danger); border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--danger); background: transparent; }

/* Perfil / DNA de Produto */
.pf-hint { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.pf-text { width: 100%; min-height: 60vh; box-sizing: border-box; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--fg); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; resize: vertical; }
.pf-text:focus { border-color: var(--accent); outline: none; }
.pf-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.pf-reset { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); background: transparent; }
.pf-status { font-size: 12px; color: var(--muted); }

/* ============================================================
   Trilho de atividade (tarefas rodando + uso do Claude)
   Mobile: painel suspenso a partir do header (botão Atividade).
   Desktop: sidebar fixa à direita (ver media query abaixo).
   ============================================================ */
#rail-btn { position: relative; }
.right-rail {
  position: fixed; top: calc(60px + var(--safe-top)); left: 8px; right: 8px; z-index: 19;
  max-height: 72dvh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55); padding: 12px;
  display: flex; flex-direction: column; box-sizing: border-box;
  transform: translateY(-10px) scale(.98); transform-origin: top right;
  opacity: 0; pointer-events: none; transition: transform .2s ease, opacity .2s ease;
}
.right-rail.open { transform: none; opacity: 1; pointer-events: auto; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rail-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.rail-close { width: 34px; height: 34px; font-size: 16px; }
.right-rail .usage-box { margin-top: 10px; }

/* ============================================================
   Layout de PC: grid de 3 colunas (drawer | chat | trilho),
   ambas as laterais fixas e minimizáveis pelos toggles.
   ============================================================ */
@media (min-width: 900px) {
  #app.app-screen {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 320px;
    height: 100dvh; overflow: hidden;
    transition: grid-template-columns .24s ease;
  }
  #app.lz-collapsed { grid-template-columns: 0 minmax(0, 1fr) 320px; }
  #app.rz-collapsed { grid-template-columns: 300px minmax(0, 1fr) 0; }
  #app.lz-collapsed.rz-collapsed { grid-template-columns: 0 minmax(0, 1fr) 0; }
  /* ao minimizar, some por completo (sem sobra de ícones na borda) */
  #app.lz-collapsed > .drawer { opacity: 0; pointer-events: none; }
  #app.rz-collapsed > .right-rail { opacity: 0; pointer-events: none; }

  .scrim { display: none !important; }

  .drawer {
    position: relative; inset: auto; z-index: 1;
    transform: none !important; box-shadow: none !important;
    width: auto; max-width: none; min-width: 0; height: 100dvh;
    box-sizing: border-box; overflow: hidden;
    border-right: 1px solid var(--border);
    transition: opacity .18s ease;
  }

  .right-rail {
    position: relative; inset: auto; top: auto; left: auto; right: auto; z-index: 1;
    transform: none; opacity: 1; pointer-events: auto;
    transition: opacity .18s ease;
    height: 100dvh; max-height: none; min-width: 0;
    background: var(--bg-2); border: none; border-left: 1px solid var(--border);
    border-radius: 0; box-shadow: none;
    padding: calc(14px + var(--safe-top)) 14px calc(14px + var(--safe-bottom));
    overflow-x: hidden; overflow-y: auto;
  }

  .chat-col { min-width: 0; }

  /* leitura confortável: centraliza o conteúdo do chat */
  .messages { padding-left: max(14px, calc((100% - 900px) / 2)); padding-right: max(14px, calc((100% - 900px) / 2)); }
  .composer { padding-left: max(12px, calc((100% - 900px) / 2)); padding-right: max(12px, calc((100% - 900px) / 2)); }
}
