:root {
  --shadow-light: #ffffff;
  --shadow-dark: #c5c9cc;
  --btn-bg: #e8ecf0;
  --blue: #1877f2;
}

body.light {
  background-color: #f9f9f9;
  color: #333;
  --shadow-light: #e9e7e7;
  --shadow-dark: #c5c9cc;
  --btn-bg: #f9f9f9;
}

body.dark {
  background-color: #19191c;
  color: #f2f2f2;
  --shadow-light: #1d1d24;
  --shadow-dark: #101113;
  --btn-bg: #19191c;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden; /* Prevent horizontal page scrolling */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  background: inherit;
  z-index: 999;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 16px;
  background: var(--btn-bg);
  box-shadow:
    5px 

5px 10px var(--shadow-dark),
    -5px -5px 10px var(--shadow-light);
  border: none;
  cursor: pointer;
  color: inherit;
  transition: all 0.3s ease-in-out;
  z-index: 1000;
}

.scroll-center-wrapper {
  width: 300px;
  height: 100%;
  overflow-x: auto;
  display: flex;
  align-items: center;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0 20px;
  mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

.scroll-center-wrapper::-webkit-scrollbar {
  display: none;
}

.scroll-buttons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.phantom {
  width: 120px;
  flex-shrink: 0;
}

.neu-button {
  min-width: 140px;
  height: 42px;
  font-size: 15px;
  background: var(--btn-bg);
  border-radius: 12px;
  border: none;
  color: var(--blue);
  scroll-snap-align: center;
  cursor: pointer;
  box-shadow:
    5px 5px 10px var(--shadow-dark),
    -5px -5px 10px var(--shadow-light);
  opacity: 0.3;
  transform: scale(0.9);
  transition: all 0.3s ease-in-out;
}

.neu-button.focused {
  opacity: 1;
  transform: scale(1.1);
}

#output-container {
  position: relative;
  padding: 120px 20px 100px;
  padding-bottom: 200px;
  margin-right: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scrolling of container */
  scroll-behavior: smooth;
  box-sizing: border-box;
}

#output-container::-webkit-scrollbar {
  width: 10px;
}

#output-container::-webkit-scrollbar-track {
  background: transparent;
}

#output-container::-webkit-scrollbar-thumb {
  background-color: #1877f2;
  border-radius: 8px;
  box-shadow:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
}

.scroll-arrow {
  position: fixed;
  right: 15px;
  width: 40px;
  height: 40px;
  font-size: 20px;
  color: white;
  background-color: #1877f2;
  border: none;
  border-radius: 50%;
  box-shadow:
    4px 4px 6px var(--shadow-dark),
    -4px -4px 6px var(--shadow-light);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.2s ease;
}

.scroll-arrow:hover {
  transform: scale(1.15);
  background-color: #0f5cc2;
}

#scrollTopBtn {
  bottom: 100px;
}

#scrollBottomBtn {
  bottom: 40px;
}

.output-card {
  position: relative;
  background: var(--btn-bg);
  padding: 6px 20px;
  border-radius: 14px;
  box-shadow:
    inset 3px 3px 6px var(--shadow-dark),
    inset -3px -3px 6px var(--shadow-light);
  margin-bottom: 10px;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-x: auto; /* Allow horizontal scrolling within card */
  max-width: 100%; /* Ensure card doesn't exceed parent width */
  transition: all 0.3s ease-in-out;
}

.output-card .query {
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 8px;
  display: block;
}

.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: inherit;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
  gap: 10px;
  z-index: 999;
  box-sizing: border-box;
}

.footer input {
  flex: 1;
  height: 40px;
  padding: 0 15px;
  border-radius: 12px;
  border: none;
  background: var(--btn-bg);
  box-shadow:
    inset 3px 3px 6px var(--shadow-dark),
    inset -3px -3px 6px var(--shadow-light);
  color: inherit;
  font-size: 14px;
  outline: none;
  max-width: calc(100% - 70px);
  box-sizing: border-box;
}

.footer button {
  min-width: 50px;
  padding: 10px;
  border: none;
  border-radius: 12px;
  background: var(--btn-bg);
  box-shadow:
    5px 5px 10px var(--shadow-dark),
    -5px -5px 10px var(--shadow-light);
  cursor: pointer;
  color: var(--blue);
  font-size: 16px;
  transition: all 0.3s ease-in-out;
}

