/* ================================
   SCRIBTUM – Novaadramen Kernel (K1)
   Layout + Dark Theme Base Styles
   ================================ */

/* Global reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #0b0b0b;
  color: #f5f5f5;

  overflow: hidden;
}

/* App shell */
.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* --- SCRIBTUM watermark in the whole content column --- */

/* --- SCRIBTUM watermark in the whole content column --- */
.content-column {
  position: relative;
  z-index: 0;

  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Watermark behind everything on the right side */

.content-column::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/SCRIBTUM_LOGO.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 45%;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;

  transition: opacity 220ms ease; /* ✅ add this */
}

/* LEO mode override – uses Leo logo instead */
.content-column.content-column--leo::before {
  background-image: url("../img/LEO_LOGO.svg") !important;
  opacity: 0.35;
}

/* (optional, explicit) SCRIB mode class */
.content-column.content-column--scrib::before {
  background-image: url("../img/SCRIBTUM_LOGO.svg") !important;
  opacity: 0.15; /* ✅ keep it consistent */
}

/* ✅ Fade ONLY in Leo conversations */
.content-column--leo.has-conversation::before{
  opacity: 0;
}

/* Ensure actual UI sits above the watermark */
.main-panel,
.chat-bar {
  position: relative;
  z-index: 1;
}



/* ================================
   HEADER
   ================================ */

.app-header {
  position: relative;
  height: 84px;
  border-bottom: 1px solid #25262b;
  background: radial-gradient(circle at top left, #181818 0, #0b0b0b 55%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;              /* sits just above the border-bottom */
  height: 2px;

  background: linear-gradient(
    90deg,
    rgba(133, 9, 38, 0.1),
    rgba(163, 68, 218, 0.925),
    rgba(6, 232, 240, 0.925),
    rgba(133, 9, 38, 0.1)
  );

  opacity: 0.0;
  transform-origin: center;
  animation: header-pulse 4.4s ease-in-out infinite;
}

/* Animation for pulse line */
@keyframes header-pulse {
  0% {
    opacity: 0;
    transform: scaleX(0.2);
  }
  40% {
    opacity: 1;
    transform: scaleX(1);
  }
  70% {
    opacity: 0.7;
    transform: scaleX(0.7);
  }
  100% {
    opacity: 0;
    transform: scaleX(0.2);
  }
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-chip {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  border: 1px solid #3b3b3b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin-top: 10px;
  margin-bottom: 10px;

  
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 18px;
}

.logo-subtitle {
  font-size: 11px;
  color: #c5c5d0;
}

/* ================================
   BODY LAYOUT
   ================================ */

.app-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: 1fr;

  height: calc(100vh - 84px); 
}

/* ================================
   SIDEBAR
   ================================ */

.sidebar {
  border-right: 1px solid #25262b;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #181818;

  /* ✅ make sidebar scroll inside app, not page */
  height: 100%;
  overflow-y: auto;

  position: relative;
  top:auto;
  align-self: stretch;

  min-height: 0;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-section--bottom {
  margin-top: auto;

  position: fixed;
  left: 0;
  bottom: 12px;              /* distance from bottom of screen */
  width: 260px;              /* same as sidebar column width */
  padding: 0 14px;           /* match sidebar horizontal padding */
  z-index: 60;               /* above sidebar content */
}

.sidebar-title {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #88889a;
  margin-bottom: 20px;

  display: flex;
  align-items: center;
  gap: 6px;

}

.sidebar-title-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.sidebar-search-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #34343f;
  background-color: #111118;
  color: #f5f5f5;
  font-size: 13px;
}

.sidebar-add{
  width: 100%;
  text-align: right;
  padding: 7px 10px;
  border-radius: 6px;
  border: none;
  outline: none;
  font-size: 13px;
  cursor: pointer;
  background: transparent;
  color: #d7d7e6;
  transition: background 0.15s, color 0.15s;
}

.sidebar-item {
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  border: none;
  outline: none;
  font-size: 13px;
  cursor: pointer;
  background: transparent;
  color: #d7d7e6;
  transition: background 0.15s, color 0.15s;
  
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-item-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-item-main-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.sidebar-item:hover {
  background: #3d3d3d;
}

.sidebar-item--primary {
  background: #2d2d2d;
  color: #8d8d8d;
  font-weight: 600;
}

.sidebar-item--primary:hover {
  background: #4d4d4d;
}

.sidebar-item--active {
  background: #0b0b0b;
  
}

.sidebar-item--muted {
  color: #3d3d3d;
}

.special-btn {
  position: relative;
  border-radius: 18px;
  border: 1px solid transparent;  /* needed for gradient border trick */
  padding-inline: 14px;
  background:
    linear-gradient(#0b0b10, #0b0b10) padding-box,              /* inner fill */
    linear-gradient(135deg, #097c56, #0b6470, #580870) border-box; /* ring */
  box-shadow: 0 0 8px rgba(15, 214, 148, 0.18);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  
}

.special-btn:hover {
  background-color: #181818;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.623);
  transform: translateY(-1px);
}

.special-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 6px rgba(15, 214, 148, 0.25);
}

#leo-sidebar .sidebar-block {
  margin-left: -20px;
}

#leo-sidebar .leo-tree-project-header {
  padding-left: 3px;
  padding-right: 3px;
}

#leo-sidebar .leo-tree-project-header {
  width: 100%;
}

/* --- Mobile sidebar pill --- */
.sidebar-toggle-pill {
  display: none;              /* desktop: hidden */
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #3a3b3f;
  background: #101018;
  color: #f5f5f5;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.sidebar-toggle-pill:hover {
  background: #181824;
}

/* Backdrop for slide-in sidebar */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 60;
  display: none;
}

.sidebar-backdrop--visible {
  display: block;
}



/* ================================
   MAIN PANEL + DOCUMENT VIEW
   ================================ */

.main-panel {
  padding: 18px 20px 88px; /* extra bottom padding so content isn't hidden by fixed chat bar */
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  flex: 1;

  overflow: hidden;
}


.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: #c7c7d5;
}

.code-doc-title {
  font-size: 13px;
  font-weight: 600;
}

.code-doc-path {
  font-size: 11px;
  color: #9a9aad;
}

.btn-copy {
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid #34343f;
  background: #111118;
  color: #e3e3f0;
  font-size: 12px;
  cursor: pointer;
}

.btn-copy:hover {
  background: #191924;
}

.code-wrapper {
  flex: 1;
  min-height: 0;
  border-radius: 10px;
  background: rgba(20, 20, 20, 0.3);
  backdrop-filter: blur(3px);
  border: 1px solid #0f0f0f;

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: thin;                 /* Firefox */
  scrollbar-color: rgba(255,255,255,0.22) transparent;

}
.code-wrapper{
  background: transparent !important;
  backdrop-filter: none !important;
  border: 0 !important;
}


.code-wrapper::-webkit-scrollbar {
  width: 10px;                           /* feels like ChatGPT */
}

.code-wrapper::-webkit-scrollbar-track {
  background: transparent;               /* invisible track */
}

.code-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18); /* subtle */
  border-radius: 999px;
  border: 3px solid transparent;         /* creates padding */
  background-clip: content-box;          /* keep thumb slim */
}

.code-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
  background-clip: content-box;
}

.code-wrapper::-webkit-scrollbar-thumb:active {
  background: rgba(255, 255, 255, 0.34);
  background-clip: content-box;
}


/* 2) Optional: Sidebar scroll (same vibe) */
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 10px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
  background-clip: content-box;
}


/* 3) Optional: Notes modal list scroll */
.notes-list-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.22) transparent;
}

.notes-list-container::-webkit-scrollbar {
  width: 10px;
}

.notes-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.notes-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.notes-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
  background-clip: content-box;
}

/* Document body (rendered markdown) */

.doc-body {
  padding: 18px 20px;
  font-size: 15px;      /* slightly larger, closer to ChatGPT */
  line-height: 1.75;
  letter-spacing: 0.1px;
  color: #e8e8e8;

  overflow: visible;

}

/* Headings */
.doc-body h1 {
  font-size: 24px;
  margin: 6px 0 12px;
}
.doc-body h2 {
  font-size: 19px;
  margin: 18px 0 10px;
}
.doc-body h3 {
  font-size: 16px;
  margin: 14px 0 8px;
}

