/* ── Document AI for Claim – Refined Console ── */

/* ── Global ── */
*,
*::before,
*::after {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { scroll-behavior: smooth; }

::selection {
  background: rgb(13 148 136 / 0.18);
  color: #0f172a;
}

/* ── Background mesh ── */
.bg-mesh {
  background-image:
    radial-gradient(at 20% 10%, rgb(13 148 136 / 0.06) 0, transparent 50%),
    radial-gradient(at 80% 90%, rgb(99 102 241 / 0.05) 0, transparent 50%),
    radial-gradient(at 50% 50%, rgb(20 184 166 / 0.03) 0, transparent 70%);
}

/* ── Focus ring ── */
:focus-visible {
  outline: 2px solid rgb(13 148 136 / 0.5);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── Card base ── */
.card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 8px 24px -4px rgb(0 0 0 / 0.06);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
  box-shadow: 0 4px 12px 0 rgb(0 0 0 / 0.06), 0 16px 40px -8px rgb(0 0 0 / 0.1);
}

/* ── Nav pills ── */
.nav-pill {
  position: relative;
}

.nav-pill.active,
.nav-pill[aria-current="page"] {
  background: rgb(13 148 136 / 0.1);
  color: #0d9488;
}

.nav-pill.active svg,
.nav-pill[aria-current="page"] svg {
  color: #0d9488;
}

/* ── Preview page indicator dot ── */
.preview-page.border-accent::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: #0d9488;
  margin: 10px auto 0;
}

.preview-page-filmstrip {
  max-height: 28rem;
  overflow: auto;
  padding-right: 0.25rem;
}

.preview-page-thumb-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  min-width: 84px;
  min-height: 108px;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.preview-page[aria-current="page"] .preview-page-thumb-shell {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.12);
}

.preview-page-thumb-placeholder {
  display: flex;
  min-height: 108px;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.preview-page-thumb-canvas {
  display: block;
  width: 84px;
  height: auto;
  background: white;
}

.line-clamp-2 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pdf-viewer-stage {
  min-height: 320px;
}

.pdf-canvas-wrap {
  max-height: 520px;
  overscroll-behavior: contain;
  background:
    linear-gradient(180deg, rgb(248 250 252 / 0.9) 0%, rgb(255 255 255 / 1) 22%),
    linear-gradient(90deg, rgb(226 232 240 / 0.7) 1px, transparent 1px),
    linear-gradient(rgb(226 232 240 / 0.7) 1px, transparent 1px);
  background-size: auto, 18px 18px, 18px 18px;
}

.pdf-canvas {
  display: block;
  max-width: none;
}

.pdf-toolbar-chip {
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: #f8fafc;
  padding: 0.25rem 0.5rem;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pdf-toolbar-chip:hover,
.pdf-toolbar-chip:focus-visible {
  background: #e2e8f0;
  color: #0f172a;
}

.pdf-toolbar-link {
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid rgb(13 148 136 / 0.18);
  background: rgb(13 148 136 / 0.06);
  padding: 0.25rem 0.6rem;
  font-size: 10px;
  font-weight: 700;
  color: #0d9488;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pdf-toolbar-link:hover,
.pdf-toolbar-link:focus-visible {
  border-color: rgb(13 148 136 / 0.3);
  background: rgb(13 148 136 / 0.12);
  color: #0f766e;
}

.field-page-jump svg {
  flex-shrink: 0;
}

.field-jump-highlight {
  border-color: rgb(20 184 166 / 0.48);
  box-shadow: 0 0 0 3px rgb(20 184 166 / 0.12);
}

/* ── HTMX transition states ── */
.htmx-request {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.htmx-settling {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.htmx-added {
  opacity: 0;
  transform: translateY(8px);
}

.htmx-added.htmx-settling {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.35s ease;
}

/* ── Drag & drop zone ── */
.upload-zone {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, rgb(248 250 252) 0%, rgb(240 244 248) 100%);
  isolation: isolate;
  transition: all 0.3s ease;
  overflow: hidden;
}

.upload-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgb(13 148 136 / 0) 0%, rgb(13 148 136 / 0) 100%);
  pointer-events: none;
  transition: background 0.3s ease;
}

.upload-zone > * {
  position: relative;
  z-index: 1;
}

#drop-prompt {
  pointer-events: none;
  position: relative;
  z-index: 2;
}

#drop-prompt .btn,
#drop-prompt label,
#drop-prompt a,
#drop-prompt button,
#drop-prompt input {
  pointer-events: auto;
  position: relative;
  z-index: 3;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #0d9488;
  background: linear-gradient(135deg, rgb(240 253 250) 0%, rgb(236 254 246) 100%);
  box-shadow: 0 0 0 4px rgb(13 148 136 / 0.08);
}

