/* ============ Local AI — interface ============ */
:root {
  --bg: #0b0d12;
  --bg-raise: #12151d;
  --bg-raise-2: #191d28;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8eaf0;
  --text-dim: #9aa1b2;
  --text-faint: #646b7c;
  --accent: #7c6cff;
  --accent-soft: rgba(124, 108, 255, 0.14);
  --accent-2: #4dd6c1;
  --danger: #ff6b6b;
  --ok: #45d483;
  --warn: #f5b94d;
  --radius: 14px;
  --sidebar-w: 272px;
  --font: "Inter", "SF Pro Text", -apple-system, "Segoe UI", Roboto, "Ubuntu", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(124, 108, 255, 0.35); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }
::-webkit-scrollbar-track { background: transparent; }

/* ============ auth ============ */
.auth-wrap {
  min-height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; padding: 24px;
  background:
    radial-gradient(1100px 500px at 20% -10%, rgba(124,108,255,.14), transparent 60%),
    radial-gradient(900px 500px at 95% 110%, rgba(77,214,193,.10), transparent 60%),
    var(--bg);
}
.auth-card {
  width: min(400px, 100%);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px 30px 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.brand-lockup { text-align: center; margin-bottom: 24px; }
.brand-gem {
  width: 52px; height: 52px; margin: 0 auto 12px;
  display: grid; place-items: center;
  font-size: 24px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(124,108,255,.4);
}
.brand-gem.small {
  width: 26px; height: 26px; font-size: 12px; border-radius: 8px;
  display: inline-grid; margin: 0; box-shadow: none;
}
.brand-lockup h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.tagline { color: var(--text-dim); font-size: 13.5px; margin-top: 6px; }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg); border-radius: 12px; padding: 4px;
  margin-bottom: 20px; border: 1px solid var(--border);
}
.auth-tab {
  border: 0; background: transparent; color: var(--text-dim);
  padding: 9px 0; border-radius: 9px; font-size: 14px; font-weight: 600;
  transition: all .18s ease;
}
.auth-tab.active { background: var(--bg-raise-2); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.35); }

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-dim); margin-bottom: 6px; letter-spacing: .02em;
}
.field input, .field textarea {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: 11px;
  color: var(--text); padding: 11px 13px; font-size: 14.5px;
  font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,108,255,.18);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field-hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.btn-primary {
  width: 100%; border: 0; border-radius: 11px; padding: 12px;
  font-size: 15px; font-weight: 650; color: #fff;
  background: linear-gradient(135deg, var(--accent), #9b6bff);
  transition: filter .15s ease, transform .05s ease;
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-primary.slim { width: auto; padding: 9px 22px; font-size: 14px; }

.auth-error {
  background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.35);
  color: #ffb3b3; font-size: 13.5px; border-radius: 10px;
  padding: 9px 12px; margin-bottom: 14px;
}
.auth-footnote { color: var(--text-faint); font-size: 12.5px; }


/* ============ app shell ============ */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg-raise);
  border-right: 1px solid var(--border);
  transition: margin-left .22s ease;
}
.sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-w)); }

.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 10px;
}
.brand-mini { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  background: transparent; border: 1px solid transparent; color: var(--text-faint);
  width: 30px; height: 30px; border-radius: 8px; font-size: 14px;
  transition: all .15s ease;
}
.icon-btn:hover { color: var(--text); background: var(--bg-raise-2); }

.btn-newchat {
  margin: 4px 12px 10px;
  background: var(--accent-soft); color: #c9c2ff;
  border: 1px solid rgba(124,108,255,.35); border-radius: 11px;
  padding: 10px; font-size: 14px; font-weight: 600;
  transition: all .15s ease;
}
.btn-newchat:hover { background: rgba(124,108,255,.24); }

.mode-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
  margin: 0 12px 8px;
}
.mode-tab {
  background: var(--bg); border: 1px solid var(--border); color: var(--text-dim);
  padding: 7px 0; border-radius: 9px; font-size: 13px; font-weight: 600;
  transition: all .12s ease;
}
.mode-tab.active { background: var(--accent-soft); color: var(--text); border-color: rgba(124,108,255,.3); }
.mode-tab:hover { color: var(--text); }
.mode-tab { padding: 7px 2px; font-size: 12px; }

.chat-list { flex: 1; overflow-y: auto; padding: 2px 8px 10px; }
.chat-group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-faint);
  padding: 12px 8px 5px;
}
.chat-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--text-dim); font-size: 13.5px;
  cursor: pointer; border: 1px solid transparent;
  transition: all .12s ease; position: relative;
}
.chat-item:hover { background: var(--bg-raise-2); color: var(--text); }
.chat-item.active { background: var(--accent-soft); color: var(--text); border-color: rgba(124,108,255,.25); }
.chat-item .title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .del {
  opacity: 0; background: none; border: 0; color: var(--text-faint);
  font-size: 13px; padding: 2px 4px; border-radius: 6px;
}
.chat-item:hover .del { opacity: 1; }
.chat-item .del:hover { color: var(--danger); background: rgba(255,107,107,.12); }

.side-foot { border-top: 1px solid var(--border); padding: 10px 12px 12px; }
.side-foot-btn {
  width: 100%; text-align: left; background: transparent; border: 0;
  color: var(--text-dim); font-size: 13.5px; font-weight: 550;
  padding: 8px 9px; border-radius: 9px; transition: all .12s ease;
  display: flex; align-items: center; gap: 2px;
}
.side-foot-btn:hover { background: var(--bg-raise-2); color: var(--text); }
.count-badge {
  margin-left: auto; background: var(--accent-soft); color: #c9c2ff;
  border-radius: 20px; font-size: 11px; font-weight: 700; padding: 1px 8px;
}
.user-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 4px 6px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #3d4a72, #2a3352);
  font-weight: 700; font-size: 14px; color: #cfd6ea;
}
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-btn { background: none; border: 0; color: var(--text-faint); font-size: 12px; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--text-dim); }
.llm-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.llm-dot.ready { background: var(--ok); box-shadow: 0 0 8px rgba(69,212,131,.7); }
.llm-dot.loading { background: var(--warn); }
.llm-dot.offline { background: var(--danger); }