/* Paragraphs & lists */
.doc-body p {
  margin: 10px 0 12px;
}

.doc-body ul,
.doc-body ol {
  margin: 4px 0 8px 20px;
}

/* Block code container (from codehilite) */
.doc-body .codehilite {
  background: #000000;
  border-radius: 16px;
  border: 1px solid #25262b;
  overflow-x:auto;
  overflow-y: auto;
  margin: 8px 0;
}

.doc-body .codehilite pre {
  background: transparent;  /* no extra dark stripe per line */
  margin: 0;
  padding: 12px 14px;
}

.doc-body .codehilite pre code {
  font-family: "Fira Code", Consolas, Menlo, Monaco, monospace;
  font-size: 16px;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* Inline code ONLY in paragraphs and list items */
.doc-body p code,
.doc-body li code {
  font-family: "Fira Code", Consolas, Menlo, Monaco, monospace;
  font-size: 16px;
  background: #111118;
  padding: 1px 4px;
  border-radius: 4px;
}

/* ==============================
   Markdown tables (Leo + Scrib)
   ============================== */

  /* ===== Tables: make them readable + stable ===== */
  .doc-body table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 12px 0 16px;
    font-size: 14px;
  }

  /* If table is wider than container, scroll horizontally */
  .doc-body table {
    display: block;
    overflow-x: auto;
    white-space: nowrap; /* prevents weird wrapping that breaks columns */
  }

  .doc-body th,
  .doc-body td {
    padding: 10px 12px;
    border: 1px solid #25262b;
    vertical-align: top;
  }

  .doc-body th {
    font-weight: 600;
    background: #0d0d14;
    position: sticky;
    top: 0; /* header stays visible when scrolling the doc body */
    z-index: 1;
  }

  /* Allow long text to wrap nicely when we DO allow wrapping */
  .doc-body td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Code inside table cells shouldn’t force insane width */
  .doc-body td code,
  .doc-body th code {
    white-space: normal;
  }


/* ==============================
   Better separators + quotes
   ============================== */

.doc-body hr {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 16px 0;
}

.doc-body blockquote {
  margin: 10px 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  color: #e8e8e8;
}

/* Optional: tighten code line spacing a bit */
.doc-body .codehilite pre code {
  line-height: 1.45;
}

/* ================================
   BOTTOM CHAT / SEARCH BAR
   ================================ */

/* Fixed chat bar, only under main content area (260px sidebar) */
.chat-bar {
  position: fixed;
  left: 260px;       /* same as sidebar width */
  right: 0;
  bottom: 0;
  z-index: 50;
  border-top: 1px solid #25262b;
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  background: #050507;
  align-items: center;
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 1rem;
  border-radius: 18px;
  border: none;
  background: #111118;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  resize: none;           /* user can't drag corners */
  max-height: 160px;
  overflow-y: auto;       /* we'll auto-grow */
  scrollbar-width: thin;     /* Firefox */
  scrollbar-color: #3f4357 #111118;
}

/* WebKit (Chrome / Edge / etc.) */
.chat-input::-webkit-scrollbar {
  width: 6px;
}

.chat-input::-webkit-scrollbar-track {
  background: #111118;   /* same as input background */
}

.chat-input::-webkit-scrollbar-thumb {
  background: #3f4357;   /* subtle grey thumb */
  border-radius: 999px;
}

.chat-input::-webkit-scrollbar-thumb:hover {
  background: #555a70;
}

.chat-btn {
  padding: 10px 18px;
  border-radius: 18px;
  border: none;
  background: #2d2d2d;
  color: #8d8d8d;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 15px;  /* slightly larger */
}

.chat-btn:hover {
  background: #4b4b4b;
}

/* ======================================
   SYNTAX HIGHLIGHTING (VS Code–style)
   ====================================== */

/* Base text color */
.codehilite {
  color: #e8e8e8;
}

/* Comments */
.codehilite .c,
.codehilite .c1,
.codehilite .cm {
  color: #6a6a7a;
  font-style: italic;
}

/* Keywords: def, class, if, return, import, etc. */
.codehilite .k,
.codehilite .kd,
.codehilite .kn,
.codehilite .kr,
.codehilite .kp {
  color: #b94ab4; /* purple */
}

/* Builtins / types / names (generic) */
.codehilite .nb {
  color: #c3e8ff;  /* light blue for commands / builtins */
}

.codehilite .bp,
.codehilite .kt,
.codehilite .n,
.codehilite .nx,
.codehilite .nv {
  color: #e8e8e8; /* keep other names neutral */
}

/* Function names */
.codehilite .nf {
  color: #3473fc; /* light blue */
}

/* Strings */
.codehilite .s,
.codehilite .s1,
.codehilite .s2,
.codehilite .sd {
  color: #49aa62; /* green */
}

/* Escape sequences (e.g. backslashes in paths) */
.codehilite .se {
  color: #c3e88d; /* soft green */
}

/* Numbers */
.codehilite .m,
.codehilite .mi,
.codehilite .mf {
  color: #f05526; /* orange */
}

/* Operators and punctuation */
.codehilite .o,
.codehilite .ow {
  color: #5aa1bd; /* cyan */
}

/* Decorators / attributes */
.codehilite .nd,
.codehilite .na {
  color: #eca622; /* yellow-ish */
}

/* ======================================
   Bash / Shell highlighting tweaks
   ====================================== */

/* Comments: the # ... lines */
.doc-body .codehilite code[class*="bash"] .c,
.doc-body .codehilite code[class*="bash"] .c1,
.doc-body .codehilite code[class*="bash"] .cm {
  color: #6a6a7a;
  font-style: italic;
}

/* Commands + names: cd, mkdir, python, pip */
.doc-body .codehilite code[class*="bash"] .nb,
.doc-body .codehilite code[class*="bash"] .n,
.doc-body .codehilite code[class*="bash"] .nx,
.doc-body .codehilite code[class*="bash"] .nv {
  color: #c3e8ff; /* light blue */
}

/* Options / operators: -m, etc. */
.doc-body .codehilite code[class*="bash"] .o,
.doc-body .codehilite code[class*="bash"] .ow {
  color: #ffcb6b; /* yellow/orange */
}

/* Paths / strings (when lexer marks them as strings) */
.doc-body .codehilite code[class*="bash"] .s,
.doc-body .codehilite code[class*="bash"] .s1,
.doc-body .codehilite code[class*="bash"] .s2 {
  color: #c3e88d; /* green */
}


/* Leo / Scrib toggle inside chat bar */

.chat-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;

}

.chat-toggle {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px;
  border: 1px solid #303240;
  background: #050508;
  flex-shrink: 0;
}

.toggle-btn {
  border: none;
  background: transparent;
  color: #aaaacc;
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}

.toggle-btn--active {
  background: #313131;
  color: #c3f5f5;
}


/* Leo thread styling */
.leo-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 32px;
}

.chat-message {
  padding: 0.6rem 0.8rem;
  
  background: #0b0b0b;
  /*border: 1px solid #ee730f2a;*/
  margin-bottom: 1.2rem;
}

.chat-message--user {
  border-left: 3px solid #63012057;
  border-radius: 10px;
  background-color: #1a1a1a;
  margin-left: 5rem;
}

.chat-message--assistant {
  /*border-left: 3px solid #0d610263;*/
  color: rgb(232, 232, 232);
 
}

.chat-message-role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin-bottom: 0.2rem;

  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  opacity: 0.7;
}

.chat-message-role--leo {
  color: #1fbd0a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.leo-role-wave {
  display: flex;
  align-items: center;
}

.chat-message-role--user {
  color: #bbbbbb;
}

.chat-role-icon {
  width: 30px;
  height: 30px;
  display: inline-block;
  opacity: 0.45;
}