.dots-loader {
  display: inline-block;
  vertical-align: middle;
  width: 1em;
  height: 1em;
  font-size: 16px;
  position: relative;
}

.dots-loader::after {
  content: '...';
  animation: dots 1.2s steps(3, end) infinite;
  font-weight: bold;
  color: inherit;
}

@keyframes dots {
  0%   { content: ''; }
  33%  { content: '.'; }
  66%  { content: '..'; }
  100% { content: '...'; }
}

.section-content {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.section-content.fade-in {
  opacity: 1;
}

.risk-chart-wrapper {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

#chat-output {
  overflow-y: auto;
  max-height: 100%;
  height: 100%;
  scroll-behavior: smooth;
}

.risk-pie {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #e0e0e0;
  box-shadow:
    inset 5px 5px 10px var(--shadow-dark),
    inset -5px -5px 10px var(--shadow-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-weight: bold;
  font-size: 20px;
  transition: all 0.4s ease;
}

.risk-pie .risk-text {
  position: absolute;
  color: #1877f2;
}

.risk-info p {
  margin: 5px 0;
  font-size: 14px;
}

.risk-glow {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 8px #1877f2;
  z-index: 0;
  opacity: 0.4;
}

.section-output {
  flex: 1;
  display: none;
}

.section-output.visible {
  display: block;
}

.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  width: 100%; /* Ensure the container takes full width */
  max-width: 600px; /* Optional: Limit the max width for better readability */
  margin: 0 auto; /* Center the container */
}

.chart-container canvas {
  border-radius: 10px; /* Use a smaller radius for slight rounding, or 0 for a sharp rectangle */
  background: #1f1f1f;
  padding: 10px; /* Adjust padding for better spacing */
  box-shadow:
      inset 4px 4px 8px rgba(0, 0, 0, 0.4),
      inset -4px -4px 8px rgba(255, 255, 255, 0.05);
}

body.light .chart-container canvas {
  background: #ffffff;
  box-shadow:
    inset 6px 6px 12px #c5c5c5,
    inset -6px -6px 12px #ffffff;
}

body.dark .chart-container canvas {
  background: #1f1f1f;
  box-shadow:
    inset 4px 4px 8px rgba(0, 0, 0, 0.4),
    inset -4px -4px 8px rgba(255, 255, 255, 0.05);
}

.card-header {
  position: absolute;
  height: 5px;
  top: 1px;
  right: 12px;
  z-index: 2;
}

.query {
  margin: 20px 0 2px 0;
  font-weight: 600;
  color: var(--blue);
}

.response {
  margin-top: 2px;
  max-width: 100%; /* Ensure response content doesn't exceed card width */
  overflow-x: auto; /* Allow horizontal scrolling for wide content */
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 22px;
  top: 0;
  transition: color 0.2s ease;
}
.copy-btn:hover {
  color: #1645ff;
}

.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
  font-size: 22px;
}

.risk-text.low {
  color: #00cc66;
  font-weight: 600;
}
.risk-text.medium {
  color: #ffaa00;
  font-weight: 600;
}
.risk-text.high {
  color: #ff6600;
  font-weight: 600;
}
.risk-text.extreme {
  color: #ff0033;
  font-weight: 700;
}

.section-tag,
.section-num,
.punish-num,
.advice-num,
.case-num {
  background: #e0f7ff;
  padding: 1px 6px;
  border-radius: 12px;
  font-weight: 500;
  color: #006688;
  font-size: 13px;
  margin: 0 2px;
}

.party-text {
  color: #888;
  font-style: italic;
}

.dismiss-label {
  font-weight: bold;
  color: #999;
  margin-right: 4px;
}

.response b,
.doc-editor b,
.risk-details b {
  font-weight: bold;
}
.response i,
.doc-editor i,
.risk-details i {
  font-style: italic;
}
.response a,
.doc-editor a,
.risk-details a {
  color: #1877f2;
  text-decoration: underline;
}
.response a:hover,
.doc-editor a:hover,
.risk-details a:hover {
  color: #0f5cc2;
}
.response code,
.doc-editor code,
.risk-details code {
  background: #e0e0e0;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
}
.response s,
.doc-editor s,
.risk-details s {
  text-decoration: line-through;
}
body.dark .response code,
.body.dark .doc-editor code,
.body.dark .risk-details code {
  background: #333;
}