/* ============ main pane ============ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: rgba(11,13,18,.75); backdrop-filter: blur(8px);
}
.chat-title { font-weight: 650; font-size: 14.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-chip {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-dim);
  background: var(--bg-raise); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 20px; font-family: var(--mono);
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 2.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.scroller { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.messages { max-width: 820px; margin: 0 auto; padding: 26px 22px 10px; }

/* empty state */
.empty-state {
  max-width: 560px; margin: 12vh auto 0; text-align: center; padding: 0 20px;
}
.empty-gem {
  width: 58px; height: 58px; margin: 0 auto 18px;
  display: grid; place-items: center; font-size: 26px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 18px; box-shadow: 0 10px 40px rgba(124,108,255,.35);
}
.empty-state h2 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 8px; }
.empty-state p { color: var(--text-dim); font-size: 14.5px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 22px; }
.sugg {
  background: var(--bg-raise); border: 1px solid var(--border-strong);
  color: var(--text-dim); border-radius: 20px; padding: 8px 15px;
  font-size: 13px; transition: all .15s ease;
}
.sugg:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

/* messages */
.msg { margin-bottom: 26px; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble {
  max-width: 76%;
  background: linear-gradient(135deg, rgba(124,108,255,.22), rgba(124,108,255,.14));
  border: 1px solid rgba(124,108,255,.3);
  border-radius: 18px 18px 5px 18px;
  padding: 11px 16px; white-space: pre-wrap; overflow-wrap: break-word;
}

.msg.assistant { display: flex; gap: 13px; }
.ai-avatar {
  width: 30px; height: 30px; flex-shrink: 0; margin-top: 2px;
  display: grid; place-items: center; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px;
}
.ai-body { flex: 1; min-width: 0; }

/* tool activity chips */
.activity { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.tool-chip {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-raise); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 12px;
  font-size: 12.5px; color: var(--text-dim);
  max-width: 100%; overflow: hidden;
}
.tool-chip .t-icon { flex-shrink: 0; }
.tool-chip .t-label { font-weight: 600; color: var(--text); flex-shrink: 0; }
.tool-chip .t-detail {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--mono); font-size: 11.5px;
}
.tool-chip.running { border-color: rgba(245,185,77,.4); }
.tool-chip.running .t-icon { animation: spin 1.2s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.tool-chip.done { border-color: var(--border); }
.tool-chip .t-check { margin-left: auto; color: var(--ok); flex-shrink: 0; }

/* thinking accordion */
.thinking {
  margin-bottom: 10px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-raise); overflow: hidden;
}
.thinking summary {
  cursor: pointer; list-style: none; padding: 7px 12px;
  font-size: 12.5px; color: var(--text-faint); font-weight: 600;
  display: flex; align-items: center; gap: 8px; user-select: none;
}
.thinking summary::-webkit-details-marker { display: none; }
.thinking summary .chev { transition: transform .15s ease; font-size: 10px; }
.thinking[open] summary .chev { transform: rotate(90deg); }
.thinking.streaming summary .think-label {
  background: linear-gradient(90deg, var(--text-faint), var(--text), var(--text-faint));
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.think-body {
  padding: 4px 14px 12px; color: var(--text-faint);
  font-size: 13px; white-space: pre-wrap; overflow-wrap: break-word;
  max-height: 300px; overflow-y: auto;
}

/* markdown content */
.content { overflow-wrap: break-word; }
.content > *:first-child { margin-top: 0; }
.content > *:last-child { margin-bottom: 0; }
.content p, .content ul, .content ol, .content blockquote, .content table { margin: 0 0 12px; }
.content h1, .content h2, .content h3, .content h4 {
  margin: 20px 0 10px; letter-spacing: -.01em; line-height: 1.3;
}
.content h1 { font-size: 21px; } .content h2 { font-size: 18px; } .content h3 { font-size: 16px; }
.content ul, .content ol { padding-left: 24px; }
.content li { margin-bottom: 4px; }
.content a { color: #9d8fff; text-decoration: none; border-bottom: 1px solid rgba(157,143,255,.35); }
.content a:hover { border-bottom-color: #9d8fff; }
.content blockquote {
  border-left: 3px solid var(--accent); padding: 2px 0 2px 14px;
  color: var(--text-dim);
}
.content code {
  font-family: var(--mono); font-size: 12.8px;
  background: var(--bg-raise-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1.5px 6px;
}
.content pre {
  background: #0d1017; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; overflow-x: auto;
  margin: 0 0 12px; position: relative;
}
.content pre code { background: none; border: 0; padding: 0; font-size: 12.8px; line-height: 1.55; }
.content table { border-collapse: collapse; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--border-strong); padding: 7px 12px; font-size: 13.5px; }
.content th { background: var(--bg-raise); }
.content hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

.cursor-blink {
  display: inline-block; width: 8px; height: 15px; margin-left: 2px;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite; border-radius: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.msg-error {
  background: rgba(255,107,107,.08); border: 1px solid rgba(255,107,107,.3);
  color: #ffb3b3; border-radius: 10px; padding: 9px 13px; font-size: 13.5px;
  margin-top: 8px;
}
.msg-notice, .queue-note {
  color: var(--text-faint); font-size: 12.5px; font-style: italic;
  margin-bottom: 8px;
}
.queue-note::before {
  content: "◌"; display: inline-block; margin-right: 7px; font-style: normal;
  animation: spin 1.2s linear infinite;
}

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px);
  background: var(--bg-raise-2); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 13.5px; padding: 11px 18px; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5); z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ composer ============ */
.composer-wrap { padding: 10px 22px 14px; }
.composer {
  max-width: 820px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--bg-raise);
  border: 1px solid var(--border-strong); border-radius: 18px;
  padding: 10px 10px 10px 18px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,108,255,.15); }
.composer textarea {
  flex: 1; background: transparent; border: 0; outline: 0; resize: none;
  color: var(--text); font-family: inherit; font-size: 15px; line-height: 1.5;
  max-height: 200px; padding: 4px 0;
}
.send-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 0;
  background: linear-gradient(135deg, var(--accent), #9b6bff);
  color: #fff; font-size: 15px; flex-shrink: 0;
  transition: filter .15s ease, opacity .15s ease;
}
.send-btn:hover { filter: brightness(1.15); }
.send-btn:disabled { opacity: .35; cursor: default; }
.send-btn.stop { background: var(--bg-raise-2); border: 1px solid var(--border-strong); color: var(--danger); }
.composer-hint { text-align: center; color: var(--text-faint); font-size: 11.5px; margin-top: 8px; }

/* ============ images view ============ */
.images-view { display: none; flex: 1; overflow: hidden; }
.mode-images #scroller,
.mode-images .composer-wrap { display: none; }
.mode-images .images-view { display: flex; flex-direction: column; }