.chat-message-content {
  font-size: 0.9rem;
  white-space: pre-wrap; /* keep line breaks from LEO */
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

/* USER MESSAGE: lighter text */
.chat-message--user .chat-message-content {
  color: #676768;   /* soft light grey */
}

/* Optional: keep Leo as-is (explicit) */
.chat-message--assistant .chat-message-content {
  color: #e9edf5;   /* your current light text colour */
}

/* Make any code blocks Leo returns look like proper blocks */
.chat-message-content pre {
  margin: 0.4rem 0;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: #14141f;
  border: 0.5px solid #0e0e0d;
  
  overflow-x: auto;
  scrollbar-width: thin;     /* Firefox */
  scrollbar-color: #2f313b #111118;
}

/* Inline code style if you ever render HTML later */
.chat-message-content code {
  padding: 0.05rem 0.25rem;
  border-radius: 4px;
  background: #181824;
  font-size: 1rem;
  
}
/*
.chat-message-content.markdown-body {
  font-family: "JetBrains Mono", Consolas, Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}*/

.chat-message-content.markdown-body {
  font-family: "JetBrains Mono", Consolas, Menlo, monospace;
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: normal;
  word-break: break-word;
}
.chat-message-content.markdown-body p {
  margin: 0.6rem 0;
}


/* Keep list numbers INSIDE the bubble */
.chat-message-content.markdown-body ol,
.chat-message-content.markdown-body ul {
  margin: 0.5rem 0 0.8rem;
  padding-left: 1.4rem;          /* controls indent */
  list-style-position: inside;    /* ← this stops the “jump out” */
}

/* Optional: make ordered lists align nicer */
.chat-message-content.markdown-body ol {
  padding-left: 1.6rem;          /* a touch more for 10+, 11+ */
}

/* Keep li clean (don’t push sideways) */
.chat-message-content.markdown-body li {
  margin: 0.22rem 0;
}

/* If your renderer wraps li text in <p> */
.chat-message-content.markdown-body li p {
  margin: 0.2rem 0;
}

.chat-message-content.markdown-body li > p {
  display: inline;
  margin: 0;
}

.chat-message-content.markdown-body li > p > strong,
.chat-message-content.markdown-body li > p > em {
  display: inline;
}

.chat-message-content.markdown-body li:has(> p:empty) {
  display: none;
}

/* Inline code inside list items: spacing + wrapping */
.chat-message-content.markdown-body li code, 
.chat-message-content.markdown-body p code
{
  padding: 0.08rem 0.35rem;
  border-radius: 6px;
  color: #069db8;
  font-size: 0.95em;
  white-space: nowrap;       /* keeps sqlite:///example.db together */
  display: inline-block;     /* stops awkward line-break rendering */
  vertical-align: baseline;
}


/* Normal emphasis */
.chat-message-content.markdown-body em {
  font-style: italic;
  color: #b9e2e7;
  font-weight: 900;
  opacity: 0.92;
}

/* Nested emphasis: <em><em> ... </em></em> */
.chat-message-content.markdown-body em em {
  font-style: italic;
  color: #85d9e4;
  font-weight: 900;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chat-message-content.markdown-body strong em,
.chat-message-content.markdown-body em strong {
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* Headings: consistent left edge */
.chat-message-content.markdown-body h2 {
  margin: 1.0rem 0 0.4rem;
  font-size: 1.2rem;
  opacity: 0.95;
}

.chat-message-content.markdown-body h3 {
  margin: 0.75rem 0 0.3rem;
  font-size: 1.05rem;
  opacity: 0.92;
}

/* Paragraph rhythm */
.chat-message-content.markdown-body p {
  margin: 0.45rem 0;
  opacity: 0.85;
}

/* Tighten first paragraph after headings */
.chat-message-content.markdown-body h2 + p,
.chat-message-content.markdown-body h3 + p {
  margin-top: 0.25rem;
}

/* Lists: control indentation properly (not via li margins) */
.chat-message-content.markdown-body ol,
.chat-message-content.markdown-body ul {
  margin: 0.5rem 0 0.8rem 1.25rem;
  padding: 0;
}

.chat-message-content.markdown-body li {
  margin: 0.22rem 0;
  opacity: 0.85;
}

/* If markdown renderer wraps li text in <p> */
.chat-message-content.markdown-body li p {
  margin: 0.2rem 0;
}

/* Optional: make marker look cleaner */
.chat-message-content.markdown-body li::marker {
  font-weight: 700;
  opacity: 0.75;
}


.chat-message-content.markdown-body code {
  font-family: inherit;
   white-space: pre;
}

.chat-message-content.markdown-body li::marker {
  font-weight: 700;
  font-size: 0.95em;
  opacity: 0.85;
}

.chat-message-content.markdown-body ul li::marker {
  font-size: 0.9em;
  opacity: 0.8;
}

.chat-message-content.markdown-body ol li::marker {
  font-weight: 700;
  opacity: 0.85;
}

/* Allow fenced code blocks from markdown to use your existing .codehilite theme */
.chat-message-content.markdown-body pre,
.chat-message-content.markdown-body .codehilite {
  background: #000000;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
   white-space: pre;
}

/* Sidebar lists */
.sidebar-block {
  margin-top: 0.5rem;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-list-item {
  margin-bottom: 0.25rem;
}

.sidebar-item--action {
  width: 100%;
  text-align: right;

}

.sidebar-subtitle {
  margin-top: 1.25rem;
  font-size: 1rem;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 15px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  
}

.sidebar-hint {
  font-size: 0.8rem;
  opacity: 0.75;
  line-height: 1.4;
}


/* Tree layout */
.leo-tree-project { margin-bottom: 10px; }


.leo-tree-project-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
}

.leo-tree-project-left{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* container that holds + and … */
.leo-tree-actions{
  display: flex;
  align-items: center;
  gap: 3px;
  flex:0 0 auto;
  margin-left: auto;
}

.leo-tree-actions .mini-icon-btn {
  margin-left: 1px;
}

.leo-tree-conversations {
  margin-top: 6px;
  margin-left: 5px;   /* indentation */
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leo-tree-convo-item {
  padding: 7px 10px;
  border-radius: 10px;
}

.leo-tree-convo-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.leo-tree-convo-row .sidebar-item{
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.leo-tree-toggle{
  background: transparent;
  color: #929292;
  border: 0;
  cursor: pointer;
  opacity: .85;
  font-size: 25px;
  line-height: 1;
}

.leo-tree-children{
  margin-left: 18px;
  margin-top: 6px;
}

.leo-tree-convos .sidebar-item{
  font-size: 13px;
  opacity: .95;
}

.mini-icon-btn{
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: .85;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mini-icon-btn:hover{
  opacity: 1;
  background: rgba(255,255,255,.08);
}



.kebab-wrap { position: relative; display: inline-block; }

.kebab-btn { font-size: 18px; padding: 2px 8px; }

.kebab-menu{
  position: absolute;
  right: 0;
  top: 26px;
  min-width: 140px;
  background: #0b0909;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 6px;
  z-index: 999;
  box-shadow: 0 12px 28px rgba(0,0,0,.55);
}

.menu-hidden{ display: none; }

.kebab-item{
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #fffefe;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.kebab-item:hover{ background: rgba(255,255,255,.08); }

.kebab-item--danger{ color: #ff5a6b; }

.leobug-report-row { display: flex; gap: 8px; align-items: center; }
.leobug-report-row .leotm-project-item { flex: 1; }


/* --- SCRIBTASKS MODAL --- */

.notes-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notes-modal--hidden {
  display: none;
}

.notes-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
}

.notes-modal-dialog {
  position: relative;
  z-index: 1;
  width: 420px;
  max-width: 95vw;
  max-height: 90vh;
  background: #111116;
  border-radius: 18px;
  border: 1px solid #383838;
  padding: 20px 24px 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
}

/* Header */

.notes-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.notes-modal-title {
  font-size: 1.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0;
}

.notes-close-btn {
  border: none;
  background: transparent;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 99px;
}

.notes-close-btn:hover {
  background: #252525;
  color: #eee;
}

/* Panel content */

.notes-panel {
  margin: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.notes-input {
  width: 100%;
  resize: vertical;
  min-height: 80px;
  max-height: 180px;
  border-radius: 12px;
  border: 1px solid #444;
  background: #181820;
  color: #f0f0f0;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.notes-input::placeholder {
  color: #777;
}

.notes-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.notes-add-btn,
.notes-refresh-btn,
.notes-export-btn {
  flex: 1;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #3a3a3a;
  font-size: 0.85rem;
  cursor: pointer;
  background: #181820;
  color: #d0d0d0;
}

.notes-add-btn {
  border-color: #11a94d;
  color: #11e35c;
}

.notes-add-btn:hover {
  background: #12351e;
}

.notes-refresh-btn:hover,
.notes-export-btn:hover {
  background: #23232b;
}

.notes-separator {
  border: none;
  border-top: 1px solid #333;
  margin: 12px 0 10px;
}

/* Notes list */

.notes-list-container {
  max-height: 260px;
  overflow-y: auto;
}

.notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notes-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #222;
}

.notes-list-item:last-child {
  border-bottom: none;
}

.notes-list-item-left {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.notes-checkbox {
  margin-top: 3px;
}

.notes-list-item-text {
  font-size: 0.9rem;
  line-height: 1.3;
  max-height: 4.5rem;
  overflow: hidden;
  display: -webkit-box;
  /*-webkit-line-clamp: 3;
  -webkit-box-orient: vertical;*/
}

.notes-delete-btn {
  border: none;
  background: transparent;
  color: #ff4b4b;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
}

.notes-delete-btn:hover {
  color: #ff7b7b;
}

.sidebar-item-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-icon-btn {
  background: transparent;
  color: #d6d6d6;
  border: none;
  font-size: 1rem;
  padding: 0 4px;
  cursor: pointer;
  opacity: 0.6;
}

.mini-icon-btn:hover {
  opacity: 1;
}

.mini-icon-btn--danger {
  color: #ff5c5c;
}

/* ============================
   Neon Confirm Modal – Novaadramen
   ============================ */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(15,214,148,0.16), transparent 55%),
              radial-gradient(circle at bottom right, rgba(168,15,214,0.18), transparent 55%),
              rgba(0,0,0,0.78);
  display: none;              /* toggled via JS */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(8px);
}

.confirm-overlay--visible {
  display: flex;
}

.confirm-dialog {
  position: relative;
  max-width: 420px;
  width: 90%;
  border-radius: 18px;
  padding: 2px; /* for outer glow border */
  background:
    linear-gradient(135deg, #0fd694, #1197a9 40%, #a80fd6 100%);
  box-shadow:
    0 0 25px rgba(15,214,148,0.45),
    0 0 40px rgba(168,15,214,0.55);
}

.confirm-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  filter: blur(16px);
  opacity: 0.35;
  pointer-events: none;
}

.confirm-inner {
  position: relative;
  border-radius: 16px;
  background: #050509;
  padding: 20px 22px 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.confirm-title {
  font-size: 1.0rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fdfdfd;
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #d2d2df;
  margin-bottom: 18px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-btn {
  min-width: 88px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease-out;
}

.confirm-btn--primary {
  background: radial-gradient(circle at top left, #0fd694, #1197a9 40%, #a80fd6 100%);
  color: #050509;
  font-weight: 600;
  box-shadow:
    0 0 8px rgba(15,214,148,0.6),
    0 0 16px rgba(168,15,214,0.6);
}

.confirm-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 10px rgba(15,214,148,0.75),
    0 0 22px rgba(168,15,214,0.9);
}

.confirm-btn--ghost {
  background: #101018;
  color: #d7d7e6;
  border-color: rgba(255,255,255,0.12);
}

.confirm-btn--ghost:hover {
  background: #171722;
}

/* Neon prompt input (shares the confirm dialog shell) */
.prompt-input {
  width: 100%;
  margin: 10px 0 16px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: #080813;
  color: #f5f5ff;
  font-size: 0.9rem;
  outline: none;
}

.prompt-input:focus {
  border-color: #0fd694;
  box-shadow: 0 0 0 1px rgba(15,214,148,0.4);
}

/* -------- SCRIB file tree ---------- */

.scrib-tree {
  margin-top: 0.5rem;
  padding: 6px 4px;
  border-top: 1px solid #23242b;

  border: 1px dashed #53545f;
  border-radius: 6px;
  background: #111117;

  max-height: calc(100vh - 220px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #282829 #111118;
}

.scrib-tree ul,
.scrib-tree li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.scrib-tree-root,
.scrib-tree-children {
  padding-left: 0;   /* no extra offset from UL itself */
}

.scrib-node {
  margin-bottom: 2px;
}

/* row layout */
.scrib-node-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
}

/* toggle arrow / bullet */
.scrib-node-toggle {
  flex-shrink: 0;
  width: 14px;
  text-align: center;
  opacity: 0.7;
  font-size: 0.7rem;
}

/* label base */
.scrib-node-label {
  flex: 1;
  background: transparent;
  border: none;
  color: #d7d7e6;
  text-align: left;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
}

/* -------- Folder / dir nodes (purple bars + inner box) -------- */

/* folder bar */
.scrib-node--dir > .scrib-node-row {
  background: #000000;          /* purple header */
  color: #f9f9ff;
  border-radius: 4px;
  margin-top: 4px;
}

/* folder label text */
.scrib-node--dir > .scrib-node-row .scrib-node-label {
  color: #ffffff;
  font-weight: 600;
}

/* dark box around a folder's children */
.scrib-node--dir > .scrib-tree-children {
  margin: 2px 0 6px 0;
  padding: 6px 8px;
  border-radius: 4px;
  background: #202127;
  border: 1px solid #d6d6df;
}

/* -------- File nodes -------- */

.scrib-node--file > .scrib-node-row .scrib-node-label {
  font-weight: 400;
  opacity: 0.9;
}

/* hover only on files (lines in the box) */
.scrib-node--file .scrib-node-row:hover .scrib-node-label {
  background: #505050;
}

/* active file (if you set scrib-node--active via JS) */
.scrib-node--active > .scrib-node-row .scrib-node-label {
  background: #0a0a0a;
  border-left: 3px solid #0e0e0e;
}

/* Container box around a folder's children */
.scrib-node--dir > .scrib-tree-children {
  margin: 2px 0 6px 0;
  padding: 6px 8px;
  border-radius: 4px;
  background: #0f0f0f;          /* inner dark box */
  border: 1px solid #161616;
}

.scrib-tree-root > .scrib-node--dir > .scrib-tree-children > .scrib-node--dir > .scrib-node-row {
  background: #22232c;           /* softer dark bar */
  color: #f2f2ff;
  margin-top: 3px;
}

/* Label inside those sub-book rows */
.scrib-tree-root > .scrib-node--dir > .scrib-tree-children > .scrib-node--dir > .scrib-node-row .scrib-node-label {
  color: #f8f8ff;
  font-weight: 500;              /* slightly lighter than top-level */
}

/* === Leo Focus Dropdown (custom) === */

.focus-select-hidden {
  display: none;
}

/* Container aligns in chat bar row */
.focus-dropdown {
  position: relative;
  margin-left: 0.5rem;
  align-self: center;
}

/* The pill button */
.focus-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;

  padding: 0.3rem 0.9rem;
  border-radius: 999px;

  border: 1px solid #3a3b3f;
  background-color: rgba(10, 10, 14, 0.4); /* ~40% dark transparent */
  color: #f5f5f5;

  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
  outline: none;

  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.focus-trigger:hover,
.focus-trigger:focus-visible {
  border-color: #969696;
  background-color: rgba(18, 20, 26, 0.7);
}

/* Down caret icon */
.focus-caret {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* Dropdown menu panel */
.focus-menu {
  position: absolute;
  right: 0;

  /* instead of top:100% + margin-top */
  bottom: 100%;
  top: auto;
  margin-bottom: 0.25rem;
  margin-top: 0;

  list-style: none;
  padding: 0.25rem 0;
  margin: 0;

  min-width: 160px;
  max-height: 260px;             /* safety so it doesn’t go off top */
  overflow-y: auto;

  border-radius: 0.5rem;
  border: 1px solid #3a3b3f;

  background-color: rgba(8, 9, 12, 0.92);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 40;
}

/* Individual options */
.focus-menu li {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  color: #e5e5e5;
  cursor: pointer;
  white-space: nowrap;

  transition: background-color 0.12s ease, color 0.12s ease;
}

.focus-menu li:hover {
  background-color: rgba(33, 43, 68, 0.9);
  color: #ffffff;
}

/* Selected / active option */
.focus-menu li.active {
  background-color: rgba(55, 65, 95, 0.95);
  color: #ffffff;
  font-weight: 600;
}

/* === Leo "thinking" loader === 

.leo-thinking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(10, 10, 16, 0.7);
  border: 1px solid #262732;
  font-size: 13px;
  color: #c7c7d5;
  width: auto;
}

.leo-thinking-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  animation: leo-neon-pulse 1.6s ease-in-out infinite;
}

.leo-thinking-text {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* animated dots after the text 
.leo-thinking-dots::after {
  content: "...";
  display: inline-block;
  animation: leo-dots 1s steps(4, end) infinite;
}

/* subtle breathing effect on the logo 
@keyframes leo-neon-pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
    box-shadow:
      0 0 4px rgba(18, 70, 228, 0.555),
      0 0 10px rgba(170, 9, 219, 0.479);
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
    box-shadow:
      0 0 8px rgba(79, 220, 255, 0.9),
      0 0 18px rgba(141, 16, 250, 0.7);
  }
  100% {
    transform: scale(1);
    opacity: 0.7;
    box-shadow:
      0 0 4px rgba(79, 255, 94, 0.4),
      0 0 10px rgba(196, 7, 155, 0.452);
  }
}
*/

/* === Leo "thinking" loader – neon waveform === */

.leo-thinking {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #c7c7d5;
  margin: 12px 0;
}

.leo-thinking-label {
  white-space: nowrap;
  opacity: 0.9;
}

/* Waveform container */
.leo-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

/* Single bar */
.leo-wave-bar {
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #0fd6d6, #a80fd6);
  opacity: 0.85;
  transform-origin: bottom center;
  animation: leo-wave 1s ease-in-out infinite;
}

/* Different base heights + delays for organic feel */
.leo-wave-bar--1 { height: 6px;  animation-delay: 0s; }
.leo-wave-bar--2 { height: 10px; animation-delay: 0.12s; }
.leo-wave-bar--3 { height: 14px; animation-delay: 0.24s; }
.leo-wave-bar--4 { height: 10px; animation-delay: 0.36s; }
.leo-wave-bar--5 { height: 8px;  animation-delay: 0.48s; }

@keyframes leo-wave {
  0%, 100% {
    transform: scaleY(0.5);
    opacity: 0.6;
  }
  50% {
    transform: scaleY(1.1);
    opacity: 1;
  }
}

/* Full screen dark background, centering the content */
.login-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center; /* Vertically center */
    justify-content: center; /* Horizontally center */
    background: radial-gradient(circle at top, #151521 0%, #050509 100%);
    color: #f5f5f5;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* Wrapper to constrain the width of the login form */
.login-wrap {
    width: 100%;
    max-width: 320px; /* Adjusted to fit the centered, narrower form look */
    padding: 16px;
    display: flex; /* Helps center the logo/form group */
    flex-direction: column;
    align-items: center;
    text-align: center; /* Centers the logo image */
    margin-top: 40px;
}

/* Form Styling - No card background, just centered elements */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Increased gap for spacing between elements */
    width: 100%;
    align-items: center;
}

/* Logo Styling */
.login-logo-block {
    margin-bottom: 40px; /* Space between logo and first input field */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo-image {
    width: 150px; /* Adjust size of logo */
    height: auto;
    margin-bottom: -25px;
}

/* Input Field Container - for the icon and the input */
.login-field {
    width: 100%;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #555; /* The essential bottom line */
    padding-bottom: 8px; /* Space between input and the line */
}

/* Icon next to the input */
.login-icon {
    width: 24px;
    height: 24px;
    margin-right:24px;
    /* Use a simple email and lock icon image with a light color */
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(360deg) brightness(100%) contrast(100%); 
    opacity: 0.;
}

/* Input Styles - must be transparent/borderless except for the bottom line */
.login-input {
    flex-grow: 1; /* Take up the rest of the space */
    padding: 0;
    border: none; /* Remove all borders */
    background: transparent; /* Remove background */
    color: #f5f5f5;
    font-size: 1rem;
    height: 30px; /* Consistent height for alignment */
}

.login-input:focus {
    outline: none;
    /* You can add a focus effect to the bottom border in the .login-field if desired */
}

/* Placeholder color adjustment for the dark theme */
.login-input::placeholder {
    color: #4d4d4d;
    opacity: 1;
}

/* Login Button Styling (Boxed, ghost effect) */
.login-btn {
    margin-top: 20px;
    width: 100px; /* Set a specific width for the button */
    padding: 8px 15px;
    background: transparent;
    color: #f5f5f5;
    border: 1px solid #f5f5f5; /* Light border for the ghost look */
    border-radius: 10px;
    font-size: 0.85rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.login-btn:hover {
    background: rgba(245, 245, 245, 0.1);
    border-color: #4fbeff; /* Subtle neon hover effect */
    color: #4fb9ff;
}

/* For the icons, you will need two small white/light-colored SVG images named:
* `icon_email.svg` (for the envelope)
* `icon_lock.svg` (for the padlock)
* ...and place them in `static/img/`
*/


/*--------Logout---------------------*/

.topbar-link {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.topbar-link--danger {
  color: #ffb3c0;
  border-color: rgba(255, 80, 120, 0.4);
  background: rgba(60, 5, 15, 0.65);
}

.topbar-link--danger:hover {
  border-color: rgba(255, 120, 150, 0.9);
  background: rgba(80, 10, 24, 0.95);
}


.topbar-link {
    /* This is the key line */
    text-decoration: none; 
}


/*------------------EDITOR IN SCRIB.MD---------------------*/

.editor-select {
  min-width: 220px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #323240;
  background: #10101a;
  color: #f5f5f5;
  font-size: 0.8rem;
}

.editor-select:focus {
  outline: none;
  border-color: #818181;
}

.editor-btn--secondary {
  background: #22222c;
  border: 1px solid #363646;
}

.editor-btn--secondary:hover {
  background: #2d2d39;
}
.new-doc-panel {
  background: #101018;
  border: 1px solid #2a2a36;
  padding: 12px;
  border-radius: 6px;
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

/* ===== SCRIB Viewer: safe scrolling ===== */
body.scrib-viewer .app-shell{
  height: 100vh;
  overflow: hidden;
}

body.scrib-viewer .app-body{
  height: calc(100vh - 74px); /* header height */
  overflow: hidden;
}

body.scrib-viewer .content-column{
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

body.scrib-viewer .doc-panel{
  flex: 1 1 auto;
  min-height: 0;        /* CRITICAL: enables flex child scrolling */
  display: flex;
  flex-direction: column;
}

body.scrib-viewer .doc-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;     /* the scroll happens here */
  scrollbar-width: thin;                          /* Firefox */
  scrollbar-color: rgba(255,255,255,.22) transparent;
}

/* WebKit (Chrome/Edge/Safari) */
body.scrib-viewer .doc-body::-webkit-scrollbar{
  width: 10px;
}

body.scrib-viewer .doc-body::-webkit-scrollbar-track{
  background: transparent;
}

body.scrib-viewer .doc-body::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.16);
  border-radius: 12px;
  border: 2px solid transparent;  /* creates inner padding look */
  background-clip: content-box;
}

body.scrib-viewer .doc-body::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.26);
  background-clip: content-box;
}

body.scrib-viewer .doc-body::-webkit-scrollbar-corner{
  background: transparent;
}

/* -------- Leo source pills -------- */

.leo-sources-row {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #25262f;

  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  font-size: 0.75rem;
}

.leo-sources-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: #8e8f9a;
  opacity: 0.9;
  margin-right: 4px;
}

.leo-source-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;

  background: radial-gradient(circle at top, #14141c 0, #08080d 60%);
  border: 1px solid rgba(0, 0, 0, 0.7);
  color: #f5f5ff;
  text-decoration: none;
  cursor: pointer;

  transition:
    background 0.18s ease-out,
    border-color 0.18s ease-out,
    box-shadow 0.18s ease-out,
    transform 0.12s ease-out;
  font-size: 0.72rem;
  max-width: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leo-pill-chunks{
  margin-right: 8px;
  opacity: 0.65;
  font-size: 0.82em;
}


.leo-source-pill::after {
  content: "↗";
  font-size: 0.7rem;
  margin-left: 6px;
  opacity: 0.7;
}

.leo-source-pill:hover {
  background: radial-gradient(circle at top, #1e1e2a 0, #0b0b12 65%);
  border-color: rgba(46, 46, 46, 0.9);
  box-shadow:
    0 0 0 1px rgba(54, 54, 54, 0.4),
    0 0 14px rgba(7, 7, 7, 0.35);
  transform: translateY(-1px);
}

.leo-source-pill:active {
  transform: translateY(0);
  box-shadow:
    0 0 0 1px rgba(53, 53, 53, 0.35),
    0 0 8px rgba(92, 92, 92, 0.25);
}


/* =========================
   Mobile tweaks (<= 768px)
   ========================= */
@media (max-width: 768px){

  body.scrib-viewer .doc-title{
    font-size: 1.25rem;
    line-height: 1.15;
  }

  /* --- Viewer layout: avoid 100vh traps on mobile --- */
  body.scrib-viewer .app-shell{
    height: 100dvh;          /* modern mobile-safe viewport */
    overflow: hidden;
  }

  body.scrib-viewer .app-body{
    height: calc(100dvh - 74px);
    overflow: hidden;
  }

  /* fallback for browsers without dvh */
  @supports not (height: 100dvh){
    body.scrib-viewer .app-shell{ height: 100vh; }
    body.scrib-viewer .app-body{ height: calc(100vh - 74px); }
  }

  /* Make scrolling feel nicer on touch */
  body.scrib-viewer .doc-body{
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px;   /* avoids last line hiding behind UI */
  }

  /* --- Scrollbar: thinner on mobile (less visual noise) --- */
  body.scrib-viewer .doc-body::-webkit-scrollbar{
    width: 6px;
  }

  /* --- Source pills: mobile friendly --- */
  .leo-sources-row{
    font-size: 0.72rem;
    gap: 6px;
  }

  .leo-sources-label{
    width: 100%;
    margin-right: 0;
    margin-bottom: 2px;
  }

  .leo-source-pill{
    max-width: 100%;          /* stop overflow */
    flex: 1 1 auto;           /* allow wrap sizing */
    padding: 6px 10px;        /* better tap target */
    font-size: 0.74rem;
  }

  

  /* If you want “one pill per line” on very small screens */
  @media (max-width: 420px){
    .leo-source-pill{
      width: 100%;
      justify-content: space-between;
    }
    .leo-pill-chunks{
      margin-right: 10px;
    }
  }
}

@media (max-width: 768px){
  .logout{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between; /* left + right */
    gap: 10px;
    margin-top: 8px;               /* optional: space under logo */
  }

  .logout .topbar-link{
    align-self: auto;              /* overrides your flex-end */
    white-space: nowrap;
  }
}


/* ==========================================
   LEO — Stream UX (Clean)
   Option 01: Pulse + Soft Reveal (no typewriter)
   ========================================== */

/* TRACE: ghost “internal prompt” look */
.leo-trace{
  display: none;
  margin: 10px 0 8px;
  padding: 8px 0 6px;

  border: none;
  border-radius: 0;
  background: transparent;

  font-size: 12px;
  line-height: 1.55;
  opacity: 0.72;
}

.leo-trace-title{
  display: none;
}

.leo-trace-lines{
  margin: 0;
  padding: 0;
}

/* soft separator line (your vibe) */
.leo-trace::before{
  content: "";
  display: block;
  height: 1px;
  margin-bottom: 8px;
  background: linear-gradient(90deg,
    rgba(4, 243, 163, 0.664),
    rgba(158, 3, 247, 0.582),
    rgba(6, 211, 247, 0.705)
  );
  opacity: 0.65;
}

/* trace line: fade + tiny slide + “wipe reveal” */
.leo-trace-line{
  margin: 2px 0;
  opacity: 0.92;

  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  letter-spacing: 0.01em;

  position: relative;
  overflow: hidden;

  animation: leoTraceIn 160ms ease-out;
}

@keyframes leoTraceIn{
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 0.92; transform: translateY(0); }
}

/* wipe overlay to simulate “written” feel (cheap-mode) */
.leo-trace-line::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(0,0,0,0.55),
    rgba(0,0,0,0.20),
    rgba(0,0,0,0.00)
  );
  transform: translateX(-110%);
  animation: leoTraceWipe 260ms ease-out;
  pointer-events: none;
}

@keyframes leoTraceWipe{
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(110%); }
}

/* collapsed summary */
.leo-trace-collapsed{
  opacity: 0.82;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
}

.leo-trace--collapsed{
  padding: 4px 0 0;
  margin: 6px 0 4px;
}

/* STATUS: pulse + shimmer scan */
.leo-status{
  margin-top: 6px;
  opacity: 0.95;

  /* subtle breathing glow for the whole status row */
  animation: leoPulse 1.25s ease-in-out infinite;
  transform-origin: left center;
}

@keyframes leoPulse{
  0%, 100% { opacity: 0.78; }
  50%      { opacity: 1.0; }
}

.leo-status-text{
  position: relative;
  display: inline-block;
  opacity: 0.92;
}

/* shimmer scan on the status text */
.leo-status-text::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(71, 71, 71, 0.377) 50%,
    transparent 100%
  );
  transform: translateX(-120%);
  animation: leoStatusScan 1.35s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

@keyframes leoStatusScan{
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.leo-status-stack{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-left:6px;
}

.leo-status-line{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  font-size:12px;
  opacity:0.92;
}

/*-------------------------Forgot Password-------------------------------------*/

.password-inner {
  display: flex;
  align-items: center;
  width: 100%;
}

.password-toggle-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #a0a0b8;
}

.password-toggle-btn:hover {
  color: #ffffff;
}

.password-eye-icon {
  width: 18px;
  height: 18px;
  pointer-events: none;
}


.forgot-password-row {
  margin-top: 6px;
  text-align: right;
  font-size: 0.9rem;
 }
.forgot-password-link {
  color: #575757;
  text-decoration: none;
 }
.forgot-password-link:hover {
  color: rgb(175, 8, 8);
  text-decoration: underline;
  
 }
/* -------------------------
   LED Wallboard (Dot Matrix)
--------------------------*/
.leo-led{
  display: inline-flex;
  align-items: center;
}

.leo-led__frame{
  width: 420px;                 /* adjust */
  height: 34px;                 /* adjust */
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: radial-gradient(circle at 20% 20%, rgba(179, 0, 255, 0), rgba(0, 0, 0, 0) 60%),
              rgba(0, 0, 0, 0);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
  overflow: hidden;
  position: relative;
  padding: 0 10px;
}

/* subtle “LED grid” texture */
.leo-led__frame::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: 0.45;
  pointer-events:none;
}

/* vignette edges */
.leo-led__frame::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0) 18%,
    rgba(0, 0, 0, 0) 82%,
    rgba(0, 0, 0, 0)
  );
  pointer-events:none;
}

.leo-led__track{
  position: relative;
  height: 100%;
  display:flex;
  align-items:center;
  overflow:hidden;
}

.leo-led__text{
  display:inline-block;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 300;
  letter-spacing: 2px;
  font-size: 12px;
  color: rgba(167, 11, 11, 0.95);           /* LED red */
  text-shadow:
    0 0 6px rgba(255,60,60,0.65),
    0 0 16px rgba(255,60,60,0.35);
  /* scrolling */
  animation: leo-led-scroll 34s linear infinite;
  position: relative;
  z-index: 1;
}

/* Make the text look dot-matrix (lighter mask = clearer letters) */
.leo-led__text{
  -webkit-mask-image: radial-gradient(circle, #000 62%, transparent 66%);
  -webkit-mask-size: 3px 3px;
  -webkit-mask-repeat: repeat;

  mask-image: radial-gradient(circle, #000 62%, transparent 66%);
  mask-size: 2px 2px;
  mask-repeat: repeat;
}


@keyframes leo-led-scroll{
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Responsive: shrink width on small screens */
@media (max-width: 600px){
  .leo-led__frame{ width: 260px; }
  .leo-led__text{ font-size: 14px; }
}

 /* --- Login footer: Novaadramen product tag --- */
.login-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.75rem;
  color: #8c8c98;
  opacity: 0.9;
  margin-bottom: 25px;
}

.login-footer-logo {
  width: 200px;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
  margin-right: 40px;
}

.login-footer-text {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  line-height: 1.3;
}

.login-footer-brand {
  font-weight: 600;
}

.login-footer-release {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* Body = column: main + footer */
.login-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #151521 0%, #050509 100%);
  color: #f5f5f5;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* Center login vertically + horizontally */
.login-main {
  flex: 1;                           /* take all free height */
  display: flex;
  align-items: center;               /* vertical center */
  justify-content: center;           /* horizontal center */
}

.login-wrap {
  width: 100%;
  max-width: 320px;                  /* or 360 if you want wider form */
  padding: 16px;
}

/* Footer stays at bottom automatically now */
.login-footer {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #8c8c98;
  opacity: 0.9;
}

.leo-status { margin-top: 8px; font-size: 12px; opacity: 0.7; }

.leo-dot{
  display:inline-block;
  width:9px;
  height:9px;
  border-radius:50%;
  margin-right:8px;
  vertical-align:middle;
  box-shadow: 0 0 10px rgba(255,255,255,0.12);
}

.leo-dot--grounded{ background:#019e43a4; } /* green */
.leo-dot--related{  background:#ecc00d98; } /* yellow */
.leo-dot--generic{  background:#8a0e009f; } /* red */
.leo-dot--unknown{  background:#03deeebe; } /* grey */

.leo-pill-label{ margin-right:8px; }
.leo-pill-score{
  opacity:0.75;
  font-size:0.85em;
}


/* Ensure column can host absolute bg */
.content-column{
  position: relative;
}



/* =========================================
   MOBILE – CHATGPT-STYLE + SLIDE-IN SIDEBAR
   ========================================= */
@media (max-width: 768px) {

  /* Base text */
  html,
  body {
    font-size: 16px;
    line-height: 1.5;
  }

  /* One-column grid (sidebar is overlay, not a column) */
  .app-body {
    grid-template-columns: 1fr;
  }

  /* Sidebar pill in header */
  .sidebar-toggle-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Slide-in sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 80%;
    max-width: 320px;
    z-index: 70;

    background: #181818;
    padding: 10px 10px;
    border-right: 1px solid #25262b;

    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;

    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
  }

  .sidebar.sidebar--open {
    transform: translateX(0);
  }

  .sidebar-section--bottom {
    position: static;
    width: 100%;
    padding: 0;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .sidebar-item,
  .special-btn {
    width: 100%;
    justify-content: center;
  }

  /* Content: leave room for fixed chat bar */
  .content-column {
    width: 100%;
    padding: 8px 8px 160px;
    box-sizing: border-box;
  }

  .main-panel {
    padding: 12px 8px 40px;
  }

  .code-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .code-doc-title {
    font-size: 1rem;
  }

  .code-doc-path {
    font-size: 0.75rem;
  }

  .doc-body {
    padding: 18px 20px 80px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e8e8e8;
  }

  /* Chat bar: full-width, stacked like ChatGPT */
  .chat-bar {
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px 10px;
    border-top: 1px solid #25262b;
    background: rgba(5, 5, 9, 0.96);
    backdrop-filter: blur(10px);

    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
  }

  .chat-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .chat-toggle {
    align-self: center;
  }

  .toggle-btn {
    font-size: 0.8rem;
    padding: 4px 10px;
  }

  .chat-input {
    width: 100%;
    min-height: 60px;
    max-height: 120px;
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .focus-dropdown {
    align-self: flex-end;
    margin-left: 0;
  }

  .focus-trigger {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  .chat-message-content {
    font-size: 0.95rem;
  }

  .app-header {
    align-items: center;
    height: auto;
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 6px;
  }

  /* Logo centered */
  .logo-block {
    flex-basis: 100%;
    justify-content: center;
  }

  /* Pill becomes a main chip under logo */
  .sidebar-toggle-pill {
    align-self: center;
    margin-top: 2px;
  }

  /* Logout sits on the right edge under everything */
  .topbar-link {
    align-self: flex-end;
    margin-left: auto;
  }

  .logo-chip {
    width: 62px;               /* bigger logo on mobile */
    height: 62px;
    margin-top: 4px;           /* tighter vertical margins */
    margin-bottom: 2px;
  }

  .logo-title {
    font-size: 22px;           /* was 18px on desktop */
  }

  .logo-subtitle {
    font-size: 12px;           /* was 11px */
  }

}


/* ================================
   LEO TASK MANAGER (LeoTM)
   Keep consistent with Scribtum UI
   ================================ */

.leotm-body {
  background: radial-gradient(circle at top, #151521 0%, #050509 100%);
  color: #f5f5f5;
}

/* Two-column layout */
.leotm-grid{
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  padding: 18px;
}

/* Left panel */
.leotm-left{
  background: #181818;
  border: 1px solid #25262b;
  border-radius: 14px;
  padding: 14px;
  display:flex;
  flex-direction: column;
  min-height: 0;

  position: relative; 
  z-index: 4;
  overflow: visible;
}

.leotm-left-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.leotm-left-title{
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #d7d7e6;
  opacity: 0.9;
}

.leotm-btn-plus{
  border-radius: 10px; /* uses existing .btn-copy base */
  min-width: 38px;
  height: 32px;
  padding: 0;

  position: relative; 
  z-index: 5;
}

.leotm-project-list{
  display:flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
  overflow: visible;
}

/* Project item */
.leotm-project-item{
  justify-content: space-between;
}

.leotm-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
  flex: 0 0 auto;
}

.leotm-project-name{
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Right panel */
.leotm-main{
  min-width: 0;
  display:flex;
  flex-direction: column;
  gap: 12px;
}

.leotm-main-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

.leotm-main-title{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0.92;
}

.leotm-main-actions{
  display:flex;
  gap: 8px;
  flex: 0 0 auto;
}

/* The big inner panel */
.leotm-panel{
  background: #181818;
  border: 1px solid #25262b;
  border-radius: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.leotm-panel-inner{
  padding: 16px;
  height: 100%;
  overflow: auto;
}

.leotm-placeholder{
  text-align:center;
  opacity: 0.55;
  letter-spacing: 0.12em;
  margin: 24px 0 10px;
  text-transform: uppercase;
}

/* Table style (similar to Scribtum markdown table vibe) */
.leotm-table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.leotm-table th,
.leotm-table td{
  border: 1px solid #25262b;
  padding: 10px 12px;
  vertical-align: top;
}

.leotm-table th{
  background: #0d0d14;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* =========================
   LEO TASK MANAGER refinements
   ========================= */

.leotm-main-actions{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.leotm-action-group{
  display:flex;
  gap:8px;
  align-items:center;
  padding:6px 8px;
  border:1px solid #34343f;
  border-radius:12px;
  background:#0f0f16;
}

.leotm-table td.notes-cell{
  vertical-align:top;
}

.leotm-notesbox{
  width:100%;
  box-sizing:border-box;
  background:#0e0e14;
  border:1px solid #34343f;
  border-radius:10px;
  padding:8px 10px;
  color:#e3e3f0;
  font-size:12px;
  outline:none;
  resize:vertical;
  min-height:48px;
}

.leotm-notesbox:focus{
  border-color:#6d6dff;
}

tr.is-selected-row{
  background: rgba(255,255,255,0.06);
}
/* =========================
   LEO TASK MANAGER SCROLLER
   ========================= */

/* Make the right side behave like a proper app column */
.leotm-main {
  min-height: 0; /* critical so the inner scroll can work */
}

/* Panel takes available height and scrolls internally */
.leotm-panel {
  flex: 1;
  min-height: 0; /* critical */
}

/* This becomes the scroll container */
.leotm-panel-inner {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px; /* keeps content off scrollbar */
}

/* Optional: sticky table header so headings stay visible */
.leotm-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

/* Nice scrollbar (Chromium/Edge/Safari) */
.leotm-panel-inner::-webkit-scrollbar {
  width: 10px;
}
.leotm-panel-inner::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
}
.leotm-panel-inner::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
}
.leotm-panel-inner::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.28);
}

/* Firefox */
.leotm-panel-inner {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.22) rgba(255,255,255,0.05);
}


/* Mobile */
@media (max-width: 768px){
  .leotm-grid{
    grid-template-columns: 1fr;
    padding: 10px;
  }
}


/* -------------------------
   LEO BUG ANALYZER UI
--------------------------*/

.leobug-main-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin: 6px 0 14px;
}

.leobug-title-main{
  font-size: 20px;
  font-weight: 700;
}

.leobug-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.leobug-card{
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.leobug-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 10px;
}

.leobug-card-title{
  font-weight: 700;
  letter-spacing: 0.5px;
}

.leobug-textarea{
  width:100%;
  min-height: 170px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.25);
  padding: 12px 14px;
  color: #fff;
  outline: none;
}

.leobug-muted{
  opacity: 0.75;
  margin-top: 10px;
  font-size: 13px;
}

.leobug-badge{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  opacity: 0.95;
}

.leobug-badge--safe{ border-color: rgba(0,255,150,0.35); }
.leobug-badge--warn{ border-color: rgba(255,190,0,0.35); }
.leobug-badge--block{ border-color: rgba(255,70,70,0.45); }
.leobug-badge--neutral{ border-color: rgba(200,200,200,0.20); }

.leobug-flags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.leobug-flag{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
}

.leobug-report h4{
  margin: 12px 0 6px;
}

.leobug-report pre{
  white-space: pre-wrap;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  padding: 10px 12px;
}


.leobug-details {
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 10px;
}

.leobug-summary {
  cursor: pointer;
  font-weight: 700;
  opacity: 0.9;
  margin-bottom: 8px;
}

/* -------------------------
   LEO BUG REPORT (Report UI)
--------------------------*/
.leobug-report-block {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.22);
  border-radius: 14px;
  padding: 14px 14px 6px;
}

.leobug-report-block h4 {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  opacity: 0.92;
}

.leobug-report-block h4:first-child {
  margin-top: 4px;
}

.leobug-report-block p {
  margin: 0 0 8px;
  opacity: 0.92;
  line-height: 1.6;
}

.leobug-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 12px 0;
}

/* Probable cause highlight */
.leobug-cause {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.6;
  opacity: 0.95;
}

/* Confidence badges */
.leobug-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}

.leobug-badge-pill {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.95;
}

.leobug-badge-pill strong {
  opacity: 0.9;
}

/* Code-like blocks for checklist + patch */
.leobug-codecard {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.28);
  border-radius: 12px;
  padding: 10px 12px;
  overflow: auto;
}

.leobug-codecard pre {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 13px;
  opacity: 0.95;
}

/* Make bullets inside pre look nicer if the LLM returns "- " lines */
.leobug-codecard pre .x { display: inline;}


/* -------------------------
   LLM Toggle
--------------------------*/
.leobug-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

.leobug-toggle span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  opacity: 0.92;
}

/* Hide default checkbox */
.leobug-toggle input {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
  position: relative;
  outline: none;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

/* Knob */
.leobug-toggle input::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  transition: left 150ms ease, opacity 150ms ease;
  opacity: 0.9;
}

/* ON state */
.leobug-toggle input:checked {
  border-color: rgba(0,255,150,0.35);
  background: rgba(0,255,150,0.14);
}

.leobug-toggle input:checked::after {
  left: 22px;
  opacity: 1;
}

/* Focus */
.leobug-toggle input:focus-visible {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.10);
}

.leobug-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9aa4ff;
  font-size: 14px;
}

.leobug-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top: 2px solid #9aa4ff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* -------------------------
   LeoBug empty state
------------------------- */
.leobug-empty {
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  color: #cfcfcf;
  background: rgba(255,255,255,0.03);
}

.leobug-empty-icon {
  font-size: 32px;
  margin-bottom: 10px;
  opacity: 0.9;
}

.leobug-empty-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #ffffff;
}

