/* Koa Mind · Claude — roxo #592392 + laranja #F1A641, Sora (títulos) e Inter (texto) */
@font-face { font-family: "Sora"; src: url(/fonts/sora-latin-wght-normal.woff2) format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  /* escuro (padrão) */
  --bg: #110C17;
  --side: #0D0912;
  --card: #1A1322;
  --card2: #221A2D;
  --line: #2C2337;
  --text: #F2EEF7;
  --muted: #A99FB6;
  --accent: #F1A641;
  --accent-ink: #F1A641;
  --btn: #F1A641;
  --btn-ink: #1C1426;
  --btn-hover: #F6B85C;
  --brand: #592392;
  --brand-ink: #C9A7F0;
  --soft: rgba(201, 167, 240, .14);
  --user: #592392;
  --user-ink: #FFFFFF;
  --ok: #4FCB93;
  --bad: #F0786C;
  --warn: #E5B454;
  --code-bg: #271E33;
  --pre-bg: #0A070F;
  --pre-text: #E8E2F2;
  --glow: rgba(89, 35, 146, .55);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .35);
  --display: "Sora", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --col: 780px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #FBFAFD;
  --side: #F2EEF7;
  --card: #FFFFFF;
  --card2: #F6F2FA;
  --line: #E4DCEF;
  --text: #1C1426;
  --muted: #6B6178;
  --accent: #F1A641;
  --accent-ink: #9A5B00;
  --btn: #592392;
  --btn-ink: #FFFFFF;
  --btn-hover: #4A1D7A;
  --brand-ink: #592392;
  --soft: #EFE6F9;
  --ok: #1F8A5B;
  --bad: #C73A2E;
  --warn: #9A6A00;
  --code-bg: #F2EEF7;
  --pre-bg: #1C1426;
  --glow: rgba(89, 35, 146, .16);
  --shadow: 0 1px 2px rgba(60, 30, 90, .06), 0 10px 30px rgba(60, 30, 90, .09);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #FBFAFD; --side: #F2EEF7; --card: #FFFFFF; --card2: #F6F2FA; --line: #E4DCEF; --text: #1C1426; --muted: #6B6178;
    --accent-ink: #9A5B00; --btn: #592392; --btn-ink: #FFFFFF; --btn-hover: #4A1D7A; --brand-ink: #592392; --soft: #EFE6F9;
    --ok: #1F8A5B; --bad: #C73A2E; --warn: #9A6A00; --code-bg: #F2EEF7; --pre-bg: #1C1426; --glow: rgba(89, 35, 146, .16);
    --shadow: 0 1px 2px rgba(60, 30, 90, .06), 0 10px 30px rgba(60, 30, 90, .09);
    color-scheme: light;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--bad); min-height: 1.4em; margin: 6px 0 0; font-size: 14px; }