.images-scroll { flex: 1; overflow-y: auto; padding: 24px 22px; }
.imggen-panel {
  max-width: 820px; margin: 0 auto 22px;
  background: var(--bg-raise); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px;
}
.imggen-title { font-size: 18px; margin-bottom: 4px; }
.imggen-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }
.img-prompt {
  width: 100%; background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 11px; color: var(--text); padding: 12px 14px; font-size: 14.5px;
  font-family: inherit; resize: vertical; line-height: 1.5;
}
.img-prompt:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,108,255,.15); }
.img-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px;
}
.img-controls label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
}
.img-controls select, .img-controls input {
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 9px;
  color: var(--text); padding: 8px 10px; font-size: 13.5px; font-family: inherit;
}
.img-controls input[type=number] { width: 88px; }
.img-controls .btn-primary { margin-left: auto; padding: 10px 24px; }
.img-adv { margin-top: 12px; }
.img-adv summary { cursor: pointer; font-size: 12.5px; color: var(--text-faint); font-weight: 600; user-select: none; }
.img-adv summary:hover { color: var(--text-dim); }
.img-adv textarea { margin-top: 10px; }
.img-status {
  margin-top: 14px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px;
  background: var(--accent-soft); border: 1px solid rgba(124,108,255,.28); color: #c9c2ff;
}
.img-status.ok { background: rgba(69,212,131,.1); border-color: rgba(69,212,131,.3); color: #8fe6b4; }
.img-status.err { background: rgba(255,107,107,.08); border-color: rgba(255,107,107,.3); color: #ffb3b3; }

.img-gallery {
  max-width: 820px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
}
.img-card {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-raise); aspect-ratio: 1;
}
.img-card img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; transition: transform .2s ease; }
.img-card:hover img { transform: scale(1.03); }
.img-card-actions {
  position: absolute; top: 6px; right: 6px; display: flex; gap: 6px;
  opacity: 0; transition: opacity .15s ease;
}
.img-card:hover .img-card-actions { opacity: 1; }
.img-card-3d, .img-card-del {
  background: rgba(4,5,8,.72); border: 0; color: #fff; font-size: 12px;
  height: 28px; border-radius: 8px; padding: 0 9px; font-weight: 600;
}
.img-card-3d:hover { background: rgba(124,108,255,.85); }
.img-card-del { width: 28px; padding: 0; }
.img-card-del:hover { background: rgba(255,107,107,.8); }

.photo3d-panel {
  margin-top: 14px; background: var(--bg-raise); border: 1px solid var(--border-strong);
  border-radius: 14px; padding: 14px 16px;
}
.photo3d-inner { display: flex; align-items: center; gap: 12px; }
.photo3d-icon { font-size: 22px; }
.photo3d-text { flex: 1; display: flex; flex-direction: column; }
.photo3d-text b { font-size: 14px; }
.photo3d-text span { font-size: 12.5px; color: var(--text-dim); }