.leobug-empty-text {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.85;
}

.leobug-empty-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;

}

.leobug-empty-logo {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 10px rgba(7, 221, 71, 0.541));
}


@keyframes spin {
  to { transform: rotate(360deg); }
}

/*----------------------*/
/* LEO FUNC INTERPRETER */
/*----------------------*/
.codebox{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}



/* =========================
   Universal Leo Mobile Cards
   (LeoTM / LeoBug / LeoFunc)
   ========================= */

.leo-cards {
  display: grid;
  gap: 12px;
}

.leo-card {
  background: #12121a;
  border: 1px solid #2a2a34;
  border-radius: 14px;
  padding: 12px;
}

.leo-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.leo-card-title {
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.2;
}

.leo-card-subtitle {
  margin-top: 4px;
  opacity: 0.75;
  font-size: 0.82rem;
}

.leo-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.leo-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid #2f2f3a;
  background: #0c0c12;
  opacity: 0.95;
}

.leo-pill--ok { border-color: rgba(90, 255, 180, .35); }
.leo-pill--warn { border-color: rgba(255, 210, 90, .35); }
.leo-pill--bad { border-color: rgba(255, 110, 140, .35); }

.leo-card-section {
  margin-top: 10px;
}

.leo-card-label {
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 800;
  font-size: 0.72rem;
  opacity: 0.7;
  margin-bottom: 6px;
}