#queryInput::placeholder {
  font-style: italic;
  color: #aaa;
}

#queryInput {
  font-style: normal !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Ensure wide content stays within response card */
.response table,
.response pre,
.response code,
.response .math-display,
.response .math-inline {
  max-width: 100%;
  word-break: break-word; /* Break long words to fit */
}

/* Tighten table spacing */
.response table {
  border-collapse: collapse;
  margin: 0; /* Remove any margin to avoid extra space */
  width: 100%;
}
.response th,
.response td {
  border: 1px solid #ccc;
  padding: 4px; /* Reduced from 8px */
  text-align: left;
  word-break: break-word; /* Prevent overflow from long cell content */
}
.response th {
  background: #f0f0f0;
  font-weight: bold;
}
body.dark .response th {
  background: #444;
}

.section-output:empty::before {
  content: "Hello";
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: bold;
  opacity: 0.15;
  pointer-events: none;
  width: 50vw; /* Cover 50% of screen width */
  text-align: center;
}

.section-output:empty::after {
  content: ",";
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) translateX(70px); /* Adjust to position comma after "Hello" */
  font-size: 48px;
  font-weight: bold;
  opacity: 0.15;
  pointer-events: none;
  color: #1877f2; /* Facebook blue */
  animation: blink-comma 1s infinite;
  width: 50vw; /* Cover 50% of screen width */
  text-align: center;
}

body.light .section-output:empty::before {
  color: #333;
  text-shadow: 
    2px 2px 4px var(--shadow-light),
    -2px -2px 4px var(--shadow-dark);
}

body.dark .section-output:empty::before {
  color: #f2f2f2;
  text-shadow: 
    2px 2px 4px var(--shadow-dark),
    -2px -2px 4px var(--shadow-light);
}

body.light .section-output:empty::after,
body.dark .section-output:empty::after {
  color: #1877f2; /* Facebook blue in both modes */
  text-shadow: none; /* No engraved effect for comma */
}

.placeholder-input {
  border: none;
  outline: none;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--btn-bg);
  box-shadow:
    inset 3px 3px 6px var(--shadow-dark),
    inset -3px -3px 6px var(--shadow-light);
  color: inherit;
  font-size: 14px;
  max-width: 100%;
  box-sizing: border-box;
  margin: 2px;
}

.placeholder-input::placeholder {
  color: #aaa;
  font-style: italic;
}

/* ✅ Prevent blue tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: auto; /* Allow dynamic height */
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: inherit;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
  z-index: 999;
  box-sizing: border-box;
  margin-top: 50px;
}

.footer .input-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 600px; /* Limit width for smaller screens */
  justify-content: center;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.disclaimer-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

.disclaimer-text {
  display: block;
  text-align: center;
  font-size: 12px;
  font-style: italic;
  opacity: 0.6;
  margin-top: 2px;
  margin-bottom: 2px;
  color: inherit;
}
@keyframes blink-comma {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (max-width: 600px) {
  .footer {
    padding-bottom: 20px; /* Extra space for disclaimer */
    margin-top: 40px;
  }
  .disclaimer-text {
    line-height: 1.2; /* Adjust line height for better readability */
  }
  #output-container {
    padding-bottom: 250px; /* Increase from 100px to 140px to add 40px more space */
  }
}

/* Sidebar Toggle Button — fixed position at top-right inside header */
.toggle {
  position: absolute;
  top: 50%;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--btn-bg);
  border-radius: 50%;
  border: none;
  box-shadow: 5px 5px 10px var(--shadow-dark),
              -5px -5px 10px var(--shadow-light);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  z-index: 1001;
  transform: translateY(-50%);
}

.toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  border: 2px dashed #1877f2; /* Facebook blue */
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease-in-out;
}


.toggle.open {
  border-radius: 10px;
  box-shadow: inset 5px 5px 10px var(--shadow-dark),
              inset -5px -5px 10px var(--shadow-light);
}

.toggle.open::before {
  border: none;
  width: 24px;
  height: 2px;
  background: #1877f2; /* Facebook blue bar */
  border-radius: 2px;
  transform: translate(-50%, -50%);
}


