/* Theme tokens for colors, shadows, and quick sizing controls. */
:root {
  --paper: #000000;
  --ink: #ffffff;
  --muted: #dae4de; /* This is content font color*/
  --accent: #161515;
  --accent-strong: #000000;
  --panel: rgb(88, 87, 87); 
  --line: rgba(31, 42, 36, 0.12);
  --shadow: 0 24px 60px rgb(6, 7, 7);
  --ok: #00ff8c;
  --warn: #fa1111;

  /* Quick customisation knobs for controls and the main Ask button. */
  --control-radius: 16px;
  --button-padding-block: 8px;
  --button-padding-inline: 8px;
  --ask-button-width: 100%;
  --ask-button-max-width: 100%;
  --ask-button-padding-block: 8px;
  --ask-button-padding-inline: 8px;
  --ask-button-radius: 16px;
  --pill-padding-block: 8px;
  --pill-padding-inline: 12px;
}

/* Use border-box sizing so padding and borders stay inside declared widths. */
* { box-sizing: border-box; }

/* Paint the page background and set the base font and text color. */
body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at top left, rgba(0, 0, 0, 0), transparent 0%),
    radial-gradient(circle at bottom right, rgba(0, 0, 0, 0), transparent 0%),
    linear-gradient(135deg, #00000000 0%, #00000000 0%, #00000000 0%);
}

/* Constrain the app width and add breathing room around the whole layout. */
.shell {
  width: min(1680px, calc(100vw - 32px));
  max-width: none;
  margin: 0 auto;
  height: 100vh;
  padding: 14px 16px 16px;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

/* Split the top hero into a content card and a status card. */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  min-height: 0;
}

/* Give hero cards and panels the shared glassy panel treatment. */
.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px); /*12px*/
}

/* Space the hero content and keep decorative overflow clipped. */
.hero-card {
  padding: 10px 14px;
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 4px 18px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Add the soft decorative circle in the hero card corner. */
.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;/*50*/
  background: rgba(179, 92, 46, 0.12);
  filter: blur(6px);/*6px*/
}

/* Style the small uppercase label above the hero heading. */
.kicker {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 42, 36, 0.06);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  grid-column: 1;
  justify-self: start;
}

/* Use serif typography for the main section headings. */
h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Make the page title large and compact for a strong hero headline. */
h1 {
  grid-column: 1;
  margin-top: 2px;
  font-size: clamp(1.3rem, 1.8vw, 2rem);
  line-height: 1.04;
  max-width: none;
}

/* Keep the hero intro text readable and slightly muted. */
.hero-card p {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
  max-width: none;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

/* Arrange the top-right status metrics in a two-column grid. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
}

/* Style each status tile with a soft card treatment. */
.stat {
  padding: 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(31, 42, 36, 0.08);
}

/* Format the small uppercase labels inside each status tile. */
.stat-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

/* Emphasize the main value inside each status tile. */
.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

/* Split the page into the left tool rail and right question area. */
.workspace {
  display: grid;
  grid-template-columns: clamp(280px, 22vw, 320px) minmax(0, 1fr) clamp(320px, 24vw, 360px);
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
}

.workspace > * {
  min-width: 0;
}

/* Add inner spacing to each main panel shell. */
.panel {
  padding: 16px;
  min-height: 0;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

/* Let the left rail stack chat, upload, and file scope efficiently. */
.rail-panel {
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
}

.website-auth-body {
  display: grid;
  gap: 12px;
}

.website-auth-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(255, 255, 255, 0.04));
}

.website-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.website-auth-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.website-auth-badge.active {
  background: rgba(0, 255, 140, 0.16);
  color: #ccffe6;
}

.website-auth-badge.warning {
  background: rgba(250, 17, 17, 0.16);
  color: #ffd0d0;
}

#website-matter-select {
  min-height: 44px;
}

/* Keep the left rail as the home for upload and loaded-file controls. */
.left-rail {
  grid-column: 1;
}

/* Set the secondary heading size used inside panels. */
.panel h2 {
  font-size: 1.28rem;
  margin-bottom: 8px;
}