.leo-card-body {
  font-size: 0.92rem;
  line-height: 1.45;
  opacity: 0.95;
}

.leo-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Hide tables on mobile when we switch to card mode */
@media (max-width: 768px){
  .is-mobile .leotm-table { display: none; }
  .is-mobile .leotm-placeholder { display: none; }
}

/* =========================
   LeoTM Mobile: Projects as Horizontal Strip
   ========================= */
@media (max-width: 768px){

  /* overall spacing */
  .leotm-grid{
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 12px;
  }

  .leotm-left{
    background: #181818;
    border: 1px solid #25262b;
    border-radius: 14px;
    padding: 14px;
    display:flex;
    flex-direction: column;

    height: 220px;
    min-width: 0;     /* KEY: allows shrink in grid */
    width: 100%;      /* KEY: on mobile it won't overflow */
    max-width: 100%;  /* KEY: never exceed container */
    overflow: hidden; /* KEY: prevents child overflow pushing layout */
    
  }
  
  /* header stays normal */
  .leotm-left-head{
    margin-bottom: 10px;
  }

  /* horizontal strip */
  .leotm-project-list{
    display: flex;
    flex-direction: row;
    gap: 10px;

    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 10px;   /* bottom padding so it doesn't feel cramped */
    -webkit-overflow-scrolling: touch;

    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  /* optional: nicer webkit scrollbar */
  .leotm-project-list::-webkit-scrollbar{
    height: 10px;
  }
  .leotm-project-list::-webkit-scrollbar-track{
    background: rgba(255,255,255,0.05);
    border-radius: 999px;
  }
  .leotm-project-list::-webkit-scrollbar-thumb{
    background: rgba(255,255,255,0.18);
    border-radius: 999px;
  }
  .leotm-project-list::-webkit-scrollbar-thumb:hover{
    background: rgba(255,255,255,0.28);
  }

  /* each project becomes a swipe card */
  .leotm-project-item{
    flex: 0 0 auto;
    min-width: 260px;
    max-width: 82vw;         /* prevents giant cards */
    scroll-snap-align: start;

    border-radius: 12px;
  }

  .leotm-left:focus,
  .leotm-left:focus-visible,
  .leotm-left :focus{
    outline: none;
    box-shadow: none;
  }
  

  /* keep name readable */
  .leotm-project-name{
    font-size: 14px;
  }

  /* Right panel header stacks clean */
  .leotm-main-head{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .leotm-main-title{
    font-size: 18px;
  }

  .leotm-main-actions{
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .leotm-action-group{
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .leobug-toggle{
    padding: 6px 10px;
    gap: 8px;
    font-size: 0.8rem;
    max-width: 100%;
    white-space: nowrap;
  }

  .leobug-toggle input{
    transform: scale(0.9);
  }

  /* Table -> card conversion stays as you had it */
  .leotm-table{
    border: 0;
  }
  .leotm-table thead{
    display: none;
  }
  .leotm-table tbody,
  .leotm-table tr,
  .leotm-table td{
    display: block;
    width: 100%;
  }
  .leotm-table tr{
    background: #0f0f16;
    border: 1px solid #25262b;
    border-radius: 14px;
    padding: 10px;
    margin: 10px 0;
  }
  .leotm-table td{
    border: 0;
    padding: 8px 6px;
  }
  .leotm-table td::before{
    content: attr(data-label);
    display: block;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.55);
    margin-bottom: 4px;
  }

  .leotm-notesbox{
    min-height: 42px;
  }

  .leotm-table .action-cell .mini-icon-btn{
    margin-right: 6px;
  }

  .leotm-table .phase-cell{
    padding-top: 6px;
  }

  /* 1) Don’t let the project strip clip the kebab */
  .leotm-left,
  .leotm-project-list{
    overflow: visible !important;
  }

  /* 2) Keep horizontal scrolling on the list itself */
  .leotm-project-list{
    overflow-x: auto !important;
    overflow-y: visible !important;
    position: relative;
    z-index: 10;
  }

  /* 3) Make sure each item can host an overlay menu */
  .leotm-project-item,
  .kebab-wrap{
    position: relative;
    z-index: 11;
  }

  /* 4) Put the menu above everything */
  .kebab-menu{
    z-index: 9999;
  }

}

