/* NOX Mevzuat Admin Panel Styles */
:root {
  --bg-main: #0a0d14;
  --bg-sidebar: #0e131f;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-hover: rgba(26, 34, 52, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);

  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.35);
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #8b5cf6 100%);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --rose: #f43f5e;
  --rose-bg: rgba(244, 63, 94, 0.12);
  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.12);
  --cyan: #06b6d4;
  --cyan-bg: rgba(6, 182, 212, 0.12);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.admin-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.admin-sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.14);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.nav-count {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.badge-remote {
  background: var(--amber-bg);
  color: var(--amber);
}

.sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-return-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s;
}

.btn-return-chat:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.system-mini-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

/* Main Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.04) 0%, transparent 60%);
}

.admin-topbar {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 13, 20, 0.8);
  backdrop-filter: blur(12px);
}

.admin-topbar h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: transform 0.15s, opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Scroll Content */
.admin-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 60px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s;
}

.metric-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.icon-emerald { background: var(--emerald-bg); color: var(--emerald); }
.icon-amber { background: var(--amber-bg); color: var(--amber); }

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.metric-val {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  margin: 2px 0;
}

.metric-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Sections */
.admin-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtext {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Installed Laws Grid */
.installed-laws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.law-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.law-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  opacity: 0.8;
}

.law-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.law-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.law-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.law-sopi {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.badge-status {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-status.ready {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.processing {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.law-stats-row {
  display: flex;
  gap: 18px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.law-stat-item {
  display: flex;
  flex-direction: column;
}

.law-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.law-stat-val {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
}

/* Progress bar inside card */
.law-progress-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Keywords Preview */
.law-keywords-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kw-preview-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kw-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kw-pill {
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Law Card Actions */
.law-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-inspect {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.16);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-inspect:hover {
  background: rgba(99, 102, 241, 0.28);
  color: #fff;
  border-color: #818cf8;
}

.btn-action-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-action-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Catalog Table */
.catalog-search-box input {
  background: rgba(18, 24, 38, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  color: #fff;
  font-size: 0.85rem;
  width: 260px;
  outline: none;
  transition: border-color 0.2s;
}

.catalog-search-box input:focus {
  border-color: #818cf8;
}

.catalog-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.catalog-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.catalog-table th {
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
}

.catalog-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.catalog-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.law-title-cell {
  font-weight: 600;
  color: #fff;
}

.sopi-mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.badge-catalog-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-catalog-status.installed {
  background: var(--emerald-bg);
  color: var(--emerald);
}

.badge-catalog-status.ready-to-import {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.btn-import {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-import:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-import:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================
   INSPECTOR MODAL / DRAWER
========================================== */
.inspector-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.inspector-modal-backdrop.open {
  display: flex;
}

.inspector-modal {
  width: 1000px;
  max-width: 95vw;
  height: 88vh;
  background: var(--bg-sidebar);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.inspector-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: rgba(14, 19, 31, 0.95);
}

.inspector-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #818cf8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inspector-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 2px;
}

.inspector-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.inspector-search-bar {
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 14px;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

.inspector-search-bar input {
  flex: 1;
  background: rgba(18, 24, 38, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

.inspector-search-bar input:focus {
  border-color: #818cf8;
}

.items-count-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Provision Inspector Card */
.prov-item-card {
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s;
}

.prov-item-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.prov-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prov-badge-num {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #818cf8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prov-status-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
}

.prov-status-pill.current {
  background: var(--emerald-bg);
  color: var(--emerald);
}

.prov-status-pill.historic {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.prov-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

/* AI Metadata Blocks */
.prov-summary-box {
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid #6366f1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.box-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #a5b4fc;
  letter-spacing: 0.04em;
}

.box-content {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #e2e8f0;
}

/* Sanctions & Obligation Box */
.prov-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-block {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.detail-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-val {
  font-size: 0.82rem;
  color: var(--text-main);
}

.sanctions-val {
  color: #fb7185;
}

/* Keywords Tags */
.prov-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 4px;
}

.pill-kw {
  font-size: 0.73rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.pill-concept {
  font-size: 0.73rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Original Law Text Toggle */
.law-raw-collapsible {
  margin-top: 4px;
}

.raw-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
}

.raw-toggle-btn:hover {
  color: #fff;
}

.raw-body-content {
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.6;
  color: #cbd5e1;
  white-space: pre-wrap;
  display: none;
}

.raw-body-content.open {
  display: block;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: #1e293b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.success { border-left: 4px solid var(--emerald); }
.toast.error { border-left: 4px solid var(--rose); }
.toast.info { border-left: 4px solid #818cf8; }

/* --- Chat Histories & Inspector Styles --- */
.badge-chats {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.chat-modal-wide {
  max-width: 980px;
  width: 92%;
  height: 86vh;
}

.chat-dialogue-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-dialogue-turn {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.turn-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-turn-q {
  background: #4f46e5;
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.badge-turn-a {
  background: #059669;
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.turn-author {
  font-weight: 600;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.turn-timestamp {
  font-size: 0.75rem;
  color: #64748b;
  font-family: var(--font-mono);
  margin-left: auto;
}

.turn-user-bubble {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: #f1f5f9;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
}

.turn-assistant-bubble {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.turn-assistant-bubble p {
  margin: 0 0 10px 0;
}

.turn-assistant-bubble strong {
  color: #fff;
}

.turn-assistant-bubble ul {
  margin: 8px 0 12px 18px;
  padding: 0;
}

.turn-assistant-bubble li {
  margin-bottom: 4px;
}

.search-query-trace {
  background: rgba(14, 165, 233, 0.08);
  border: 1px dashed rgba(14, 165, 233, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-query-trace .trace-label {
  color: #38bdf8;
  font-weight: 600;
}

.search-query-trace code {
  color: #7dd3fc;
  font-family: var(--font-mono);
}

.chat-turn-citations {
  margin-top: 10px;
  background: rgba(18, 24, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 14px;
}

.citations-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.citations-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.citation-mini-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 10px;
  font-size: 0.8rem;
  transition: border-color 0.2s;
}

.citation-mini-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.cite-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 4px;
  color: #f1f5f9;
}

.cite-validity {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  font-weight: 600;
}

.cite-heading {
  font-weight: 600;
  color: #818cf8;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.cite-summary {
  color: #94a3b8;
  font-size: 0.76rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-turn-separator {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 16px 0;
}