/* Apply the shared muted text styling used by helper copy and labels. */
.panel p,
label,
.hint,
.meta {
  color: var(--muted);
  line-height: 1.5;
}

/* Stack form sections and cards with consistent vertical spacing. */
.stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

/* Align section headings with compact actions like New chat. */
.section-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-row > * {
  min-width: 0;
}

/* Keep section-level pill buttons compact. */
.section-row .pill,
.chat-main-header .pill {
  width: auto;
  flex: 0 0 auto;
}

/* Use a vertical list for saved chat sessions. */
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  min-width: 0;
}

/* Style each saved chat entry like a compact sidebar card. */
.chat-list-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 12px;
  min-height: 0;
  min-width: 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.44), rgba(255, 255, 255, 0.035));
  color: var(--ink);
  text-align: left;
  box-shadow: none;
  overflow: visible;
  transition: border-color 140ms ease, background 140ms ease;
}

.chat-list-item:hover,
.chat-list-item:focus-within {
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.52), rgba(255, 255, 255, 0.055));
}

.chat-list-item.selected {
  border-color: rgba(0, 253, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.chat-list-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.chat-list-select {
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
  margin: 0;
}

.chat-list-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #00fdff;
}

.chat-list-open {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  box-shadow: none;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.chat-list-open:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: transparent;
}

.chat-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  padding-left: 28px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-list-action {
  width: auto;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  box-shadow: none;
  font-size: 0.74rem;
  line-height: 1.1;
}

.chat-list-action:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.14);
}

.chat-list-action-danger {
  border-color: rgba(154, 103, 0, 0.4);
}

/* Review notification banner (dismissible) */
.review-notification {
  position: fixed;
  right: 20px;
  bottom: 100px;
  z-index: 1200;
  width: 360px;
  background: linear-gradient(180deg, rgba(0,0,0,0.7), rgba(0,0,0,0.6));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.6);
}
.review-notification-inner { display:flex; gap:10px; align-items:center; justify-content:space-between; }
.review-notification-message { color: var(--muted); font-size: 0.95rem; }
.review-notification-actions { display:flex; gap:8px; }

/* Modal review editor */
.review-editor-modal { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; }
.review-editor-modal.is-open { display: flex; }
[hidden] { display: none !important; }
.review-editor-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.review-editor-overlay { pointer-events: auto; }
.review-editor-shell {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 64px));
  max-height: calc(100% - 120px);
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  overflow: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.review-editor-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.review-editor-controls { display:flex; gap:8px; }
.review-editor-controls .pill { width: auto; flex: 0 0 auto; }
.review-editor-meta-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:12px; }
.review-editor-meta-copy { display:grid; gap:4px; min-width:0; }
.review-editor-meta-kicker { font-size:0.76rem; letter-spacing:0.06em; text-transform:uppercase; color:var(--muted); }
.review-editor-meta-summary { font-size:0.88rem; color:var(--ink); line-height:1.4; }
.review-editor-nav { display:flex; flex-wrap:wrap; gap:8px; }
.review-editor-nav .pill { width:auto; flex:0 0 auto; }
.review-context-note { margin:0 0 12px; padding:10px 12px; border-radius:12px; border:1px solid rgba(154, 103, 0, 0.34); background:rgba(154, 103, 0, 0.12); color:#f3d17b; font-size:0.88rem; line-height:1.45; }
.review-context-panel { display:grid; gap:12px; margin-bottom:14px; padding:12px; border-radius:14px; border:1px solid rgba(255, 255, 255, 0.08); background:rgba(0, 0, 0, 0.22); }
.review-context-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px 14px; }
.review-context-item { display:grid; gap:4px; min-width:0; }
.review-context-item-wide { grid-column:1 / -1; }
.review-context-label { font-size:0.74rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color:var(--muted); }
.review-context-value { color:var(--ink); line-height:1.45; overflow-wrap:anywhere; }
.review-context-links { display:flex; flex-wrap:wrap; gap:8px; }
.review-context-link { display:inline-flex; align-items:center; width:auto; padding:6px 10px; border-radius:999px; border:1px solid rgba(255, 255, 255, 0.14); background:rgba(255, 255, 255, 0.05); color:var(--ink); text-decoration:none; font-size:0.82rem; }
.review-context-link:hover,
.review-context-link:focus-visible { background:rgba(255, 255, 255, 0.12); text-decoration:none; }
.review-editor-body { padding:8px 2px; }
.review-editor-shell.maximized { width: calc(100% - 40px); height: calc(100% - 40px); max-height: none; }