/* Sidebar Panel Styles */
.sidebar {
  position: fixed;
  top: 80px; /* Same as header height */
  right: 0;
  width: 280px;
  min-height: 20%;
  max-height: 70%;
  /* height: calc(100vh - 80px); */
  background: var(--btn-bg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.35s ease, all 0.3s ease;
  padding: 30px 20px;
  border-radius: 20px 0 0 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  will-change: transform;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar nav a {
  text-align: center;
  width: 100%;
  padding: 10px 0;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  transition: color 0.2s, all 0.3s ease;
  border-bottom: 1px solid rgb(121, 114, 114);
}

.sidebar nav a:last-child {
  border-bottom: none;
}

.sidebar nav a:hover {
  color: #007bff;
}

.theme-toggle {
  margin-top: 15px;
  text-align: center;
}


/* ✅ Bottom-aligned theme toggle button in sidebar */
.theme-bottom-btn {
  margin-top: auto;
  align-self: center;
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  background: var(--btn-bg);
  color: var(--text);
  box-shadow: 4px 4px 8px var(--shadow-dark),
              -4px -4px 8px var(--shadow-light);
  cursor: pointer;
  transition: all 0.3s ease;
}

.sidebar button{
  margin-top: 50px;
}

/* Make the sidebar's content container scrollable */
.sidebar > div {
  flex-grow: 1; /* Already set in tap.html, but reinforce here */
  overflow-y: auto; /* Enable vertical scrolling */
  padding-bottom: 10px; /* Prevent content from sticking to the bottom */
}

/* Ensure the sidebar itself doesn't scroll */
.sidebar {
  overflow-y: hidden; /* Prevent sidebar from scrolling */
}

/* Style the scrollbar for the sidebar content */
/* .sidebar > div::-webkit-scrollbar {
  width: 6px;
} */

.sidebar > div::-webkit-scrollbar-track {
  background: transparent;
}

/* .sidebar > div::-webkit-scrollbar-thumb {
  background-color: var(--blue);
  border-radius: 8px;
  box-shadow:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
} */

/* Responsive adjustments for sidebar on small devices */
@media (max-width: 768px) {
  .sidebar {
    width: 80%; /* Slightly less than full width for better usability */
    max-width: 260px; /* Cap the width for small screens */
    padding: 20px 15px; /* Reduce padding for mobile */
    transform: translateX(100%); /* Ensure it slides in from the right */
  }

  .sidebar.open {
    transform: translateX(0); /* Show sidebar when open */
  }

  .sidebar nav {
    gap: 6px; /* Reduce gap between nav items */
  }

  .sidebar nav a {
    font-size: 14px; /* Smaller font size for mobile */
    padding: 8px 0; /* Adjust padding for better touch targets */
  }

  .theme-bottom-btn {
    padding: 8px 16px; /* Smaller padding for mobile */
    font-size: 14px; /* Smaller font size */
    margin-bottom: 20px;
  }

  /* .sidebar button {
    margin-top: 30px; 
  } */

  .toggle {
    top: 50%;
    right: 15px;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
  }

  .toggle::before {
    width: 22px; /* Adjust toggle icon size */
    height: 22px;
  }

  .toggle.open::before {
    width: 20px; /* Adjust toggle icon size when open */
  }

  /* Ensure header remains unaffected */
  .header {
    height: 80px; /* Maintain header height */
  }

  /* Adjust output container to avoid overlap */
  #output-container {
    padding-top: 100px; /* Ensure content doesn't overlap with header */
  }
}

#micToggleBtn span,
#mediaBtn span {
  font-size: 22px;
  color: #1877f2; /* Facebook blue */
}

#micToggleBtn,
#mediaBtn {
  /* padding: 10px; */
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  background: var(--btn-bg);
  box-shadow: 5px 5px 10px var(--shadow-dark),
              -5px -5px 10px var(--shadow-light);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}


#disclaimer h2 {
  margin-top: 0;
  text-align: center;
  color: #1877F2;
}


.disclaimer-popup {
  position: fixed;
  top: -100%;
  left: 0;
  width: 100%;
  min-height: 30%;
  max-height: 65%;
  overflow-y: auto;
  box-sizing: border-box;
  overflow-x: hidden;
  background: #f9f9f9;
  color: #333;
  padding: 30px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  z-index: 9999;
  transition: top 0.5s ease-in-out;
  text-align: center;
}