.screen { height: 100dvh; display: flex; flex-direction: column; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* logos por tema */
.only-dark { display: block; }
.only-light { display: none; }
:root[data-theme="light"] .only-dark { display: none; }
:root[data-theme="light"] .only-light { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .only-dark { display: none; }
  :root:not([data-theme]) .only-light { display: block; }
}

/* botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 16px; min-height: 44px; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--card2); border-color: color-mix(in srgb, var(--muted) 40%, var(--line)); }
.btn.primary { background: var(--btn); border-color: transparent; color: var(--btn-ink); }
.btn.primary:hover { background: var(--btn-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--card2); }
.btn.ghost-left { justify-content: flex-start; background: transparent; border-color: transparent; font-weight: 500; color: var(--text); }
.btn.ghost-left:hover { background: var(--card2); }
.btn.ghost-left svg { color: var(--brand-ink); flex: none; }
.btn.small { padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { width: 100%; background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 16px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.icon-btn { background: none; border: 0; color: var(--muted); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; cursor: pointer; flex: none; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--card2); color: var(--text); }
.icon-btn.sm { width: 40px; height: 40px; }
.logo { width: 56px; height: 56px; border-radius: 14px; display: block; }
.logo.xs { width: 34px; height: 34px; border-radius: 9px; }
.logo.lg { width: 68px; height: 68px; border-radius: 17px; }

/* login — o momento de marca */
#login { align-items: center; justify-content: center; padding: 20px; background: radial-gradient(70% 55% at 50% 0%, var(--glow), transparent 72%), var(--bg); }
.login-card { width: 100%; max-width: 400px; text-align: center; display: grid; gap: 14px; padding: 34px 28px 28px; background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.login-card .wordmark { width: min(230px, 70%); margin: 0 auto 6px; }
.login-card h1 { margin: 0; font: 600 22px/1.2 var(--display); letter-spacing: -.01em; }
.login-card p { margin: 0; }
.code-input { text-align: center; font-size: 28px; letter-spacing: .4em; padding-left: calc(14px + .4em); font-variant-numeric: tabular-nums; font-family: var(--display); }

/* estrutura */
#app { display: flex; flex-direction: row; position: relative; overflow: hidden; }
.stage { flex: 1; min-width: 0; height: 100dvh; display: flex; flex-direction: column; position: relative; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); background: var(--side); border-right: 1px solid var(--line); z-index: 21;
  transform: translateX(-102%); transition: transform .22s ease; display: flex; flex-direction: column; gap: 8px;
  padding: calc(var(--safe-t) + 14px) 12px calc(var(--safe-b) + 12px); }
.drawer.open { transform: none; }
.scrim { position: fixed; inset: 0; background: rgba(8, 4, 14, .6); z-index: 20; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand b { display: block; font: 600 17px/1.15 var(--display); letter-spacing: -.01em; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.side-label { color: var(--muted); font-size: 12.5px; font-weight: 600; margin: 8px 6px 0; }
.proj-row { display: flex; gap: 8px; }
.proj-row select { padding: 10px 12px; font-size: 15px; }
.side-actions { display: grid; gap: 2px; margin-top: 2px; }
#search { padding: 10px 14px; font-size: 15px; margin-top: 4px; }
.chat-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.chat-list li { display: flex; align-items: center; gap: 4px; border-radius: 10px; padding: 2px 2px 2px 10px; border: 1px solid transparent; }
.chat-list li:hover { background: var(--card2); }
.chat-list li.on { background: var(--soft); border-color: color-mix(in srgb, var(--brand-ink) 28%, transparent); }
.chat-list .t { flex: 1; min-width: 0; padding: 8px 0; cursor: pointer; }
.chat-list .t b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list .t span { font-size: 12px; color: var(--muted); }
.chat-list .live { color: var(--accent-ink) !important; }
.chat-list li .acts { display: flex; flex: none; opacity: 0; transition: opacity .15s; }
.chat-list li:hover .acts, .chat-list li:focus-within .acts, .chat-list li.on .acts { opacity: 1; }
@media (hover: none) { .chat-list li .acts { opacity: 1; } }
.chat-list .acts button { background: none; border: 0; color: var(--muted); width: 36px; height: 40px; font-size: 14px; cursor: pointer; border-radius: 8px; }
.chat-list .acts button:hover { color: var(--text); background: var(--card2); }
.chat-list .snip { display: block; font-size: 12px; color: var(--muted); white-space: normal; margin-top: 2px; }
.chat-list .proj-tag { color: var(--brand-ink); }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.drawer-foot .acct, #acct { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-foot .btn { min-height: 40px; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--btn); color: var(--btn-ink); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }

/* topo */
.top { display: flex; align-items: center; gap: 2px; padding: calc(var(--safe-t) + 6px) 10px 6px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); z-index: 5; min-height: 58px; border-bottom: 1px solid transparent; }
.head-title { flex: 1; min-width: 0; padding-left: 4px; }
.ttl { font: 600 16px/1.25 var(--display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usage { display: flex; flex-direction: column; gap: 3px; margin: 0 8px; flex: none; }
.meter { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; }
.meter b { font-weight: 600; width: 18px; }
.meter .bar { width: 44px; height: 4px; border: 0; }
.meter em { font-style: normal; width: 28px; text-align: right; }
.usage.warn .meter { color: var(--warn); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin: 0 12px 0 8px; flex: none; }
.dot.run { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.banner { background: color-mix(in srgb, var(--accent) 14%, var(--bg)); color: var(--accent-ink); padding: 10px 16px; font-size: 14px; border-bottom: 1px solid var(--line); }
.banner code { background: var(--code-bg); color: var(--text); padding: 1px 6px; border-radius: 6px; user-select: all; }

/* conversa */
.feed { flex: 1; overflow-y: auto; padding: 12px max(16px, calc(50% - var(--col) / 2)) 20px; display: flex; flex-direction: column; gap: 16px; -webkit-overflow-scrolling: touch; }
.empty { margin: auto; text-align: center; width: 100%; max-width: 640px; padding: 16px 4px; }
.hero-mark { width: 92px; height: 92px; margin: 0 auto 6px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); }
.empty h2 { margin: 14px 0 8px; font: 600 clamp(26px, 5vw, 36px)/1.12 var(--display); letter-spacing: -.025em; }
.empty p { margin: 0 auto; max-width: 440px; }
.starters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 26px; text-align: left; }
.starter { display: grid; gap: 4px; align-content: start; min-height: 88px; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); font: inherit; cursor: pointer; text-align: left; transition: border-color .15s, background .15s, transform .15s; }
.starter:hover { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); background: var(--card2); }
.starter:active { transform: scale(.99); }
.starter b { font: 600 14.5px/1.3 var(--display); letter-spacing: -.005em; }
.starter span { font-size: 13px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.qbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 999px; background: transparent; color: var(--muted);
  border: 1px solid var(--line); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .15s, color .15s; }
.qbtn:hover { color: var(--text); border-color: var(--muted); }
.qbtn svg { color: var(--brand-ink); }
.msg { max-width: 100%; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: min(88%, 640px); background: var(--user); color: var(--user-ink); padding: 10px 16px; border-radius: 20px 20px 6px 20px; white-space: pre-wrap; }
.msg.bot { align-self: stretch; padding: 2px; font-size: 16px; line-height: 1.7; }
.msg.bot > :first-child { margin-top: 0; } .msg.bot > :last-child { margin-bottom: 0; }
.msg p { margin: .65em 0; } .msg ul, .msg ol { margin: .65em 0; padding-left: 1.4em; } .msg li { margin: .25em 0; }
.msg h1, .msg h2, .msg h3, .msg h4 { margin: 1.1em 0 .4em; line-height: 1.25; font-family: var(--display); letter-spacing: -.01em; } .msg h1 { font-size: 1.28em; } .msg h2 { font-size: 1.16em; } .msg h3, .msg h4 { font-size: 1.05em; }
.msg a { color: var(--brand-ink); text-underline-offset: 2px; }
.msg code { background: var(--code-bg); border-radius: 6px; padding: 1px 6px; font: .86em var(--mono); }
.msg pre { position: relative; background: var(--pre-bg); color: var(--pre-text); border: 1px solid var(--line); border-radius: 14px; padding: 16px; overflow-x: auto; margin: .9em 0; }
.msg pre code { background: none; padding: 0; font-size: 13px; line-height: 1.6; white-space: pre; color: inherit; }
.copy { position: absolute; top: 8px; right: 8px; font: 12px var(--sans); padding: 4px 10px; min-height: 28px; border-radius: 8px; background: rgba(255, 255, 255, .08);
  color: #d6cfe3; border: 1px solid rgba(255, 255, 255, .16); cursor: pointer; }
.copy:hover { background: rgba(255, 255, 255, .18); }
.msg.user .files { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .75); margin-bottom: 4px; }

.tools { align-self: stretch; display: flex; flex-direction: column; gap: 6px; }
.tool { background: var(--card); border: 1px solid var(--line); border-radius: 12px; font: 13.5px var(--sans); overflow: hidden; }
.tool > summary { list-style: none; cursor: pointer; padding: 9px 12px; display: flex; gap: 8px; align-items: center; min-height: 40px; }
.tool > summary::-webkit-details-marker { display: none; }
.tool > summary:hover { background: var(--card2); }
.tool .nm { color: var(--brand-ink); font-weight: 700; flex: none; }
.tool .sm { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; font: 12.5px var(--mono); }
.tool .st { flex: none; font-weight: 700; }
.tool .st.ok { color: var(--ok); } .tool .st.bad { color: var(--bad); } .tool .st.wait { color: var(--muted); animation: pulse 1.2s infinite; }
.tool pre { margin: 0; padding: 10px 12px; border-top: 1px solid var(--line); max-height: 240px; overflow: auto; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--text); background: var(--pre-bg); }
.tool .cmd { padding: 8px 12px 0; font: 12px var(--mono); color: var(--muted); white-space: pre-wrap; word-break: break-word; }