.lightbox-inner {
  max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column;
  gap: 12px; align-items: center;
}
#lightbox-img { max-width: 92vw; max-height: 80vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox-bar { display: flex; align-items: center; gap: 14px; max-width: 92vw; }
.lightbox-prompt { color: var(--text-dim); font-size: 12.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-btn {
  background: var(--bg-raise-2); border: 1px solid var(--border-strong); color: var(--text);
  padding: 8px 16px; border-radius: 10px; font-size: 13px; text-decoration: none; cursor: pointer;
}
.lightbox-btn:hover { border-color: var(--accent); }

/* ============ artifacts ============ */
.artifacts-view { display: none; flex: 1; overflow: hidden; }
.mode-artifacts #scroller,
.mode-artifacts .composer-wrap { display: none; }
.mode-artifacts .artifacts-view { display: flex; flex-direction: column; }
.artifacts-scroll { flex: 1; overflow-y: auto; padding: 24px 22px; }
.artifacts-head { max-width: 900px; margin: 0 auto 18px; }

/* ===== DECOMPILE VIEW ===== */
.decompile-view { display: none; flex: 1; overflow: hidden; }
.mode-re.re-decompile .decompile-view { display: flex; flex-direction: column; }
.decompile-scroll { flex: 1; overflow-y: auto; padding: 24px 22px; }
.decompile-scroll .imggen-panel { max-width: 900px; margin: 0 auto; }
.dc-drop {
  margin-top: 16px; border: 1.5px dashed var(--border-strong); border-radius: 14px;
  padding: 26px 20px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dc-drop:hover, .dc-drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.dc-drop-inner { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.dc-icon { font-size: 30px; }
.dc-drop-main { font-size: 15px; }
.dc-hint { font-size: 12px; color: var(--text-dim); }
.dc-result { max-width: 900px; margin: 20px auto 0; }
.dc-result-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.dc-file { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.dc-arch { display: block; font-weight: 400; font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.dc-badges { display: flex; gap: 8px; flex-shrink: 0; }
.dc-badge {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-dim); white-space: nowrap;
}
.dc-badge.ok { background: rgba(52,199,120,.14); color: #34c778; border-color: rgba(52,199,120,.4); }
.dc-badge.warn { background: rgba(240,170,60,.14); color: #f0aa3c; border-color: rgba(240,170,60,.4); }
.dc-tabs {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 12px 12px 0 0; padding: 6px 8px; background: var(--bg-soft);
}
.dc-tab {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  padding: 6px 12px; border-radius: 8px; font-size: 13px;
}
.dc-tab.active { background: var(--accent-soft); color: var(--text); }
.dc-tab:hover { color: var(--text); }
.dc-tab-actions { margin-left: auto; display: flex; gap: 6px; }
.dc-tab-actions button, .dc-tab-actions a {
  font-size: 12px; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text-dim);
  text-decoration: none;
}
.dc-tab-actions button:hover, .dc-tab-actions a:hover { color: var(--text); border-color: var(--accent); }
.dc-code {
  margin: 0; border: 1px solid var(--border); border-radius: 0 0 12px 12px;
  background: var(--code-bg, #0d1117); overflow: auto; max-height: 62vh;
}
.dc-code code {
  display: block; padding: 16px 18px; white-space: pre;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.55; color: var(--code-text, #d7dde8);
}
.dc-history-wrap { max-width: 900px; margin: 26px auto 0; }
.dc-history-head { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; font-weight: 600; }
.dc-history { display: flex; flex-direction: column; gap: 6px; }
.dc-hist-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--bg-soft);
}
.dc-hist-row:hover { border-color: var(--accent); }
.dc-hist-name { font-weight: 500; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-hist-meta { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.dc-hist-del { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 13px; }
.dc-hist-del:hover { color: #ff6b6b; }

/* ===== SECURITY TOOLS VIEW ===== */
.security-view { display: none; flex: 1; overflow: hidden; }
.mode-re #scroller,
.mode-re .composer-wrap { display: none; }
.mode-re.re-hunter .security-view { display: flex; flex-direction: column; }

/* sub-tool switcher (Backdoor Hunter / C Decompiler) */
.re-subtabs { display: flex; gap: 8px; max-width: 920px; margin: 0 auto 18px; }
.re-subtab {
  font-size: 13.5px; font-weight: 500; font-family: var(--font); cursor: pointer;
  padding: 8px 16px; border-radius: 999px; color: var(--text-dim);
  background: var(--bg-raise); border: 1px solid var(--border);
}
.re-subtab:hover { color: var(--text); }
.re-subtab.active { color: var(--text); background: var(--accent-soft); border-color: rgba(124,108,255,.35); }
.re-modes { display: inline-flex; gap: 4px; padding: 3px; margin-bottom: 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.re-mode {
  font-size: 13px; font-family: var(--mono); cursor: pointer; padding: 6px 14px;
  border-radius: 7px; border: none; background: none; color: var(--text-dim);
}
.re-mode.active { background: var(--accent-2); color: #08110f; font-weight: 600; }
.hunt-pane.hidden { display: none; }
.mine-mode {
  font-size: 13px; font-family: var(--mono); cursor: pointer; padding: 6px 14px;
  border-radius: 7px; border: none; background: none; color: var(--text-dim);
}
.mine-mode.active { background: var(--accent-2); color: #08110f; font-weight: 600; }
.mine-pane.hidden { display: none; }
.mine-secret-in { font-family: var(--mono); font-size: 13.5px; width: 100%;
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-raise); color: var(--text); margin-bottom: 4px; }
.anz-label { display: block; font-size: 12px; font-family: var(--mono); color: var(--text-faint);
  margin: 14px 0 5px; letter-spacing: .03em; }
.anz-code, .anz-spec {
  width: 100%; resize: vertical; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
}
.anz-spec { font-family: var(--font); font-size: 14px; }
.anz-code:focus, .anz-spec:focus { outline: none; border-color: var(--accent-2); }
.security-scroll { flex: 1; overflow-y: auto; padding: 26px 22px; }
.security-scroll > * { max-width: 920px; margin-left: auto; margin-right: auto; }
.sec-hero { padding: 8px 0 6px; }
.sec-badge {
  display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-2); background: rgba(77,214,193,.12);
  border: 1px solid rgba(77,214,193,.3); border-radius: 999px; padding: 4px 11px; margin-bottom: 14px;
}
.sec-title { font-size: 27px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }
.sec-star { color: var(--accent); }
.sec-lede { color: var(--text-dim); font-size: 16px; line-height: 1.6; max-width: 68ch; margin: 0; }
.sec-lede b, .sec-sub b, .sec-cap b, .sec-list b { color: var(--text); font-weight: 600; }
.sec-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.sec-stat {
  flex: 1 1 160px; background: var(--bg-raise); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.sec-n { display: block; font-family: var(--mono); font-size: 24px; font-weight: 600; }
.sec-n.ok { color: var(--ok); } .sec-n.teal { color: var(--accent-2); }
.sec-l { display: block; font-size: 12.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.4; }
.sec-panel {
  background: var(--bg-raise); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-top: 18px;
}
.sec-h3 { font-size: 18px; font-weight: 600; margin: 0 0 8px; letter-spacing: -.01em; }
.sec-sub { color: var(--text-dim); font-size: 15px; line-height: 1.6; margin: 0 0 16px; max-width: 70ch; }
.sec-tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.sec-table { border-collapse: collapse; width: 100%; min-width: 600px; font-size: 14px; }
.sec-table thead th {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-faint); text-align: left; font-weight: 600; padding: 12px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-raise-2);
}
.sec-table th.num, .sec-table td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sec-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sec-table tbody tr:last-child td { border-bottom: none; }
.sec-table tbody tr.sec-hl td { background: rgba(124,108,255,.07); }
.sec-dev { font-weight: 500; color: var(--text); }
.sec-dev small { display: block; color: var(--text-faint); font-weight: 400; font-size: 12px; font-family: var(--mono); margin-top: 2px; }
.sec-chip {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 12px;
  font-weight: 500; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.sec-chip.ok { color: var(--ok); background: rgba(69,212,131,.14); }
.sec-chip.llm { color: var(--accent-2); background: rgba(77,214,193,.14); }
.sec-chip.blind { color: var(--warn); background: rgba(245,185,77,.14); }
.sec-cap { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin: 14px 0 0; }
.sec-flow { display: flex; flex-direction: column; gap: 10px; }
.sec-step { display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: start; }
.sec-step .sec-k {
  font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent);
  border: 1px solid var(--border-strong); border-radius: 7px; height: 28px;
  display: flex; align-items: center; justify-content: center; background: var(--bg-raise-2);
}
.sec-step b { font-size: 15px; }
.sec-step p { margin: 3px 0 0; color: var(--text-dim); font-size: 14px; line-height: 1.55; }
.sec-who {
  font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 20px; margin-left: 8px; vertical-align: middle;
}
.sec-who.llm { color: var(--accent-2); background: rgba(77,214,193,.14); }
.sec-who.cls { color: var(--text-faint); background: var(--bg-raise-2); border: 1px solid var(--border); }
.sec-redteam { border-left: 3px solid var(--accent); }
.sec-list { margin: 6px 0 0; padding-left: 20px; color: var(--text-dim); font-size: 14.5px; }
.sec-list li { margin: 8px 0; line-height: 1.55; }
.sec-fix { color: var(--ok); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.sec-note {
  margin-top: 18px; font-size: 13.5px; color: var(--text-dim); line-height: 1.65;
  background: var(--bg-raise); border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 18px 20px;
}
.sec-note b { color: var(--text); }

/* interactive runner */
.sec-runner { border-left: 3px solid var(--accent-2); }
.sec-devgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.sec-devcard {
  text-align: left; background: var(--bg-raise-2); border: 1px solid var(--border);
  border-radius: 11px; padding: 13px 15px; cursor: pointer; color: var(--text);
  transition: border-color .12s, background .12s; font-family: inherit;
}
.sec-devcard:hover { border-color: var(--border-strong); }
.sec-devcard.active { border-color: var(--accent-2); background: rgba(77,214,193,.08); }
.sec-devcard .dl { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.sec-devcard .de { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
.sec-devcard .db { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.4; }
.sec-runbar { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.sec-runhint { font-size: 13px; color: var(--text-dim); }
.sec-status {
  margin-top: 16px; font-family: var(--mono); font-size: 13px; color: var(--accent-2);
  background: var(--bg-raise-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.sec-status.err { color: var(--danger); }
.sec-spin {
  width: 13px; height: 13px; border: 2px solid var(--border-strong);
  border-top-color: var(--accent-2); border-radius: 50%; animation: sec-spin .8s linear infinite; flex-shrink: 0;
}
@keyframes sec-spin { to { transform: rotate(360deg); } }
.sec-result { margin-top: 18px; }
.sec-verdict {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 12px;
  border: 1px solid var(--border); margin-bottom: 16px;
}
.sec-verdict.found { background: rgba(255,107,107,.09); border-color: rgba(255,107,107,.3); }
.sec-verdict.clean { background: rgba(69,212,131,.09); border-color: rgba(69,212,131,.3); }
.sec-verdict .vi { font-size: 26px; line-height: 1; }
.sec-verdict .vt b { display: block; font-size: 15px; }
.sec-verdict .vt span { font-size: 13px; color: var(--text-dim); }
.sec-kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: 14px; margin-bottom: 16px; }
.sec-kv dt { color: var(--text-faint); font-family: var(--mono); font-size: 12px; }
.sec-kv dd { margin: 0; color: var(--text); }
.sec-kv dd code, .sec-trigger code {
  font-family: var(--mono); font-size: 12.5px; background: var(--bg-raise-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px;
}
.sec-trigger { font-family: var(--mono); font-size: 13px; color: var(--text); word-break: break-word; line-height: 1.9; }
.sec-steps { margin: 4px 0 16px; padding-left: 0; list-style: none; }
.sec-steps li { font-size: 13px; color: var(--text-dim); padding: 5px 0; border-bottom: 1px dashed var(--border); }
.sec-steps li b { font-family: var(--mono); color: var(--accent-2); font-size: 12px; margin-right: 8px; }
.sec-report {
  background: var(--bg-raise-2); border: 1px solid var(--border); border-radius: 11px;
  padding: 4px 20px; margin-top: 8px;
}
.sec-report h1 { font-size: 18px; } .sec-report h2 { font-size: 15px; margin-top: 18px; }
.sec-report h3 { font-size: 14px; }
.sec-report pre { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 12px; }
.sec-report code { font-family: var(--mono); font-size: 12.5px; }
.sec-report details { margin: 8px 0; }
.sec-report summary { cursor: pointer; color: var(--accent-2); font-size: 13px; font-family: var(--mono); }

@media (max-width: 640px) { .sec-title { font-size: 22px; } }

/* ===== LEAKAGE MINER VIEW ===== */
.mine-view { display: none; flex: 1; overflow: hidden; }
.mode-re.re-mine .mine-view { display: flex; flex-direction: column; }
.mine-summary { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.mine-stat { background: var(--bg-raise-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 13px; font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.mine-stat b { color: var(--text); font-size: 14px; }
.assoc-list { display: flex; flex-direction: column; gap: 6px; }
.assoc-head { font-family: var(--mono); font-size: 11px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .05em; margin: 6px 0 2px; }
.assoc-row {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center;
  background: var(--bg-raise-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 13px;
}
.assoc-row.suspicious { border-color: rgba(255,107,107,.4); background: rgba(255,107,107,.06); }
.assoc-row.written-off { opacity: .62; }
.assoc-nmi { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--text); }
.assoc-pair { font-family: var(--mono); font-size: 13px; color: var(--text); }
.assoc-pair .tilde { color: var(--accent-2); margin: 0 4px; }
.assoc-reason { font-size: 12px; color: var(--text-dim); margin-top: 2px; font-family: var(--font); }
.assoc-verdict { font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.assoc-verdict.suspicious { color: var(--danger); background: rgba(255,107,107,.15); }
.assoc-verdict.expected { color: var(--text-faint); background: var(--bg); border: 1px solid var(--border); }
.assoc-verdict.unclassified { color: var(--warn); background: rgba(245,185,77,.13); }

/* ===== SYMBOLIC SOLVER VIEW ===== */
.solve-view { display: none; flex: 1; overflow: hidden; }
.mode-re.re-solve .solve-view { display: flex; flex-direction: column; }
.solve-answer {
  background: rgba(69,212,131,.08); border: 1px solid rgba(69,212,131,.35);
  border-radius: 12px; padding: 16px 18px; margin-bottom: 14px;
}
.solve-answer .lab { font-family: var(--mono); font-size: 11px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .05em; }
.solve-answer .val { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--ok);
  margin-top: 5px; word-break: break-all; user-select: all; }
.solve-answer .hex { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-top: 4px; word-break: break-all; }

/* ===== ITERIONFUZZ — FUZZ HARNESS SYNTHESIZER VIEW ===== */
.fuzz-view { display: none; flex: 1; overflow: hidden; }
.mode-re.re-fuzz .fuzz-view { display: flex; flex-direction: column; }
.fuzz-lab { font-family: var(--mono); font-size: 12px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 6px; }
.fuzz-lab code { text-transform: none; letter-spacing: 0; }
.fuzz-pill { display: inline-block; font-family: var(--mono); font-size: 10.5px;
  text-transform: none; letter-spacing: 0; padding: 1px 7px; border-radius: 999px;
  margin-left: 6px; color: var(--text-dim); background: var(--bg-raise);
  border: 1px solid var(--border); vertical-align: middle; }
.fuzz-pill.ok { color: var(--ok); border-color: rgba(69,212,131,.4);
  background: rgba(69,212,131,.08); }
.fuzz-btn2 { background: rgba(245,120,80,.14); border: 1px solid rgba(245,120,80,.4);
  color: #f5844d; }
.fuzz-btn2:hover:not(:disabled) { background: rgba(245,120,80,.22); }
.fuzz-crash { background: var(--bg-raise); border: 1px solid var(--border);
  border-left: 3px solid #f5844d; border-radius: 8px; padding: 10px 14px;
  margin-bottom: 8px; font-size: 13.5px; }
.fuzz-crash b { color: var(--text); }
.fuzz-crash-ctx { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim);
  margin-top: 4px; }
.fuzz-crash-tool { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint);
  float: right; }

/* ===== SITUATIONAL AWARENESS DASHBOARD ===== */
.situ-view { display: none; flex: 1; overflow: hidden; }
.mode-situ #scroller, .mode-situ .composer-wrap { display: none; }
.mode-situ .situ-view { display: flex; flex-direction: column; }
.situ-scroll { overflow-y: auto; width: 100%; max-width: 1120px; margin: 0 auto; padding: 26px 24px 60px; }
.situ-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.situ-updated { font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); margin: 8px 0 0; }
.situ-services { margin-bottom: 16px; }
.situ-svc-h { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.situ-svc-h b { color: var(--text); font-weight: 600; }
.svc-pill { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.svc-up { background: #45c98a; }
.svc-degraded { background: #f0a94d; }
.svc-down { background: #f2694f; }
.situ-svc-bad { display: flex; flex-direction: column; gap: 4px; margin-top: 8px;
  border-left: 3px solid #f0a94d; padding: 6px 0 6px 12px; }
.svc-badrow { font-size: 12.5px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.svc-badrow em { color: var(--text-faint); font-style: normal; }
.situ-brief { background: var(--bg-raise); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; padding: 16px 20px; margin-bottom: 22px; }
.situ-brief p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--text); }
.situ-brief-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--accent); margin-bottom: 8px; }
.situ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.situ-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: var(--bg-raise); }
.situ-card-h { display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 12px; gap: 10px; }
.situ-src { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); font-weight: 400; white-space: nowrap; }
.situ-chart { width: 100%; }
.situ-cardnote { font-size: 11.5px; color: var(--text-faint); margin-top: 10px; line-height: 1.4; }
.situ-news { margin-top: 24px; }
.situ-newslist { display: flex; flex-direction: column; gap: 1px; }
.situ-newsrow { display: flex; gap: 12px; padding: 9px 10px; border-radius: 8px; text-decoration: none; align-items: baseline; }
.situ-newsrow:hover { background: var(--bg-raise); }
.situ-pts { font-family: var(--mono); font-size: 12px; color: var(--accent); min-width: 48px; }
.situ-newstitle { font-size: 14px; color: var(--text); }
.situ-sources { margin-top: 24px; }
.situ-srclist { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: 12.5px; line-height: 1.7; }
.situ-section { border-top: 1px solid var(--border); padding-top: 24px; margin-top: 26px; }
.situ-sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.situ-sec-h h3 { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.situ-analysis { font-size: 14.5px; line-height: 1.62; color: var(--text); margin: 0 0 16px; max-width: 78ch; }
.situ-risk { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.situ-riskcard { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--bg-raise); }
.situ-riskmodel { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.situ-riskcard ul { margin: 0; padding-left: 16px; }
.situ-riskcard li { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; margin: 2px 0; }
.situ-kevnote { font-size: 13px; color: var(--text-dim); margin: 4px 0 10px; }
.situ-kevlist { display: flex; flex-direction: column; gap: 1px; }
.situ-kevrow { display: flex; gap: 12px; align-items: baseline; padding: 7px 10px; border-radius: 7px; }
.situ-kevrow:hover { background: var(--bg-raise); }
.situ-kevcve { font-family: var(--mono); font-size: 12.5px; color: var(--accent); text-decoration: none; min-width: 132px; }
.situ-kevprod { font-size: 13px; color: var(--text); flex: 1; }
.situ-kevrw { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: #f2694f; border: 1px solid rgba(242,105,79,.4); background: rgba(242,105,79,.08); border-radius: 5px; padding: 1px 6px; }
.situ-newssrc { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
@media (max-width: 720px) { .situ-grid, .situ-risk { grid-template-columns: 1fr; } }

.situ-controls { display: flex; align-items: center; gap: 8px; }
.situ-dayselect { background: var(--bg-raise-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 9px; font-family: var(--mono); font-size: 12.5px; cursor: pointer; }
.situ-dayselect:focus { outline: none; border-color: var(--accent); }

/* ---- Situational Awareness sub-tabs + Team Board ---- */
.situ-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  padding: 14px 24px 0; max-width: 1120px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.situ-view.show-onsite .situ-scroll { display: none; }
.situ-view.show-onsite .onsite-view { display: flex; }
.situ-subtab { background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
  font-family: var(--font); font-size: 14px; color: var(--text-dim); padding: 8px 14px; margin-bottom: -1px; }
.situ-subtab:hover { color: var(--text); }
.situ-subtab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.board-compose { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-raise); padding: 12px 14px; margin-bottom: 22px; }
.board-compose textarea { width: 100%; resize: vertical; background: var(--bg-raise-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px;
  font-family: var(--font); font-size: 14.5px; line-height: 1.55; box-sizing: border-box; }
.board-compose textarea:focus { outline: none; border-color: var(--accent); }
.board-composebar { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 12px; }
.board-hint { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.board-list { display: flex; flex-direction: column; gap: 10px; }
.board-empty { color: var(--text-faint); font-size: 14px; padding: 20px 4px; text-align: center; }
.board-post { border: 1px solid var(--border); border-radius: 11px; background: var(--bg-raise);
  border-left: 3px solid var(--accent); padding: 12px 16px; }
.board-ph { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.board-user { font-weight: 600; font-size: 13.5px; color: var(--accent); }
.board-time { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.board-del { margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: 13px; line-height: 1; padding: 2px 5px; border-radius: 5px; }
.board-del:hover { color: #f2694f; background: rgba(242,105,79,.1); }
.board-text { font-size: 14.5px; line-height: 1.55; color: var(--text); white-space: pre-wrap; word-break: break-word; }

/* ===== ON-SITE INTELLIGENCE (Situational Awareness sub-tab) ===== */
.onsite-view { display: none; flex: 1; overflow: hidden; min-height: 0; }
#onsite-map { flex: 1; min-width: 0; background: #05080f; }
.onsite-side { width: 360px; flex-shrink: 0; border-left: 1px solid var(--border);
  background: var(--bg); overflow-y: auto; padding: 18px 18px 30px;
  display: flex; flex-direction: column; gap: 14px; }
.onsite-side-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.onsite-hint { font-size: 12.5px; color: var(--text-faint); margin: 0; line-height: 1.5; }
.onsite-devlist { display: flex; flex-direction: column; gap: 6px; }
.onsite-dev { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-raise); padding: 9px 11px; }
.onsite-devdot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.onsite-devdot.unplaced { background: transparent; border: 1.5px dashed var(--text-faint); }
.onsite-unknown-h { font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-faint); margin: 14px 0 6px; }
.onsite-devname { flex: 1; font-size: 13.5px; color: var(--text); cursor: pointer; min-width: 0; }
.onsite-devname:hover { color: var(--accent); }
.onsite-place { background: none; border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; color: var(--text-dim); padding: 3px 8px; white-space: nowrap; }
.onsite-place:hover { color: var(--accent); border-color: var(--accent); }
.onsite-remove { background: none; border: none; cursor: pointer; color: var(--text-faint);
  font-size: 12px; padding: 2px 4px; }
.onsite-remove:hover { color: #f2694f; }
.onsite-detail { border-top: 1px solid var(--border); padding-top: 14px; }
.onsite-det-h { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text); }
.onsite-det-h b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.onsite-badge { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  border: 1px solid var(--border); color: var(--text-faint); border-radius: 5px; padding: 1px 6px; }
.onsite-badge.live { color: #45c98a; border-color: rgba(69,201,138,.45); background: rgba(69,201,138,.08); }
.onsite-repoll { background: none; border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
  color: var(--text-dim); font-size: 13px; padding: 2px 8px; }
.onsite-repoll:hover { color: var(--accent); border-color: var(--accent); }
.onsite-notes { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; margin: 8px 0 0; }
.onsite-group { margin-top: 14px; }
.onsite-group-t { font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--accent); margin-bottom: 6px; }
.onsite-kv { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0;
  font-size: 12.5px; border-bottom: 1px dashed var(--border); }
.onsite-kv span { color: var(--text-dim); display: flex; align-items: center; gap: 6px; min-width: 0; }
.onsite-kv b { color: var(--text); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.svc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.svc-dot.ok { background: #45c98a; }
.svc-dot.bad { background: #f2694f; }
.onsite-snap { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: 10px; }
/* Leaflet chrome on our theme */
.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution { background: rgba(0,0,0,.45) !important; color: #cfd6e4 !important;
  font-size: 10px !important; }
.leaflet-bar a { background: var(--bg-raise) !important; color: var(--text) !important;
  border-color: var(--border) !important; }
.leaflet-bar a:hover { background: var(--bg-raise-2) !important; }
.leaflet-tooltip { background: var(--bg-raise); color: var(--text); border: 1px solid var(--border); }
.leaflet-control-layers { background: var(--bg-raise) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important; border-radius: 10px !important; }
.leaflet-control-layers-expanded { padding: 10px 14px !important; font-size: 12.5px; }
.leaflet-control-layers label { color: var(--text); }
.leaflet-control-layers-separator { border-top-color: var(--border) !important; }
@media (max-width: 800px) {
  .onsite-view { flex-direction: column; }
  .onsite-side { width: auto; border-left: none; border-top: 1px solid var(--border); max-height: 45%; }
}

/* ===== RECON & PENTEST scope bar ===== */
.pentest-bar { display: none; flex-shrink: 0; border-bottom: 1px solid var(--border);
  background: var(--bg-raise); padding: 12px 20px; }
body.pentest-active .pentest-bar { display: block; }
.pentest-bar-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 9px; }
.pentest-badge { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: #f0a94d; border: 1px solid rgba(240,169,77,.4); background: rgba(240,169,77,.09);
  border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.pentest-bar-note { font-size: 12px; color: var(--text-faint); line-height: 1.4; }
.pentest-scopelist { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; min-height: 24px; }
.pentest-empty { font-size: 12.5px; color: var(--text-faint); }
.pentest-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px;
  color: var(--text); background: var(--bg-raise-2); border: 1px solid var(--border);
  border-radius: 7px; padding: 3px 5px 3px 9px; }
.pentest-chip-x { background: none; border: none; cursor: pointer; color: var(--text-faint); font-size: 11px; padding: 0 2px; }
.pentest-chip-x:hover { color: #f2694f; }
.pentest-addrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pentest-input { flex: 1; min-width: 220px; background: var(--bg-raise-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 11px; font-family: var(--mono); font-size: 12.5px; }
.pentest-input:focus { outline: none; border-color: var(--accent); }
.pentest-ack { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; white-space: nowrap; }
/* recon approval card (propose → confirm → run) */
.pt-confirm { border: 1px solid rgba(240,169,77,.4); background: rgba(240,169,77,.05);
  border-radius: 11px; padding: 12px 14px; margin: 10px 0; }
.pt-confirm.ran { border-color: var(--border); background: var(--bg-raise); }
.pt-confirm.denied { opacity: .6; }
.pt-confirm-h { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.pt-confirm-cmd { font-family: var(--mono); font-size: 12.5px; color: var(--accent);
  background: var(--bg-raise-2); border: 1px solid var(--border); border-radius: 7px;
  padding: 8px 10px; word-break: break-all; margin-bottom: 10px; }
.pt-confirm-actions { display: flex; gap: 8px; align-items: center; }
.pt-deny { background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  color: var(--text-dim); font-size: 13px; padding: 6px 14px; }
.pt-deny:hover:not(:disabled) { color: #f2694f; border-color: #f2694f; }
.pt-approve:disabled, .pt-deny:disabled { opacity: .5; cursor: default; }
.pt-confirm-status { font-size: 12.5px; color: var(--text-dim); margin-top: 8px; }
.pt-output { font-family: var(--mono); font-size: 12px; line-height: 1.45; color: var(--text);
  background: var(--bg-raise-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin-top: 10px; max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* ===== RTL COPILOT VIEW ===== */
.rtl-view { display: none; flex: 1; overflow: hidden; }
.mode-rtl #scroller,
.mode-rtl .composer-wrap { display: none; }
.mode-rtl .rtl-view { display: flex; flex-direction: column; }
.rtl-scroll { flex: 1; overflow-y: auto; padding: 26px 22px; }
.rtl-scroll > * { max-width: 920px; margin-left: auto; margin-right: auto; }
.rtl-spec {
  width: 100%; resize: vertical; background: var(--bg-raise-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 11px; padding: 13px 15px;
  font-family: var(--font); font-size: 15px; line-height: 1.5;
}
.rtl-spec:focus { outline: none; border-color: var(--accent-2); }
.rtl-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rtl-ex {
  font-size: 12.5px; font-family: var(--mono); color: var(--text-dim);
  background: var(--bg-raise-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; cursor: pointer;
}
.rtl-ex:hover { color: var(--text); border-color: var(--accent-2); }
.rtl-result { margin-top: 18px; }
.rtl-verdict {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-radius: 12px;
  border: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap;
}
.rtl-verdict.pass { background: rgba(69,212,131,.09); border-color: rgba(69,212,131,.3); }
.rtl-verdict.fail { background: rgba(245,185,77,.09); border-color: rgba(245,185,77,.3); }
.rtl-verdict .vi { font-size: 24px; }
.rtl-verdict .vt b { display: block; font-size: 15px; }
.rtl-verdict .vt span { font-size: 13px; color: var(--text-dim); }
.rtl-badges { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.rtl-badge {
  font-family: var(--mono); font-size: 12px; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--border-strong); color: var(--text-dim); white-space: nowrap;
}
.rtl-badge.on { color: var(--ok); border-color: rgba(69,212,131,.4); background: rgba(69,212,131,.1); }
.rtl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 0; flex-wrap: wrap; }
.rtl-tab {
  background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-dim);
  cursor: pointer; padding: 8px 14px; font-size: 13px; font-family: var(--mono);
}
.rtl-tab.active { color: var(--text); border-bottom-color: var(--accent-2); }
.rtl-tab:hover { color: var(--text); }
.rtl-code {
  margin: 0; background: var(--bg); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 11px 11px; overflow: auto; max-height: 58vh;
}
.rtl-code code {
  display: block; padding: 15px 18px; white-space: pre; font-family: var(--mono);
  font-size: 12.5px; line-height: 1.6; color: var(--text);
}
.rtl-copy {
  float: right; margin: 6px; font-size: 12px; font-family: var(--mono); cursor: pointer;
  background: var(--bg-raise-2); border: 1px solid var(--border-strong); color: var(--text-dim);
  border-radius: 7px; padding: 4px 10px;
}
.rtl-copy:hover { color: var(--text); border-color: var(--accent-2); }

/* inline artifact embed in a chat message */
.artifact-embed {
  margin: 12px 0 4px; border: 1px solid var(--border-strong);
  border-radius: 14px; overflow: hidden; background: var(--bg-raise);
}
.artifact-embed-head {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg-raise-2);
}
.artifact-embed-icon { font-size: 15px; }
.artifact-embed-title { flex: 1; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artifact-embed-open {
  background: var(--accent-soft); border: 1px solid rgba(124,108,255,.3);
  color: #c9c2ff; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px;
}
.artifact-embed-open:hover { background: rgba(124,108,255,.24); }
.artifact-embed-body { position: relative; }
.artifact-iframe { width: 100%; height: 420px; border: 0; background: #fff; display: block; }
.artifact-iframe.full { height: 100%; }
.artifact-3d { width: 100%; height: 380px; position: relative; }
.artifact-3d.full { height: 100%; }
.artifact-3d canvas { display: block; border-radius: 0; }
.viewer-err { color: var(--danger); font-size: 13px; padding: 20px; text-align: center; }

/* gallery */
.artifact-gallery {
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
}
.artifact-card {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background: var(--bg-raise);
}
.artifact-card-preview { height: 180px; cursor: zoom-in; position: relative; overflow: hidden; background: #0d1017; }
.artifact-card-preview .artifact-iframe { height: 180px; pointer-events: none; }
.artifact-card-preview .artifact-3d { height: 180px; }
.artifact-card-foot { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--border); }
.artifact-card-title { flex: 1; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artifact-card-del { background: none; border: 0; color: var(--text-faint); font-size: 13px; padding: 3px 5px; border-radius: 6px; }
.artifact-card-del:hover { color: var(--danger); background: rgba(255,107,107,.1); }

/* fullscreen */
.artifact-full {
  width: 94vw; height: 90vh; background: var(--bg-raise);
  border: 1px solid var(--border-strong); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 40px 100px rgba(0,0,0,.6);
}
.artifact-full-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); background: var(--bg-raise-2);
}
.artifact-full-title { flex: 1; font-weight: 650; font-size: 14px; }
.artifact-full-body { flex: 1; position: relative; }
.artifact-full-body .artifact-iframe { width: 100%; height: 100%; }
.artifact-full-body .artifact-3d { width: 100%; height: 100%; }

/* ============ modals ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4,5,8,.65); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(620px, 100%); max-height: 86vh; overflow-y: auto;
  background: var(--bg-raise); border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 24px;
  box-shadow: 0 40px 100px rgba(0,0,0,.6);
  animation: rise .18s ease;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-head h2 { font-size: 18px; letter-spacing: -.01em; }
.modal-sub { color: var(--text-dim); font-size: 13.5px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 6px; }
.saved-note { color: var(--ok); font-size: 13px; }

.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: 14px;
  padding: 26px; text-align: center; color: var(--text-dim);
  transition: all .15s ease; cursor: pointer; margin-bottom: 14px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { font-size: 22px; margin-bottom: 6px; color: var(--accent); }
.drop-limits { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.upload-status { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.upload-status.err { color: var(--danger); }

.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px;
}
.file-icon { font-size: 18px; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 11.5px; color: var(--text-faint); }
.file-note-input {
  width: 100%; background: transparent; border: 0; outline: 0;
  color: var(--text-dim); font-size: 12px; font-family: inherit;
  border-bottom: 1px dashed transparent; padding: 1px 0;
}
.file-note-input:hover, .file-note-input:focus { border-bottom-color: var(--border-strong); }
.file-note-input::placeholder { color: var(--text-faint); font-style: italic; }
.file-del {
  background: none; border: 0; color: var(--text-faint); font-size: 14px;
  padding: 5px 7px; border-radius: 7px; flex-shrink: 0;
}
.file-del:hover { color: var(--danger); background: rgba(255,107,107,.1); }
.lib-empty { text-align: center; color: var(--text-faint); font-size: 13.5px; padding: 18px 0 8px; }

/* ============ responsive ============ */
.sidebar-backdrop { display: none; }

@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 40; height: 100%; box-shadow: 30px 0 60px rgba(0,0,0,.4); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 39;
    background: rgba(4,5,8,.6); backdrop-filter: blur(2px);
  }
  .sidebar-backdrop.hidden { display: none; }
  .msg.user .bubble { max-width: 88%; }
  .messages { padding: 18px 14px 6px; }
  .composer-wrap { padding: 8px 12px 10px; }
}