.disclaimer-popup.show {
  top: 0;
}

.disclaimer-popup button {
  background-color: #1877f2;
  color: #fff;
  border: none;
  padding: 12px 25px;
  font-size: 15px;
  border-radius: 10px;
  margin-top: 25px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.disclaimer-popup button:hover {
  background-color: #0d64d1;
}

/* .chart-container canvas.pie-chart, */
.chart-container canvas.doughnut-chart {
    border-radius: 50%;
    background: #1f1f1f;
    padding: 6px;
    box-shadow:
        inset 4px 4px 8px rgba(0, 0, 0, 0.4),
        inset -4px -4px 8px rgba(255, 255, 255, 0.05);
}

.chart-container canvas.other-chart {
    border-radius: 10px;
    background: #1f1f1f;
    padding: 10px;
    box-shadow:
        inset 4px 4px 8px rgba(0, 0, 0, 0.4),
        inset -4px -4px 8px rgba(255, 255, 255, 0.05);
}

.chart-container canvas {
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff;
  min-height: 300px;
  width: 100% !important;
  max-width: 600px;
  opacity: 0; /* Default state: hidden */
  transform: scale(0.95); /* Default state: slightly scaled down */
  transition: opacity 0.5s ease, transform 0.5s ease; /* Smooth transition for animation */
}

/* When the chart is in view, animate it */
.chart-container canvas.visible {
  opacity: 1;
  transform: scale(1);
}

/* When the chart leaves the view, reset it for the next animation */
.chart-container canvas.hidden {
  opacity: 0;
  transform: scale(0.95);
}

#paletteBtn span {
  font-size: 22px;
  color: #aaa; /* default gray */
  transition: color 0.3s ease;
}
body.docs-mode #paletteBtn span {
  color: #1877f2; /* Facebook blue in GenEve */
}

.page-popup {
  position: fixed;
  top: 15%;
  left: 15%;
  width: 70%;
  height: 70%;
  background: var(--btn-bg);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  border-radius: 16px;
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
}
.page-popup.show {
  display: flex;
}
.popup-close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 20px;
  color: #888;
  cursor: pointer;
  margin-bottom: 10px;
}
.popup-content {
  overflow-y: auto;
  flex: 1;
  padding-right: 10px;
}
.popup-content::-webkit-scrollbar {
  width: 8px;
}
.popup-content::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 4px;
}

.file-preview-bar {
  display: none;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  padding: 8px 0 12px;
  gap: 12px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  padding-left: 20px;
  padding-right: 20px;
}


.file-preview-bar::-webkit-scrollbar {
  display: none;
}

.file-pill {
  display: inline-flex;
  align-items: center;
  background: var(--btn-bg);
  color: inherit;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

.file-pill span {
  margin-right: 8px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-pill button {
  all: unset; /* Reset all inherited styles */
  cursor: pointer;
  font-size: 16px;
  margin-left: 6px;
  color: #1877f2; /* Facebook blue */
  font-weight: bold;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-pill button:hover {
  color: #0f5cc2; /* Slightly darker blue on hover */
}

@media (max-width: 520px) {
  .footer .input-wrapper {
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer .input-wrapper > input#queryInput {
    order: 2; /* Make input appear second */
    flex: 1 1 100%;
    max-width: 100%;
  }

  .footer .input-wrapper > button,
  .footer .input-wrapper > #paletteBtn,
  .footer .input-wrapper > #mediaBtn,
  .footer .input-wrapper > #micToggleBtn {
    order: 3;
    min-width: 45px !important;
    height: 45px;
    padding: 6px;
    font-size: 14px;
    border-radius: 10px;
  }
}

/* Perfectly centered popup panel */
.page-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  max-height: 90vh;
  width: 80%;
  background: var(--btn-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-radius: 18px;
  z-index: 9999;
  display: none;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

.page-popup.show {
  display: flex;
}

.popup-content {
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 20px;
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  font-weight: bold;
}
.popup-close:hover {
  color: var(--blue);
}

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Mobile optimization */
@media (max-width: 600px) {
  .page-popup {
    padding: 16px 14px;
    border-radius: 14px;

  }

  .popup-content {
    max-height: 75vh;
  }
}