/* Larger input styles in modal */
.review-editor-shell .review-item-input { font-size: 1rem; padding: 10px 12px; border-radius: 8px; }
.review-editor-shell .review-item-textarea { font-size: 1rem; padding: 10px 12px; border-radius: 8px; }
.review-editor-shell .review-item-form-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:12px; }
.review-editor-shell .review-item-form-actions .pill,
.review-history-shell .pill { width:auto; flex:0 0 auto; }
.review-history-shell { display:grid; gap:8px; justify-items:start; margin-top:12px; }


/* Highlight the currently open chat. */
.chat-list-item.active {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
}

/* Emphasize the saved chat title. */
.chat-list-title {
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.25;
  line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.chat-list-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Keep saved chat metadata compact and muted. */
.chat-list-meta,
.chat-list-cost,
.chat-header-meta,
.document-status {
  margin-top: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.chat-list-cost {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

/* Clamp saved chat previews so the rail stays compact. */
.chat-list-summary {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.32;
  font-size: 0.79rem;
  line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Reserve more height for the main chat workspace. */
.chat-main {
  align-content: stretch;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 0;
  min-width: 0;
  height: 100%;
}

/* Align the main chat title with the delete action. */
.chat-main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Place the saved chat history in a dedicated right rail. */
.history-rail {
  grid-column: 3;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

/* Constrain the history rail so it never expands past the viewport height.
   Let the internal chat-list scroll when there are many chats. */
.history-rail {
  max-height: calc(100vh - 120px);
}

.history-rail .chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  max-height: 100%;
  overflow-y: auto;
  min-height: 0;
}

.history-rail .chat-list-item {
  flex: 0 0 auto !important;
}

.history-rail-header {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.history-rail-header .section-row {
  align-items: center;
}

.history-rail-header .section-row p {
  margin-top: 6px;
}

#new-chat {
  width: auto;
  min-width: 108px;
  justify-self: start;
}

.history-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.history-toolbar .pill {
  min-width: 0;
  padding-block: 10px;
}

#chat-selection-summary {
  margin-top: 2px;
  font-size: 0.82rem;
}

/* Give labels a consistent size and spacing above controls. */
label {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

/* Apply the shared form-control frame used by inputs, textareas, and buttons. */
input,
textarea,
button {
  width: 100%;
  border-radius: var(--control-radius);
  border: 1px solid rgba(31, 42, 36, 0.15);
  font: inherit;
}

/* Style text inputs and textareas with the shared light field look. */
input,
textarea {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--ink);
}

/* Keep the question box tall enough and allow manual resizing. */
textarea {
  min-height: 112px;
  resize: vertical;
}

/* Hide file inputs while keeping label-triggered selection available. */
.composer-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Use a relative wrapper so the send control can sit inside the question box. */
.question-compose {
  position: relative;
}

/* Make room inside the question box for the floating send control. */
.question-compose textarea {
  min-width: 0;
  min-height: 62px;
  padding: 12px 92px 12px 14px;
}

/* Keep the conversation card header aligned with the clear-chat action. */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Let the conversation card fill the main column like a chat client. */
.chat-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.chat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}

.stop-ask-button {
  width: auto;
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(154, 103, 0, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  box-shadow: none;
}

.stop-ask-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

/* Render the conversation as a scrollable message column. */
.chat-thread {
  display: grid;
  gap: 12px;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  margin-top: 0;
  padding-right: 4px;
}

.chat-thread > .evidence {
  min-height: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  place-content: center;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

/* Keep each user/assistant pair visually grouped. */
.chat-turn {
  display: grid;
  gap: 10px;
}

/* Style chat messages as soft bubbles. */
.chat-message {
  max-width: min(100%, 860px);
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.42);
}

/* Push user messages to the right like a chat app. */
.chat-message.user {
  justify-self: end;
  background: rgba(0, 0, 0, 0.72);
}

/* Keep assistant answers on the left. */
.chat-message.assistant {
  justify-self: start;
}

/* Muted pending replies should feel provisional. */
.chat-message.pending .chat-body {
  color: var(--muted);
  font-style: italic;
}

.chat-message.pending .turn-progress-shell {
  margin-top: 10px;
}

/* Warn styling for failed assistant replies. */
.chat-message.error {
  border-color: rgba(154, 103, 0, 0.5);
}

.chat-message.stopped {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.chat-message.stopped .chat-body {
  color: var(--muted);
}

/* Label each chat bubble clearly. */
.chat-role-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chat-role-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-role {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.assistant-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.32);
  font-size: 0.68rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.assistant-mode-badge.review {
  color: #7fd6ff;
}

.assistant-mode-badge.report {
  color: #f3d17b;
}

.assistant-mode-badge.market {
  color: #8fe1c2;
}

.assistant-mode-badge.grounded {
  color: var(--ok);
}

.assistant-mode-badge.structured {
  color: #c7b2ff;
}

.assistant-mode-badge.direct {
  color: #ffd1a1;
}

.chat-time {
  font-size: 0.76rem;
  color: var(--muted);
  opacity: 0.92;
}

/* Preserve answer line breaks while allowing wraps. */
.chat-body {
  margin-top: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.chat-edit-panel {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.chat-edit-input {
  width: 100%;
  min-height: 92px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.chat-edit-input:focus {
  outline: 1px solid rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.24);
}

.chat-edit-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.answer-sections {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.answer-section {
  display: grid;
  gap: 8px;
}

.answer-section-title {
  color: var(--ink);
  line-height: 1.4;
}

.answer-section-items {
  display: grid;
  gap: 8px;
}

.answer-section-item {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.answer-item-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.answer-item-text {
  display: inline;
  min-width: 0;
}

.answer-item-label {
  font-weight: 700;
  color: var(--ink);
}

.answer-item-value {
  min-width: 0;
}

.answer-evidence-inline {
  display: inline;
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.answer-evidence-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
}

.answer-evidence-link:hover {
  background: rgba(255, 255, 255, 0.16);
}

.answer-evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.answer-evidence-meta-item strong {
  color: var(--ink);
  font-weight: 700;
}

.message-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chat-message.user .message-action-row {
  justify-content: flex-end;
}

.message-action {
  width: auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  box-shadow: none;
  font-size: 0.82rem;
}

.message-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

/* Show per-answer scope and cost chips directly under assistant replies. */
.turn-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Render answer metadata chips with lower emphasis than citations. */
.turn-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.82rem;
}

/* Fade secondary note chips a little further. */
.turn-meta-chip.subdued {
  opacity: 0.86;
}

.chat-warning {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(154, 103, 0, 0.34);
  background: rgba(154, 103, 0, 0.12);
  color: #f3d17b;
  font-size: 0.88rem;
  line-height: 1.45;
}

/* Stack citation label and links under each assistant answer. */
.chat-citations {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

/* Wrap citation links into pills. */
.citation-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Stack quoted evidence cards vertically for easier scanning. */
.citation-links-detailed {
  display: grid;
  gap: 10px;
}

/* Render each citation as a compact clickable chip. */
.citation-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  text-decoration: none;
}

/* Render quote-level citations as readable cards instead of single pills. */
.citation-card {
  display: grid;
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

/* Emphasize the source label on the citation card. */
.citation-card-label {
  font-weight: 700;
  color: var(--ink);
}

/* Keep clause metadata subdued. */
.citation-card-meta {
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

/* Preserve the exact quote as readable multiline text. */
.citation-card-quote {
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
}

.citation-card-inline-action {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;
}

.citation-inline-link {
  vertical-align: middle;
}

.citation-card-reference-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 0.8rem;
  color: var(--muted);
}

.citation-card-reference-item strong {
  color: var(--ink);
  font-weight: 700;
}

.citation-card-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 4px;
}

.citation-source-link {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.76rem;
}

.citation-source-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Slightly brighten citation links on hover. */
.citation-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Give the composer its own card like modern chat apps. */
.composer-card {
  padding: 10px 12px;
}

/* Use a footer bar for running scope and cost visibility. */
.chat-footer-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto)) minmax(160px, 1fr);
  align-items: center;
  gap: 6px;
  padding: 8px;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.58);
}

/* Style each footer metric like a compact stat tile. */
.footer-chip {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

/* Use uppercase labels for the footer metrics. */
.footer-label {
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Let the note span the full footer width. */
.footer-note {
  grid-column: auto;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.2;
  text-align: right;
}

/* Style the upload picker as a field-like compose area with in-place actions. */
.upload-compose {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 148px;
  min-width: 0;
  padding: 0px;
  border-radius: var(--control-radius);
  border: 1px solid rgba(31, 42, 36, 0.15);
  background: rgba(0, 0, 0, 0.72);
}

/* Show the current folder or file selection inside the upload composer. */
.upload-selection {
  color: var(--ink);
  line-height: 1.5;
  min-height: 48px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.upload-progress-shell,
.turn-progress-shell {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.upload-progress-meta,
.turn-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.upload-progress-label,
.upload-progress-value,
.turn-progress-label,
.turn-progress-value {
  min-width: 0;
}

.upload-progress-value,
.turn-progress-value {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.upload-progress-track,
.turn-progress-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.upload-progress-bar,
.turn-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00b8ff, #00ff8c);
  transition: width 180ms ease;
}

.upload-progress-shell[data-state="complete"] .upload-progress-bar {
  background: linear-gradient(90deg, #00ff8c, #00fdff);
}

.upload-progress-shell[data-state="error"] .upload-progress-bar {
  background: linear-gradient(90deg, #fa1111, #ff9a6a);
}

.upload-progress-bar.indeterminate,
.turn-progress-bar.indeterminate {
  animation: upload-progress-indeterminate 1.15s ease-in-out infinite;
}

@keyframes upload-progress-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(240%);
  }
}

/* Keep folder and file pickers together inside the upload field. */
.upload-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Style folder and file triggers like inline action chips. */
.picker-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  cursor: pointer;
}

/* Lift picker chips slightly on hover to match other interactive controls. */
.picker-chip:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Style standard buttons with the primary gradient, shadow, and spacing. */
button {
  padding: var(--button-padding-block) var(--button-padding-inline);
  cursor: pointer;
  border: none;
  color: #00fdff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 24px rgba(255, 255, 255, 0.1);
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

/* Lift buttons slightly on hover to make them feel interactive. */
button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(255, 255, 255, 0.28);
}

/* Dim buttons while async work is running and block interaction. */
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
/* Turn action buttons into low-emphasis ghost buttons when needed. */
.ghost {
  color: var(--ink);
  background: rgba(31, 42, 36, 0.08);
  box-shadow: none;
}

/* Style compact pill buttons used for presets and toolbar actions. */
.pill {
  /* width: auto; */
  padding: var(--pill-padding-block) var(--pill-padding-inline);
  font-size: 0.9rem;
  border-radius: 0;
  background: rgba(0, 0, 0,1);
  color: var(--ink);
  box-shadow: none;
}

/* Float compose actions inside their respective field areas. */
#ask {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: auto;
  max-width: none;
  min-width: 72px;
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 1;
}

#upload-matter {
  position: static;
  justify-self: end;
  width: auto;
  max-width: none;
  min-width: 72px;
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 1;
}

/* Render output sections as soft inset cards. */
.output-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.99);
  padding: 14px;
  min-width: 0;
  background: rgba(0, 0, 0, 0.62);
}

.upload-output-card {
  min-height: 0;
}

.rail-section {
  display: grid;
  gap: 8px;
}

.rail-section-header h2 {
  margin: 0 0 6px 0;
}

.rail-section-body {
  display: grid;
  gap: 10px;
}

.rail-toolbar .pill {
  font-size: 0.82rem;
  padding: 6px 10px;
}

.rail-status {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Keep preformatted output readable without horizontal overflow. */
.output-card pre {
  margin: 0;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.55;
}

#upload-output {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Style each evidence snippet like a lightweight card. */
.evidence {
  padding: 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.74);
  border: 1px solid rgba(31, 42, 36, 0.08);
}

/* Render status badges as rounded inline chips. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  background: rgba(31, 42, 36, 0.08);
}

/* Tint successful badges with the positive status color. */
.badge.ok { color: var(--ok); }
/* Tint warning badges with the warning status color. */
.badge.warn { color: var(--warn); }

/* Make helper metadata slightly smaller and spaced from the content above it. */
.meta {
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Split paired controls and cards into two columns on wide screens. */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Keep the loaded-document list scrollable with tight card spacing. */
.document-list {
  display: grid;
  gap: 10px;
  max-height: 480px;
  min-width: 0;
  overflow-y: auto;
  padding-right: 4px;
}

/* Layout each loaded document row with a checkbox and content block. */
.document-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Highlight selected files in the scope list. */
.document-item.selected {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Keep the checkbox vertically aligned with the document text. */
.document-select {
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
}

/* Use a compact checkbox treatment. */
.document-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
}

/* Keep document text stacked cleanly beside the checkbox. */
.document-content {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.document-title-row {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.document-title-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Emphasize the document title inside each list row. */
.document-title {
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  min-width: 0;
  word-break: normal;
  overflow-wrap: anywhere;
}

.document-badge {
  justify-self: start;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 1);
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
  white-space: normal;
}

.document-badge.ok {
  color: var(--ok);
}

.document-badge.mixed {
  color: #f3d17b;
}

.document-badge.warn {
  color: var(--warn);
}

.document-badge.reviewed {
  color: #7fd6ff;
}

.document-review-action {
  width: auto;
  flex: 0 0 auto;
  cursor: pointer;
  font: inherit;
}

.document-review-action:hover:not(:disabled),
.document-review-action:focus-visible {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
}

/* Arrange toolbar buttons in a wrapping horizontal row. */
.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

/* Let toolbar pill buttons flex to fill the available row width evenly. */
.toolbar-row .pill {
  flex: 1 1 132px;
  text-align: center;
}

/* Allow the scope-toolbar pills to be slightly denser. */
.toolbar-row-compact .pill {
  flex-basis: 124px;
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  }

  .history-rail {
    grid-column: 1 / -1;
    grid-template-rows: auto minmax(240px, 1fr);
  }
}

.review-list {
  display: grid;
  gap: 14px;
  max-height: 540px;
  overflow-y: auto;
  padding-right: 4px;
}

.review-document-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.review-document-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.review-document-title {
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.review-document-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.review-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: var(--muted);
}

.review-badge-count {
  color: var(--warn);
}

.review-item-list {
  display: grid;
  gap: 10px;
}

.review-item-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.review-item-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.review-severity {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.review-severity.high {
  color: #ff9b90;
}

.review-severity.medium {
  color: #f3d17b;
}

.review-severity.low {
  color: #a7d7bf;
}

.review-confidence {
  font-size: 0.78rem;
  color: var(--muted);
}

.review-item-label {
  font-weight: 700;
  color: var(--ink);
}

.review-item-reason,
.review-item-evidence,
.review-item-answer {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.review-item-answer {
  color: var(--ink);
}

.review-item-answer-empty {
  color: var(--warn);
}

.review-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.review-link:hover,
.review-link:focus-visible {
  text-decoration: underline;
}

.review-item-evidence-meta {
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}

.review-evidence-icon {
  margin-left: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.review-item-editor {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.review-item-editor-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.review-item-editor-help {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

.review-item-form {
  display: grid;
  gap: 12px;
}

.review-item-field-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-item-field-grid-money {
  grid-template-columns: minmax(0, 1fr) 120px;
}

.review-item-field-grid-deposit {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.review-item-field-grid-settlement {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-input-group {
  display: grid;
  gap: 6px;
}

.review-input-group-wide {
  grid-column: 1 / -1;
}

.review-input-group-compact {
  max-width: 160px;
}

.review-input-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.review-item-input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 12, 12, 0.58);
  color: var(--ink);
  font: inherit;
}

.review-item-select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 12, 12, 0.58);
  color: var(--ink);
  font: inherit;
}

.review-item-input::placeholder {
  color: rgba(230, 230, 230, 0.42);
}

.review-item-input:focus-visible,
.review-item-select:focus-visible {
  outline: 2px solid rgba(198, 226, 255, 0.55);
  outline-offset: 2px;
  border-color: rgba(198, 226, 255, 0.45);
}

.review-item-textarea {
  min-height: 88px;
  resize: vertical;
}

.review-input-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-top: 26px;
  color: var(--ink);
}

.review-input-checkbox {
  inline-size: 16px;
  block-size: 16px;
}

.review-item-form-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

.review-save-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Collapse multi-column sections into one column on smaller screens. */
@media (max-width: 980px) {
  .hero,
  .workspace,
  .split {
    grid-template-columns: 1fr;
  }

  .review-item-field-grid,
  .review-item-field-grid-money,
  .review-item-field-grid-deposit,
  .review-item-field-grid-settlement {
    grid-template-columns: 1fr;
  }

  .review-input-group-compact {
    max-width: none;
  }

  .review-input-checkbox-label {
    padding-top: 4px;
  }

  .review-save-button {
    width: 100%;
    justify-content: center;
  }

  .hero-card {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hero-card p {
    grid-column: 1;
    grid-row: auto;
    margin-top: 2px;
  }

  .chat-main {
    order: 1;
  }

  .left-rail {
    order: 2;
  }

  .history-rail {
    order: 3;
  }

  .shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body {
    overflow: auto;
  }

  .history-rail,
  .left-rail {
    grid-column: auto;
  }

  .chat-list-open {
    padding-right: 0;
  }

  .chat-list-actions {
    position: static;
    padding-left: 0;
  }

  .question-compose textarea {
    min-height: 58px;
    padding-right: 82px;
  }

  .upload-compose {
    padding-right: 16px;
    padding-bottom: 72px;
  }

  .section-row,
  .chat-main-header,
  .chat-header {
    flex-direction: column;
    align-items: stretch;
  }

  .history-toolbar {
    grid-template-columns: 1fr;
  }

  #new-chat {
    width: 100%;
  }

  .chat-footer-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-note {
    grid-column: 1 / -1;
    text-align: left;
  }
}

/* Strong overrides for history rail layout to avoid cross-item overlapping. */
.history-rail .chat-list,
.history-rail #chat-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  overflow-y: auto !important;
  min-height: 0 !important;
}

.history-rail .chat-list-item {
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  z-index: 0 !important;
  overflow: visible !important;
  margin: 0 !important;
}

.history-rail .chat-list-row {
  display: flex !important;
  gap: 10px !important;
  align-items: flex-start !important;
}

.history-rail .chat-list-actions {
  position: relative !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  padding-left: 0 !important;
  border-top: none !important;
}

.history-rail .chat-list-open {
  display: block !important;
  padding-right: 12px !important;
}

.history-rail .chat-list-checkbox {
  position: relative !important;
  z-index: 1 !important;
}

/* Workaround: force composite layers and disable backdrop-filter on history items
   to avoid GPU/compositor rendering artefacts in some browsers/drivers. */
.history-rail .chat-list-item,
.history-rail .chat-list-row,
.history-rail .chat-list-open {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform, opacity;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

.history-rail .chat-list-item {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background-clip: padding-box !important;
}

/* Remove heavy backdrop-filter and provide a stable background on the history rail
   to avoid GPU/compositor visual artifacts on some systems. */
.history-rail {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: rgba(0,0,0,0.64) !important;
}