.upload-zone:hover::before,
.upload-zone.drag-over::before {
  background: linear-gradient(135deg, rgb(13 148 136 / 0.02) 0%, rgb(13 148 136 / 0.04) 100%);
}

/* ── Stat cards ── */
.stat-card {
  border-radius: 0.875rem;
  padding: 1rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 0 0 0 60%;
  opacity: 0.08;
}

.stat-card-amber { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); }
.stat-card-amber::after { background: #d97706; }
.stat-card-rose { background: linear-gradient(135deg, #fff1f2 0%, #fecdd3 100%); }
.stat-card-rose::after { background: #dc2626; }
.stat-card-emerald { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); }
.stat-card-emerald::after { background: #059669; }
.stat-card-neutral { background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); }
.stat-card-neutral::after { background: #64748b; }

/* ── Confidence visualization ── */
.confidence-distribution-list {
  display: grid;
  gap: 0.75rem;
}

.confidence-distribution-row {
  display: grid;
  gap: 0.375rem;
}

.confidence-meter {
  width: 100%;
  height: 0.625rem;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-radius: 9999px;
  overflow: hidden;
  background: #e2e8f0;
}

.confidence-meter::-webkit-progress-bar {
  background: #e2e8f0;
  border-radius: 9999px;
}

.confidence-meter::-webkit-progress-value {
  border-radius: 9999px;
}

.confidence-meter::-moz-progress-bar {
  border-radius: 9999px;
}

.confidence-meter-high::-webkit-progress-value { background: #10b981; }
.confidence-meter-high::-moz-progress-bar { background: #10b981; }

.confidence-meter-review::-webkit-progress-value { background: #f59e0b; }
.confidence-meter-review::-moz-progress-bar { background: #f59e0b; }

.confidence-meter-critical::-webkit-progress-value { background: #f43f5e; }
.confidence-meter-critical::-moz-progress-bar { background: #f43f5e; }

.confidence-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  border-radius: 0.625rem;
  padding: 0.375rem 0.5rem;
}

.confidence-chip-high {
  background: #d1fae5;
  color: #047857;
}

.confidence-chip-review {
  background: #fef3c7;
  color: #b45309;
}

.confidence-chip-critical {
  background: #ffe4e6;
  color: #be123c;
}

/* ── Confidence badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-high { background: #d1fae5; color: #059669; }
.badge-review { background: #fef3c7; color: #d97706; }
.badge-critical { background: #fecdd3; color: #dc2626; }

/* ── Field card confidence borders ── */
.field-critical {
  border-color: #fca5a5;
  background: linear-gradient(135deg, rgba(255,241,242,0.6) 0%, rgba(254,226,226,0.3) 100%);
}

.field-review {
  border-color: #fcd34d;
  background: linear-gradient(135deg, rgba(255,251,235,0.6) 0%, rgba(254,243,199,0.3) 100%);
}

.field-high {
  border-color: #e2e8f0;
  background: linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(241,245,249,0.5) 100%);
}

/* ── Button styles ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: white;
  box-shadow: 0 2px 8px rgb(13 148 136 / 0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgb(13 148 136 / 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: #334155;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.btn-secondary:hover {
  border-color: #0d9488;
  color: #0d9488;
  box-shadow: 0 2px 8px rgb(13 148 136 / 0.08);
}

.btn-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
  border: 1px solid #fcd34d;
}

.btn-warning:hover {
  box-shadow: 0 2px 8px rgb(217 119 6 / 0.15);
}

.btn-dark {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.2);
}

.btn-dark:hover {
  box-shadow: 0 4px 16px rgb(15 23 42 / 0.3);
  transform: translateY(-1px);
}

/* ── Timeline connector ── */
.timeline-item {
  position: relative;
  padding-left: 2.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 2.5rem;
  bottom: -1rem;
  width: 2px;
  background: linear-gradient(to bottom, #e2e8f0, transparent);
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: white;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-dot.done {
  border-color: #059669;
  background: #d1fae5;
}

/* ── Sticky action bar glass ── */
.action-bar {
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 1rem;
  box-shadow: 0 -4px 24px rgb(0 0 0 / 0.06);
}

/* ── Success celebration ── */
.success-glow {
  position: relative;
}

.success-glow::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgb(5 150 105 / 0.15), rgb(20 184 166 / 0.1), rgb(5 150 105 / 0.05));
  z-index: -1;
}

/* ── Scrollbar custom ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Assistant sidebar ── */
.claimai-shell {
  transition: padding-right 0.25s ease;
}

.assistant-widget {
  transition: width 0.25s ease, inset 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.assistant-widget-launcher {
  display: inline-flex;
  height: 2.75rem;
  width: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(255 255 255 / 0.76);
  border-radius: 9999px;
  background: linear-gradient(135deg, #0d9488 0%, #10b981 100%);
  color: white;
  box-shadow: 0 18px 42px -26px rgb(15 23 42 / 0.42);
  pointer-events: auto;
}

.assistant-widget-dismiss-fab {
  display: none;
  position: absolute;
  top: -0.12rem;
  right: -0.12rem;
  z-index: 3;
  height: 1.75rem;
  width: 1.75rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: white;
  box-shadow: none;
  pointer-events: auto;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.assistant-widget-dismiss-fab::before {
  content: "";
  position: absolute;
  inset: 0.16rem;
  border: 1px solid rgb(255 255 255 / 0.34);
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.06);
  box-shadow: 0 10px 22px -18px rgb(15 23 42 / 0.34);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.assistant-widget-dismiss-fab svg {
  position: relative;
  z-index: 1;
  height: 0.72rem;
  width: 0.72rem;
}

.assistant-widget-dismiss-fab:hover,
.assistant-widget-dismiss-fab:focus-visible {
  transform: translateY(-1px);
}

.assistant-widget-dismiss-fab:hover::before,
.assistant-widget-dismiss-fab:focus-visible::before {
  background: rgb(255 255 255 / 0.12);
  border-color: rgb(255 255 255 / 0.46);
  box-shadow: 0 12px 24px -18px rgb(15 23 42 / 0.4);
}

.assistant-widget[data-visibility="dismissed"] {
  display: none;
  width: auto;
  min-width: 0;
  max-width: none;
  top: auto;
  left: auto;
  right: 1.25rem;
  bottom: 1.25rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  pointer-events: none;
}

.assistant-widget[data-visibility="dismissed"] .assistant-widget-shell {
  display: none !important;
}

.assistant-widget[data-visibility="visible"] .assistant-widget-launcher {
  display: none !important;
}

.assistant-widget[data-visibility="dismissed"] .assistant-widget-launcher {
  display: none !important;
}

.assistant-widget[data-visibility="dismissed"] .assistant-widget-dismiss-fab,
.assistant-widget[data-visibility="dismissed"] .assistant-widget-dismiss-inline {
  display: none !important;
}

.assistant-widget-brandmark {
  display: inline-flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 0.14);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
  color: white;
  flex-shrink: 0;
}

.assistant-widget [data-assistant-toggle] {
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

.assistant-widget [data-assistant-toggle] svg {
  filter: drop-shadow(0 1px 1px rgb(15 23 42 / 0.12));
}

.assistant-widget[data-mode="collapsed"] {
  width: 4.75rem;
  max-width: 4.75rem;
  overflow: visible;
  border-radius: 9999px;
  border-color: rgb(255 255 255 / 0.72);
  box-shadow: 0 18px 42px -26px rgb(15 23 42 / 0.42);
  transform-origin: bottom right;
}

.assistant-widget[data-mode="collapsed"] .assistant-widget-shell {
  background: transparent;
}

.assistant-widget[data-mode="collapsed"] .assistant-widget-header {
  justify-content: center;
  gap: 0;
  min-height: 4.75rem;
  border-bottom: 0;
  padding: 0.75rem;
  border-radius: 9999px;
}

.assistant-widget[data-mode="collapsed"] .assistant-header-actions {
  gap: 0;
}

.assistant-widget[data-mode="collapsed"] .assistant-widget-brand {
  display: none;
}

.assistant-widget[data-mode="collapsed"] .assistant-widget-dismiss-inline {
  display: none;
}

.assistant-widget[data-mode="collapsed"] .assistant-widget-dismiss-fab {
  display: inline-flex;
}

.assistant-widget[data-mode="collapsed"] [data-assistant-toggle] {
  height: 3rem;
  width: 3rem;
  background: rgb(255 255 255 / 0.14);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

.assistant-widget[data-mode="collapsed"] .assistant-widget-body {
  display: none !important;
}

.assistant-widget--integration[data-mode="collapsed"] {
  right: 0.9rem;
  bottom: 0.9rem;
  width: 4.75rem;
  max-width: 4.75rem;
  border-radius: 9999px;
  border-color: rgb(255 255 255 / 0.72);
  transform: none;
  transform-origin: bottom right;
  box-shadow: 0 18px 42px -26px rgb(15 23 42 / 0.42);
}

.assistant-widget--integration[data-mode="collapsed"] .assistant-widget-header {
  justify-content: center;
  gap: 0;
  min-height: 4.75rem;
  border-bottom: 0;
  padding: 0.75rem;
  border-radius: 9999px;
}

.assistant-widget--integration[data-mode="collapsed"] .assistant-widget-brand {
  display: none;
}

.assistant-widget--integration[data-mode="collapsed"] [data-assistant-toggle] {
  height: 3rem;
  width: 3rem;
  background: rgb(255 255 255 / 0.14);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

.assistant-widget--integration[data-mode="expanded"] {
  transform: none;
}

body.integration-flow-fullscreen-open {
  overflow: hidden;
}

body.integration-flow-fullscreen-open .assistant-widget {
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem) scale(0.94);
}

body.run-inspect-open {
  overflow: hidden;
}

.run-inspect-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  background: rgb(15 23 42 / 0.3);
  backdrop-filter: blur(14px);
  transition: opacity 0.28s ease;
}

.run-inspect-backdrop[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
}

.run-inspect-shell {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  visibility: hidden;
}

.run-inspect-shell[data-open="true"] {
  visibility: visible;
  pointer-events: auto;
}

.run-inspect-dialog {
  display: flex;
  width: min(72rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  min-height: min(38rem, calc(100vh - 2rem));
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(1rem) scale(0.965);
  box-shadow: 0 30px 80px -36px rgb(15 23 42 / 0.42);
  transition: opacity 0.24s ease, transform 0.24s ease, box-shadow 0.28s ease;
  will-change: transform, opacity;
}

.run-inspect-shell[data-open="true"] .run-inspect-dialog {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.run-inspect-pre {
  flex: 1 1 auto;
  min-height: 18rem;
  max-height: min(52vh, 34rem);
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.integration-flow-card-host {
  position: relative;
}

.integration-flow-card {
  position: relative;
  will-change: transform, width, height;
  transition: box-shadow 0.28s ease, border-radius 0.28s ease;
}

.integration-flow-card-ghost {
  position: fixed !important;
  z-index: 85;
  pointer-events: none;
  overflow: hidden;
  will-change: transform, opacity;
}

.integration-flow-card-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0;
  background: rgb(15 23 42 / 0.08);
  backdrop-filter: blur(2px);
  transition: opacity 0.12s ease-out;
}

.integration-flow-card-backdrop[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
}

.integration-flow-card-close {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.5rem) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.integration-flow-card[data-fullscreen="true"] {
  position: fixed;
  inset: 1rem;
  z-index: 80;
  margin: 0;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 1.75rem;
  box-shadow: 0 30px 80px -36px rgb(15 23 42 / 0.42);
}

.integration-flow-card[data-fullscreen="true"] .integration-flow-card-close {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.integration-flow-card[data-fullscreen="true"] .integration-flow-layout {
  grid-template-columns: minmax(0, 1.7fr) minmax(20rem, 0.9fr);
  align-items: start;
}

.integration-flow-card[data-fullscreen="true"] #flow-viewport {
  height: min(72vh, 52rem);
}

@media (max-width: 1279px) {
  .integration-flow-card[data-fullscreen="true"] .integration-flow-layout {
    grid-template-columns: 1fr;
  }
}

.assistant-widget[data-mode="expanded"] {
  top: 1rem;
  right: 1rem;
  bottom: 1rem;
  width: min(30rem, calc(100vw - 1.5rem));
  min-width: min(24rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  border-radius: 1.5rem;
}

.assistant-widget[data-mode="expanded"] .assistant-widget-dismiss-fab {
  display: none;
}

.assistant-widget[data-mode="expanded"] .assistant-widget-dismiss-inline {
  display: inline-flex;
}

.assistant-widget[data-mode="expanded"] .assistant-widget-shell {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.assistant-widget[data-mode="expanded"] .assistant-widget-body {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.assistant-widget-teaser {
  background: linear-gradient(180deg, rgb(255 255 255 / 1) 0%, rgb(248 250 252 / 0.95) 100%);
}

.assistant-shortcut-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assistant-context-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.92);
  color: #0f766e;
  font-size: 11px;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  box-shadow: 0 8px 20px -16px rgb(13 148 136 / 0.35);
}

.assistant-shortcut-card {
  display: block;
  min-height: 6.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: white;
  padding: 0.875rem;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.assistant-shortcut-card:hover,
.assistant-shortcut-card:focus-visible {
  border-color: rgb(13 148 136 / 0.4);
  box-shadow: 0 10px 30px -18px rgb(13 148 136 / 0.55);
  transform: translateY(-1px);
}

.assistant-shortcut-card--info {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.assistant-shortcut-card--success {
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
}

.assistant-shortcut-card--review {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}

.assistant-prompt-chip {
  border: 1px solid #dbeafe;
  border-radius: 9999px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.assistant-prompt-chip:hover,
.assistant-prompt-chip:focus-visible {
  background: #ecfeff;
  border-color: rgb(13 148 136 / 0.3);
  color: #0f766e;
}

.assistant-feed {
  flex: 1 1 auto;
  min-height: 16rem;
  max-height: min(48vh, 34rem);
  overscroll-behavior: contain;
}

.assistant-page-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.assistant-page-heading {
  display: grid;
  gap: 0.25rem;
}

.assistant-full-page-shell {
  flex: 1 1 auto;
  min-height: 0;
}

.assistant-full-page-shell--compact {
  grid-template-columns: minmax(0, 1fr);
}

.assistant-full-page-context-column--hidden {
  display: none !important;
}

.assistant-full-page-side,
.assistant-full-page-main,
.assistant-full-page-history-column,
.assistant-full-page-context-column {
  min-height: 0;
}

.assistant-page-feed {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 34rem;
  max-height: calc(100vh - 24rem);
}

.assistant-full-page-main {
  min-height: calc(100vh - 18rem);
}

.assistant-full-page-history-scroll {
  max-height: calc(100vh - 18rem);
}

.assistant-page-composer {
  scroll-margin-top: 1rem;
}

.assistant-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.assistant-composer-row--tight {
  align-items: center;
  gap: 0.5rem;
  padding: 0.24rem 0.28rem 0.28rem;
  border: 1px solid #cbd5e1;
  border-radius: 1.55rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.03), 0 10px 28px -24px rgb(15 23 42 / 0.24);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.assistant-composer-row--tight:focus-within {
  border-color: rgb(20 184 166 / 0.78);
  box-shadow: 0 0 0 3px rgb(20 184 166 / 0.12), 0 12px 28px -24px rgb(13 148 136 / 0.3);
  background: white;
}

.assistant-composer-textarea {
  min-height: 3.5rem;
  max-height: 15rem;
  resize: none;
  overflow-y: hidden;
  line-height: 1.6;
}

.assistant-composer-textarea--page {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 1.15rem;
  min-height: 2.85rem;
  padding-top: 0.68rem;
  padding-bottom: 0.62rem;
  padding-left: 0.8rem;
  padding-right: 0.8rem;
  line-height: 1.45;
}

.assistant-composer-textarea--page::placeholder {
  color: #94a3b8;
}

.assistant-composer-send {
  flex: 0 0 auto;
  min-width: 5.5rem;
  min-height: 3.5rem;
  align-self: center;
}

.assistant-composer-send--icon {
  min-width: 2.95rem;
  width: 2.95rem;
  height: 2.95rem;
  min-height: 2.95rem;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  box-shadow: 0 12px 28px -18px rgb(13 148 136 / 0.5);
}

.assistant-composer-send--icon:hover,
.assistant-composer-send--icon:focus-visible {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 16px 30px -18px rgb(13 148 136 / 0.56);
}

.assistant-composer-send-glyph {
  width: 1.05rem;
  height: 1.05rem;
}

.assistant-composer-disclaimer {
  margin-left: auto;
  margin-right: auto;
  max-width: 40rem;
  line-height: 1.5;
}

.assistant-composer-textarea[data-overflowing="true"] {
  overflow-y: auto;
}

.assistant-page-feed .assistant-data-table th,
.assistant-page-feed .assistant-data-table td {
  white-space: normal;
}

.assistant-widget[data-mode="expanded"] .assistant-feed {
  max-height: none;
}

.assistant-message-shell {
  width: 100%;
  border-radius: 1.25rem;
  padding: 0.875rem;
}

.assistant-message-shell-user {
  max-width: 85%;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: white;
}

.assistant-user-message-disclosure {
  margin-top: 0.25rem;
}

.assistant-user-message-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}

.assistant-user-message-summary::-webkit-details-marker {
  display: none;
}

.assistant-user-message-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: pre-line;
  word-break: break-word;
  flex: 1 1 auto;
}

.assistant-user-message-summary-action {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.82);
}

.assistant-user-message-action-less {
  display: none;
}

.assistant-user-message-full {
  margin-top: 0.75rem;
  white-space: pre-line;
}

.assistant-user-message-disclosure[open] .assistant-user-message-preview,
.assistant-user-message-disclosure[open] .assistant-user-message-action-more {
  display: none;
}

.assistant-user-message-disclosure[open] .assistant-user-message-action-less {
  display: inline;
}

.assistant-message-shell-assistant {
  max-width: 100%;
  border: 1px solid #e2e8f0;
  background: white;
  color: #334155;
  box-shadow: 0 8px 30px -22px rgb(15 23 42 / 0.24);
}

.assistant-block {
  display: grid;
  gap: 0.625rem;
}

.assistant-block-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.assistant-message-shell-user .assistant-block-title {
  color: rgb(255 255 255 / 0.72);
}

.assistant-fact-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.assistant-fact-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.95rem;
  background: #f8fafc;
  padding: 0.75rem;
}

.assistant-data-table th,
.assistant-data-table td {
  white-space: nowrap;
}

@media (min-width: 1280px) {
  body.assistant-sidebar-open .claimai-shell {
    padding-right: min(32rem, 34vw);
  }

  .assistant-page-section {
    min-height: calc(100dvh - 8rem);
  }

  .assistant-full-page-shell {
    height: var(--assistant-page-shell-height, calc(100dvh - 10rem));
    max-height: var(--assistant-page-shell-height, calc(100dvh - 10rem));
    align-items: stretch;
    overflow: hidden;
  }

  .assistant-full-page-shell--compact {
    grid-template-columns: 18rem minmax(0, 1fr);
  }

  .assistant-full-page-side,
  .assistant-full-page-main {
    min-height: 0;
    height: 100%;
  }

  .assistant-full-page-history-column,
  .assistant-full-page-context-column {
    display: flex;
    height: 100%;
    flex-direction: column;
  }

  .assistant-page-feed {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .assistant-full-page-history-column {
    min-height: 0;
  }

  .assistant-full-page-history-card {
    display: flex;
    min-height: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
  }

  .assistant-full-page-history-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .assistant-full-page-context-column {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 1024px) {
  .assistant-widget[data-mode="expanded"] {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    min-width: 0;
  }

  .assistant-widget--integration[data-mode="collapsed"] {
    right: 0.75rem;
    bottom: 0.75rem;
    width: 4.5rem;
    max-width: 4.5rem;
  }

  .integration-flow-card[data-fullscreen="true"] {
    inset: 0.6rem;
    max-height: calc(100vh - 1.2rem);
  }

  .run-inspect-shell {
    padding: 0.75rem;
  }

  .run-inspect-dialog {
    width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 1.5rem);
    min-height: min(32rem, calc(100vh - 1.5rem));
  }
}

@media (max-width: 640px) {
  .run-inspect-dialog {
    min-height: auto;
  }

  .run-inspect-pre {
    min-height: 14rem;
  }

  .assistant-widget-dismiss-fab {
    top: -0.08rem;
    right: -0.08rem;
  }
}

@media (max-width: 640px) {
  .assistant-composer-row {
    gap: 0.5rem;
  }

  .assistant-composer-row--tight {
    padding: 0.22rem 0.24rem 0.24rem;
    border-radius: 1.35rem;
  }

  .assistant-composer-send {
    min-width: 4.75rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .assistant-composer-send--icon {
    min-width: 2.8rem;
    width: 2.8rem;
    height: 2.8rem;
    min-height: 2.8rem;
    padding: 0;
  }

  .assistant-shortcut-grid {
    grid-template-columns: 1fr;
  }

  .assistant-message-shell-user {
    max-width: 100%;
  }
}