.note { align-self: center; font-size: 13px; color: var(--muted); text-align: center; padding: 2px 10px; }
.note.bad { color: var(--bad); } .note.ok { color: var(--ok); } .note.warn { color: var(--warn); }
.typing { align-self: flex-start !important; display: flex; gap: 5px; padding: 8px 4px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: bounce 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.jump { position: absolute; right: 16px; bottom: calc(150px + var(--safe-b)); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--text); display: grid; place-items: center; z-index: 4; box-shadow: var(--shadow); cursor: pointer; }

/* caixa de mensagem */
.composer { padding: 6px max(12px, calc(50% - var(--col) / 2)) calc(12px + var(--safe-b)); }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 10px 10px 8px; transition: border-color .15s, box-shadow .15s; }
.box:focus-within { border-color: color-mix(in srgb, var(--accent) 65%, var(--line)); }
.box.drag { border-color: var(--accent); background: var(--soft); }
#msg { resize: none; max-height: 200px; border: 0; background: transparent; box-shadow: none; border-radius: 12px; padding: 8px 10px; line-height: 1.45; }
#msg:focus { box-shadow: none; }
.bar-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tool-btn { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.tool-btn:hover, .tool-btn[aria-expanded="true"] { background: var(--card2); color: var(--text); }
.tool-btn.rec { background: var(--bad); color: #fff; animation: pulse 1s infinite; }
.chips { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { background: transparent; border: 1px solid transparent; color: var(--muted); border-radius: 999px; padding: 0 12px; min-height: 36px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--card2); color: var(--text); }
.chip.on { color: var(--brand-ink); background: var(--soft); }
.chip.on.total { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
#modelSel { width: auto; flex: none; min-height: 36px; padding: 2px 26px 2px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--text); background-color: transparent; border-color: transparent; cursor: pointer; }
#modelSel:hover { background-color: var(--card2); }
.send { flex: none; width: 44px; height: 44px; border-radius: 14px; border: 0; display: grid; place-items: center; color: var(--btn-ink); background: var(--btn); cursor: pointer; transition: background .15s, transform .1s; }
.send:hover { background: var(--btn-hover); }
.send:active { transform: scale(.96); }
.send.stop { background: var(--text); color: var(--bg); }
.send:disabled { opacity: .45; cursor: default; }
@media (max-width: 560px) { .chips { order: -1; flex-basis: 100%; padding-bottom: 2px; } .attach-wrap { margin-right: auto; } .starters { gap: 8px; margin-top: 18px; } .starter { min-height: 58px; padding: 12px 14px; align-content: center; } .starter span { display: none; } .meter:nth-child(2) { display: none; } }

/* menu "+" */
.attach-wrap { position: relative; }
.menu { position: absolute; left: 0; bottom: calc(100% + 8px); min-width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; z-index: 30; display: grid; }
.menu button { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; background: none; border: 0; border-radius: 10px; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; text-align: left; }
.menu button:hover, .menu button:focus-visible { background: var(--card2); }
.menu button svg { color: var(--brand-ink); flex: none; }

/* anexos */
.atts { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 4px 8px; }
.att { display: inline-flex; align-items: center; gap: 8px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 10px; font-size: 13px; max-width: 100%; }
.att.img { padding: 4px; position: relative; }
.att.img img { width: 56px; height: 56px; object-fit: cover; border-radius: 9px; display: block; }
.att.img .att-x { position: absolute; top: -8px; right: -8px; background: var(--text); color: var(--bg); border-radius: 50%; width: 24px; height: 24px; font-size: 12px; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.att.up { opacity: .6; }
.att button { background: none; border: 0; color: var(--muted); width: 28px; height: 28px; font-size: 14px; cursor: pointer; }
.drop-hint { position: fixed; inset: 12px; z-index: 50; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 22px; background: color-mix(in srgb, var(--bg) 86%, var(--brand)); color: var(--accent-ink);
  font: 600 22px var(--display); pointer-events: none; }

/* painel de arquivos */
.files { position: fixed; top: 0; right: 0; bottom: 0; width: min(100vw, 420px); background: var(--side); border-left: 1px solid var(--line); z-index: 22;
  transform: translateX(102%); transition: transform .22s ease; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 10px) 12px calc(var(--safe-b) + 12px); gap: 8px; }
.files.open { transform: none; box-shadow: var(--shadow); }
.files-head { display: flex; align-items: center; gap: 8px; }
.files-head strong { flex: 1; font: 600 16px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 13.5px; }
.crumbs button { background: none; border: 0; color: var(--brand-ink); padding: 4px 6px; min-height: 32px; border-radius: 8px; font: inherit; cursor: pointer; }
.crumbs button:hover { background: var(--card2); }
.crumbs span { color: var(--muted); }
.file-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 1px; min-height: 120px; }
.file-list li button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; background: none; border: 0; border-radius: 10px; color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.file-list li button:hover { background: var(--card2); }
.file-list li button svg { flex: none; color: var(--muted); }
.file-list li.dir button svg { color: var(--accent); }
.file-list li button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li button em { font-style: normal; font-size: 12px; color: var(--muted); flex: none; }
.file-list .empty-li { padding: 14px 10px; color: var(--muted); font-size: 14px; }
.file-prev { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; max-height: 55%; overflow: auto; }
.prev-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.prev-name { font: 600 14px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prev-text { margin: 0; background: var(--pre-bg); color: var(--pre-text); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: 12px/1.55 var(--mono); overflow: auto; max-height: 260px; white-space: pre; }
.prev-img { max-width: 100%; max-height: 260px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; background: var(--card); }

/* paleta de comandos */
dialog.cmd { width: min(94vw, 600px); margin: 12vh auto auto; }
.cmd-box { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
#cmdInput { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 18px 20px; font-size: 17px; }
#cmdInput:focus { box-shadow: none; }
.cmd-list { list-style: none; margin: 0; padding: 6px; max-height: min(52vh, 420px); overflow-y: auto; }
.cmd-list .grp { padding: 10px 12px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cmd-list li[role="option"] { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 12px; border-radius: 10px; cursor: pointer; }
.cmd-list li[aria-selected="true"] { background: var(--soft); }
.cmd-list li b { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.cmd-list li small { color: var(--muted); font-size: 12px; flex: none; }
.cmd-list .none { padding: 18px 12px; color: var(--muted); font-size: 14px; }
.cmd-foot { padding: 10px 16px; border-top: 1px solid var(--line); }

/* diálogos */
dialog { background: transparent; border: 0; padding: 0; color: var(--text); width: min(92vw, 440px); }
dialog::backdrop { background: rgba(8, 4, 14, .62); backdrop-filter: blur(3px); }
dialog .card { display: grid; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); max-height: 88dvh; overflow-y: auto; }
dialog h3 { margin: 0; font: 600 20px/1.2 var(--display); letter-spacing: -.01em; }
dialog label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
dialog code { background: var(--code-bg); padding: 1px 5px; border-radius: 5px; font: .9em var(--mono); }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; }
.dlg-actions.wrap { flex-wrap: wrap; justify-content: flex-start; }
.opts { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.radio { display: flex !important; flex-direction: row; align-items: center; gap: 10px; color: var(--text) !important; min-height: 40px; }
.radio input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.prog { display: grid; gap: 6px; }
.h-sub { margin: 6px 0 0; font-size: 16px !important; }
.check { display: flex !important; flex-direction: row; align-items: center; gap: 10px; color: var(--text) !important; min-height: 40px; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: calc(130px + var(--safe-b)); transform: translateX(-50%); z-index: 60; max-width: 86vw; background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 14px; font-size: 14px; box-shadow: var(--shadow); text-align: center; }
.toast.bad { background: var(--bad); color: #fff; }
.sys { display: grid; gap: 8px; font-size: 14px; }
.sys .line { display: flex; justify-content: space-between; gap: 10px; color: var(--text); }
.sys .line span:first-child { color: var(--muted); }
.bar { height: 7px; background: var(--card2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .2s; }
.bar i.hot { background: var(--warn); } .bar i.crit { background: var(--bad); }
.ok-txt { color: var(--ok); } .bad-txt { color: var(--bad); }
.rep-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rep-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 52dvh; overflow-y: auto; }
.rep-item { display: grid; gap: 2px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.rep-item.unread { border-color: var(--accent); }
.rep-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-view { max-width: 100%; max-height: 52dvh; overflow-y: auto; align-self: stretch; }

/* desktop: barra lateral fixa; arquivos ao lado */
@media (min-width: 900px) {
  .drawer { position: static; transform: none; width: 292px; flex: none; z-index: 1; transition: none; }
  .scrim { display: none !important; }
  #menuBtn, #closeDrawer { display: none; }
  .top { padding-left: 20px; }
  .jump { bottom: 140px; }
}
@media (min-width: 1280px) {
  .files { position: static; transform: none; width: 0; padding: 0; border: 0; overflow: hidden; transition: width .22s ease, padding .22s ease; flex: none; box-shadow: none; }
  .files.open { width: 400px; padding: calc(var(--safe-t) + 10px) 12px 12px; border-left: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
