/* ============================================================
   docstruct-ui.css  --  Unified design system
   ============================================================ */

/* ---- Confidence-level CSS variables ---- */
:root {
  --confidence-high: #3d8b40;
  --confidence-high-bg: rgba(61, 139, 64, 0.10);
  --confidence-medium: #b8892a;
  --confidence-medium-bg: rgba(184, 137, 42, 0.10);
  --confidence-low: #c23a2e;
  --confidence-low-bg: rgba(194, 58, 46, 0.10);
  --human-edited: #3868b8;
  --human-edited-bg: rgba(56, 104, 184, 0.10);

  /* ---- Glass morphism system ---- */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-heavy: rgba(255, 255, 255, 0.72);
  --glass-bg-light: rgba(255, 255, 255, 0.35);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-border-subtle: rgba(200, 185, 168, 0.35);
  --glass-blur: 16px;
  --glass-blur-heavy: 24px;
  --glass-shadow: 0 4px 24px rgba(30, 26, 21, 0.06), 0 1px 3px rgba(30, 26, 21, 0.04);
  --glass-shadow-lg: 0 8px 32px rgba(30, 26, 21, 0.08), 0 2px 8px rgba(30, 26, 21, 0.04);
  --glass-shadow-hover: 0 8px 32px rgba(30, 26, 21, 0.10), 0 2px 12px rgba(30, 26, 21, 0.06);
  --glass-transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Typography helpers ---- */
.ds-tabular-nums {
  font-variant-numeric: tabular-nums;
}

.ds-mono {
  font-family: 'Fira Code', 'SF Mono', 'Consolas', monospace;
  font-size: 0.88em;
  letter-spacing: 0.01em;
}

/* ---- Unified navigation shell ---- */
.ds-global-nav {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(200, 185, 168, 0.35);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: 52px;
  box-shadow: 0 1px 3px rgba(30, 26, 21, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.3);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  gap: 0;
  transition: box-shadow var(--glass-transition);
}

.ds-nav-brand {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: var(--text, #1e1a15);
  margin-right: 1.25rem;
  flex-shrink: 0;
}

.ds-nav-brand img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  margin-right: 0.4rem;
}

.ds-nav-brand .brand-doc {
  display: inline-flex;
  letter-spacing: -0.02em;
}

.ds-nav-brand .brand-doc span {
  display: inline-block;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent, #cf6d35);
  line-height: 1;
}

.ds-nav-brand .brand-doc .c-d { transform: rotate(-7deg) translateY(1px); }
.ds-nav-brand .brand-doc .c-o { transform: rotate(4deg) translateY(-2px); font-size: 1.35rem; }
.ds-nav-brand .brand-doc .c-c { transform: rotate(-2deg); }

.ds-nav-brand .brand-arrow {
  display: inline-block;
  margin: 0 0.05em;
  color: var(--accent, #cf6d35);
  font-size: 0.55rem;
  font-weight: 400;
  opacity: 0.4;
}

.ds-nav-brand .brand-struct {
  font-family: 'Fira Code', 'SF Mono', monospace;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text, #1e1a15);
  letter-spacing: 0.03em;
}

/* Navigation links */
.ds-nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
}

.ds-nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.9rem;
  height: 100%;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted, #9a8e80);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.ds-nav-link:hover {
  color: var(--text, #1e1a15);
}

.ds-nav-link.active {
  color: var(--accent, #cf6d35);
  border-bottom-color: var(--accent, #cf6d35);
  font-weight: 600;
}

.ds-nav-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Separator between global nav and step nav */
.ds-nav-sep {
  width: 1px;
  height: 24px;
  background: var(--border, #e5dbd0);
  margin: 0 0.5rem;
  flex-shrink: 0;
}

/* Right-side actions */
.ds-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ds-nav-cmdk {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border, #e5dbd0);
  border-radius: 7px;
  background: var(--surface-alt, #f6f1eb);
  font-size: 0.75rem;
  color: var(--muted, #9a8e80);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.ds-nav-cmdk:hover {
  border-color: var(--accent, #cf6d35);
  color: var(--text, #1e1a15);
}

.ds-nav-cmdk svg {
  width: 13px;
  height: 13px;
}

.ds-nav-api-indicator {
  font-size: 0.72rem;
  color: var(--muted, #9a8e80);
  white-space: nowrap;
}

.ds-nav-icon-btn {
  background: none;
  border: 1px solid var(--border, #e5dbd0);
  border-radius: 7px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted, #9a8e80);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.ds-nav-icon-btn:hover {
  border-color: var(--accent, #cf6d35);
  color: var(--accent, #cf6d35);
  background: rgba(207, 109, 53, 0.05);
}


/* ---- Confidence badges / pills ---- */
.ds-confidence-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.4;
}

.ds-confidence-pill--high {
  background: var(--confidence-high-bg);
  color: var(--confidence-high);
}

.ds-confidence-pill--medium {
  background: var(--confidence-medium-bg);
  color: var(--confidence-medium);
}

.ds-confidence-pill--low {
  background: var(--confidence-low-bg);
  color: var(--confidence-low);
}

.ds-confidence-pill--edited {
  background: var(--human-edited-bg);
  color: var(--human-edited);
}

/* Icon inside pill for colorblind accessibility */
.ds-confidence-pill .ds-pill-icon {
  display: inline-flex;
  align-items: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.ds-confidence-pill .ds-pill-icon svg {
  width: 12px;
  height: 12px;
}

/* Small confidence dot for inline / per-cell use */
.ds-confidence-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: default;
}

.ds-confidence-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ds-confidence-dot--high::before { background: var(--confidence-high); }
.ds-confidence-dot--medium::before { background: var(--confidence-medium); }
.ds-confidence-dot--low::before { background: var(--confidence-low); }
.ds-confidence-dot--edited::before { background: var(--human-edited); }


/* ---- Data table upgrades ---- */

/* Sortable headers */
.ds-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.2em !important;
}

.ds-sortable::after {
  content: '\2195'; /* up-down arrow */
  position: absolute;
  right: 0.4em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7em;
  opacity: 0.35;
  transition: opacity 0.15s;
}

.ds-sortable:hover::after {
  opacity: 0.7;
}

.ds-sortable.ds-sort-asc::after {
  content: '\2191'; /* up arrow */
  opacity: 0.85;
  color: var(--accent, #cf6d35);
}

.ds-sortable.ds-sort-desc::after {
  content: '\2193'; /* down arrow */
  opacity: 0.85;
  color: var(--accent, #cf6d35);
}

/* Inline editing focus style */
td[contenteditable]:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent, #cf6d35);
  border-radius: 3px;
  background: rgba(207, 109, 53, 0.04) !important;
}

/* Human-edited cell stripe */
.ds-cell-edited {
  border-left: 3px solid var(--human-edited) !important;
  background: var(--human-edited-bg) !important;
}


/* ---- Skeleton loading screen with shimmer ---- */
.ds-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-alt, #f6f1eb);
  border-radius: 6px;
}

.ds-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  animation: ds-shimmer 1.8s ease-in-out infinite;
}

@keyframes ds-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.ds-skeleton-line {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 4px;
}

.ds-skeleton-line:last-child {
  margin-bottom: 0;
}

.ds-skeleton-line--short { width: 40%; }
.ds-skeleton-line--medium { width: 70%; }
.ds-skeleton-line--long { width: 95%; }

.ds-skeleton-block {
  height: 120px;
  margin-bottom: 12px;
  border-radius: 8px;
}

/* Skeleton table rows */
.ds-skeleton-table {
  width: 100%;
  border-collapse: collapse;
}

.ds-skeleton-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border, #e5dbd0);
}

.ds-skeleton-table .ds-skeleton {
  height: 14px;
  width: 80%;
}


/* ---- Progressive LLM status display ---- */
.ds-progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.75rem 0;
}

.ds-progress-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted, #9a8e80);
  transition: color 0.2s;
  white-space: nowrap;
}

.ds-progress-step.active {
  color: var(--accent, #cf6d35);
  font-weight: 600;
}

.ds-progress-step.completed {
  color: var(--confidence-high);
}

.ds-progress-step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--surface-alt, #f6f1eb);
  color: var(--muted, #9a8e80);
  flex-shrink: 0;
  transition: all 0.2s;
}

.ds-progress-step.active .ds-progress-step-icon {
  background: var(--accent, #cf6d35);
  color: white;
}

.ds-progress-step.completed .ds-progress-step-icon {
  background: var(--confidence-high);
  color: white;
}

/* Spinner for active step */
.ds-progress-step.active .ds-progress-step-icon::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: ds-spin 0.8s linear infinite;
  position: absolute;
}

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

.ds-progress-connector {
  width: 28px;
  height: 2px;
  background: var(--border, #e5dbd0);
  flex-shrink: 0;
  border-radius: 1px;
  transition: background 0.3s;
}

.ds-progress-connector.completed {
  background: var(--confidence-high);
}


/* ---- Keyboard shortcut overlay ---- */
.ds-shortcut-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 21, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ds-fade-in 0.15s ease;
}

@keyframes ds-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ds-shortcut-panel {
  background: var(--surface, #fff);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(30, 26, 21, 0.18);
  padding: 1.5rem 2rem;
  max-width: 520px;
  width: 90vw;
  max-height: 75vh;
  overflow-y: auto;
}

.ds-shortcut-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ds-shortcut-panel h3 .ds-close-btn {
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--muted, #9a8e80);
  background: none;
  border: none;
  line-height: 1;
}

.ds-shortcut-group {
  margin-bottom: 1rem;
}

.ds-shortcut-group-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #9a8e80);
  margin-bottom: 0.5rem;
}

.ds-shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.85rem;
}

.ds-shortcut-row .ds-shortcut-keys {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}


/* ---- kbd tag styling ---- */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.35rem;
  background: var(--surface-alt, #f6f1eb);
  border: 1px solid var(--border, #e5dbd0);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text, #1e1a15);
  line-height: 1;
  white-space: nowrap;
}


/* ---- Command palette (Cmd+K) ---- */
.ds-command-palette {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 21, 0.55);
  z-index: 210;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  animation: ds-fade-in 0.12s ease;
}

.ds-command-panel {
  background: var(--surface, #fff);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(30, 26, 21, 0.22);
  width: 520px;
  max-width: 92vw;
  overflow: hidden;
}

.ds-command-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border, #e5dbd0);
}

.ds-command-input-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--muted, #9a8e80);
  flex-shrink: 0;
}

.ds-command-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-family: inherit;
  background: transparent;
  color: var(--text, #1e1a15);
}

.ds-command-input::placeholder {
  color: var(--muted, #9a8e80);
}

.ds-command-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 0.4rem 0;
}

.ds-command-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted, #9a8e80);
  font-size: 0.85rem;
}

.ds-command-group-label {
  padding: 0.5rem 1.1rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #9a8e80);
}

.ds-command-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text, #1e1a15);
  transition: background 0.1s;
}

.ds-command-item:hover,
.ds-command-item.ds-command-active {
  background: var(--accent-light, rgba(207, 109, 53, 0.08));
}

.ds-command-item.ds-command-active {
  background: var(--accent-light, rgba(207, 109, 53, 0.08));
}

.ds-command-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt, #f6f1eb);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.ds-command-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-command-item-shortcut {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}

.ds-command-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1.1rem;
  border-top: 1px solid var(--border, #e5dbd0);
  font-size: 0.72rem;
  color: var(--muted, #9a8e80);
}

.ds-command-footer span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}


/* ============================================================
   Enhanced Data Table — bulk actions, filter row, inline editing
   ============================================================ */

/* ---- Checkbox column ---- */
.ds-row-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #cf6d35);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.ds-checkbox-col {
  width: 36px;
  text-align: center;
  padding: 0.4rem 0.3rem !important;
}

/* ---- Floating bulk-action bar ---- */
.ds-bulk-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--text, #1e1a15);
  color: #fff;
  border-radius: 10px 10px 0 0;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 -4px 16px rgba(30, 26, 21, 0.18);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.2s ease;
  pointer-events: none;
}

.ds-bulk-bar.ds-bulk-bar--visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ds-bulk-bar-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 0.25rem;
}

.ds-bulk-bar-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.ds-bulk-bar-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.ds-bulk-bar-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.ds-bulk-bar-btn--deselect {
  margin-left: auto;
  background: transparent;
  border-color: transparent;
  opacity: 0.7;
}

.ds-bulk-bar-btn--deselect:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

/* ---- Filter row ---- */
.ds-filter-row td {
  padding: 0.25rem 0.35rem !important;
  background: var(--surface-alt, #f6f1eb);
  border-bottom: 2px solid var(--border, #e5dbd0);
}

.ds-filter-input {
  width: 100%;
  border: 1px solid var(--border, #e5dbd0);
  border-radius: 4px;
  padding: 0.25rem 0.4rem;
  font-size: 0.75rem;
  font-family: inherit;
  background: var(--surface, #fff);
  color: var(--text, #1e1a15);
  outline: none;
  transition: border-color 0.15s;
}

.ds-filter-input:focus {
  border-color: var(--accent, #cf6d35);
  box-shadow: 0 0 0 2px rgba(207, 109, 53, 0.12);
}

.ds-filter-input::placeholder {
  color: var(--muted, #9a8e80);
  font-size: 0.72rem;
}

.ds-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted, #9a8e80);
  background: var(--surface-alt, #f6f1eb);
  border-bottom: 1px solid var(--border, #e5dbd0);
}

.ds-filter-bar-count {
  font-variant-numeric: tabular-nums;
}

.ds-filter-bar-clear {
  background: none;
  border: none;
  color: var(--accent, #cf6d35);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.ds-filter-bar-clear:hover {
  background: rgba(207, 109, 53, 0.08);
}

/* ---- Improved inline editing ---- */
.ds-editing-cell {
  position: relative;
}

.ds-editing-cell input {
  width: 100%;
  border: 1px solid var(--accent, #cf6d35);
  border-radius: 3px;
  padding: 0.2rem 0.35rem;
  font-size: inherit;
  font-family: inherit;
  color: var(--text, #1e1a15);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(207, 109, 53, 0.15);
}

/* ---- Cell status indicators ---- */
.ds-cell-indicator {
  position: relative;
  padding-left: 1rem !important;
}

.ds-cell-dot {
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ds-cell-dot--high { background: var(--confidence-high); }
.ds-cell-dot--medium { background: var(--confidence-medium); }
.ds-cell-dot--low { background: var(--confidence-low); }
.ds-cell-dot--edited { background: var(--human-edited); }

.ds-cell-validation {
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
  flex-shrink: 0;
}

.ds-cell-validation svg {
  width: 12px;
  height: 12px;
}

.ds-cell-validation--ok { color: var(--confidence-high); }
.ds-cell-validation--warn { color: var(--confidence-medium); }
.ds-cell-validation--error { color: var(--confidence-low); }

.ds-source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--surface-alt, #f6f1eb);
  color: var(--muted, #9a8e80);
  border: 1px solid var(--border, #e5dbd0);
  cursor: default;
  white-space: nowrap;
  margin-left: 0.25rem;
}

/* ---- Toast notification (top-right slide-in) ---- */
.ds-toast-container {
  position: fixed;
  top: 4.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  pointer-events: none;
}

.ds-toast {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 12px rgba(30, 26, 21, 0.15);
  pointer-events: auto;
  animation: ds-toast-in 0.3s ease forwards;
  max-width: 320px;
}

.ds-toast--success { background: #2d7a30; }
.ds-toast--error { background: #b8342a; }
.ds-toast--info { background: var(--accent, #cf6d35); }

@keyframes ds-toast-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ds-toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

.ds-toast--dismiss {
  animation: ds-toast-out 0.25s ease forwards;
}

/* ---- Table row selection highlight ---- */
.ds-row-selected td {
  background: rgba(207, 109, 53, 0.06) !important;
}

.ds-row-selected:hover td {
  background: rgba(207, 109, 53, 0.10) !important;
}

/* ---- Hidden data rows (filtered out) ---- */
tr.ds-row-hidden {
  display: none;
}

/* ============================================================
   Visual Grounding — Split-pane layout & highlighting
   ============================================================ */

/* ---- Three-pane container ---- */
.vg-split-pane {
  display: grid;
  grid-template-columns: 60px 1fr 400px;
  gap: 0;
  height: 560px;
  border: 1px solid var(--border, #e5dbd0);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface, #fff);
}

/* ---- Page thumbnail strip ---- */
.vg-thumbnails {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 4px;
  overflow-y: auto;
  background: var(--surface-alt, #f6f1eb);
  border-right: 1px solid var(--border, #e5dbd0);
  scrollbar-width: thin;
}

.vg-thumbnails::-webkit-scrollbar { width: 4px; }
.vg-thumbnails::-webkit-scrollbar-thumb { background: var(--border, #e5dbd0); border-radius: 2px; }

.vg-thumb {
  position: relative;
  width: 48px;
  height: 62px;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--surface, #fff);
}

.vg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vg-thumb:hover {
  border-color: var(--accent, #cf6d35);
}

.vg-thumb.active {
  border-color: var(--accent, #cf6d35);
  box-shadow: 0 0 0 2px rgba(207, 109, 53, 0.25);
}

/* Dot indicator for pages with extracted data */
.vg-thumb-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #cf6d35);
  border: 1px solid var(--surface, #fff);
}

/* Inner dot for colorblind accessibility */
.vg-thumb-dot::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

/* Confidence-colored dot variants */
.vg-thumb-dot.conf-high {
  background: var(--success, #22863a);
}
.vg-thumb-dot.conf-mid {
  background: var(--warning, #d29922);
}
.vg-thumb-dot.conf-low {
  background: var(--error, #cb2431);
}

/* Placeholder thumbnail (no image available) */
.vg-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--surface-alt, #f6f1eb);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted, #9a8e80);
}

.vg-thumb-num {
  position: absolute;
  bottom: 1px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--muted, #9a8e80);
  background: rgba(255, 255, 255, 0.85);
  line-height: 1.3;
}

/* ---- Document viewer pane ---- */
.vg-doc-viewer {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface-alt, #f6f1eb);
  scrollbar-width: thin;
}

.vg-doc-viewer::-webkit-scrollbar { width: 6px; }
.vg-doc-viewer::-webkit-scrollbar-thumb { background: var(--border, #e5dbd0); border-radius: 3px; }

.vg-doc-viewer img { max-width: 100%; display: block; }

.vg-doc-viewer pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text, #1e1a15);
  padding: 1rem;
  margin: 0;
}

.vg-doc-page {
  position: relative;
  margin-bottom: 4px;
}

.vg-doc-page img {
  width: 100%;
  box-shadow: 0 1px 3px rgba(30, 26, 21, 0.08);
}

/* ---- Highlight overlays ---- */
.vg-highlight-rect {
  position: absolute;
  background: rgba(207, 109, 53, 0.20);
  border: 2px solid var(--accent, #cf6d35);
  border-radius: 2px;
  pointer-events: none;
  z-index: 5;
  animation: vg-fade-in 150ms ease-out both;
}

@keyframes vg-fade-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.vg-highlight-rect.locked {
  background: rgba(207, 109, 53, 0.30);
  border-width: 3px;
  box-shadow: 0 0 8px rgba(207, 109, 53, 0.3);
}

mark.vg-src-hl {
  background: rgba(207, 109, 53, 0.25);
  border-bottom: 2px solid var(--accent, #cf6d35);
  padding: 0 2px;
  border-radius: 2px;
  color: inherit;
  animation: vg-fade-in 150ms ease-out both;
}

mark.vg-src-hl.locked {
  background: rgba(207, 109, 53, 0.4);
  box-shadow: 0 0 4px rgba(207, 109, 53, 0.3);
}

/* ---- Data panel (right pane) ---- */
.vg-data-panel {
  overflow-y: auto;
  border-left: 1px solid var(--border, #e5dbd0);
  padding: 0;
  scrollbar-width: thin;
}

.vg-data-panel::-webkit-scrollbar { width: 6px; }
.vg-data-panel::-webkit-scrollbar-thumb { background: var(--border, #e5dbd0); border-radius: 3px; }

.vg-data-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border, #e5dbd0);
  background: var(--surface, #fff);
  position: sticky;
  top: 0;
  z-index: 2;
}

.vg-data-panel-header strong { font-size: 0.85rem; }

/* ---- Data field rows ---- */
.vg-field {
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--border, #e5dbd0);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  position: relative;
}

.vg-field:hover { background: rgba(207, 109, 53, 0.06); }

.vg-field.highlighted {
  background: rgba(207, 109, 53, 0.10);
  animation: vg-pulse 0.6s ease;
}

.vg-field.locked {
  background: rgba(207, 109, 53, 0.15);
  box-shadow: inset 3px 0 0 var(--accent, #cf6d35);
}

.vg-field.locked::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent, #cf6d35);
  border-radius: 0 2px 2px 0;
}

.vg-field:focus-visible {
  outline: 2px solid var(--accent, #cf6d35);
  outline-offset: -2px;
  border-radius: 4px;
}

.vg-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary, #5e5347);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vg-field-value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text, #1e1a15);
  word-break: break-word;
}

.vg-field-source {
  font-size: 0.72rem;
  color: var(--muted, #9a8e80);
  margin-top: 0.15rem;
  font-style: italic;
  line-height: 1.4;
  border-left: 2px solid var(--accent, #cf6d35);
  padding-left: 0.4rem;
}

.vg-field-page {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted, #9a8e80);
  background: var(--surface-alt, #f6f1eb);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.vg-field-lock-icon {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  color: var(--muted, #9a8e80);
  opacity: 0;
  transition: opacity 0.15s;
}

.vg-field:hover .vg-field-lock-icon,
.vg-field.locked .vg-field-lock-icon { opacity: 1; }

.vg-field.locked .vg-field-lock-icon { color: var(--accent, #cf6d35); }

@keyframes vg-pulse {
  0% { background: rgba(207, 109, 53, 0.25); }
  100% { background: rgba(207, 109, 53, 0.10); }
}

/* ---- Lock indicator badge ---- */
.vg-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent, #cf6d35);
  background: rgba(207, 109, 53, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.35rem;
}

/* ============================================================
   API Key Management Panel
   ============================================================ */

/* ---- Header with title + generate button ---- */
.ds-apikeys-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ds-apikeys-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text, #1e1a15);
  margin-bottom: 0.15rem;
}

.ds-apikeys-subtitle {
  font-size: 0.75rem;
  color: var(--muted, #9a8e80);
  line-height: 1.4;
}

.ds-apikeys-subtitle code {
  font-size: 0.72rem;
  background: var(--surface-alt, #f6f1eb);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  border: 1px solid var(--border, #e5dbd0);
}

.ds-apikeys-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--accent, #cf6d35);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.ds-apikeys-generate-btn:hover {
  background: #b85e2c;
  box-shadow: 0 2px 8px rgba(207, 109, 53, 0.25);
}

.ds-apikeys-generate-btn:active {
  transform: scale(0.98);
}

/* ---- One-time key display box ---- */
.ds-apikeys-newkey-box {
  margin-bottom: 1rem;
  border: 1px solid #e8c96a;
  border-radius: 8px;
  background: #fef9e7;
  padding: 0.75rem;
}

.ds-apikeys-newkey-warning {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #8a6d0b;
  margin-bottom: 0.6rem;
}

.ds-apikeys-newkey-warning svg {
  color: #b8892a;
  flex-shrink: 0;
}

.ds-apikeys-newkey-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid #e5dbd0;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
}

.ds-apikeys-newkey-value {
  flex: 1;
  font-family: 'Fira Code', 'SF Mono', 'Consolas', monospace;
  font-size: 0.82rem;
  color: var(--text, #1e1a15);
  word-break: break-all;
  line-height: 1.4;
  user-select: all;
}

.ds-apikeys-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.55rem;
  background: var(--surface-alt, #f6f1eb);
  border: 1px solid var(--border, #e5dbd0);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text, #1e1a15);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}

.ds-apikeys-copy-btn:hover {
  border-color: var(--accent, #cf6d35);
  color: var(--accent, #cf6d35);
  background: rgba(207, 109, 53, 0.05);
}

/* ---- Empty state ---- */
.ds-apikeys-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  color: var(--muted, #9a8e80);
  font-size: 0.82rem;
  text-align: center;
  border: 1px dashed var(--border, #e5dbd0);
  border-radius: 8px;
  background: var(--surface-alt, #f6f1eb);
}

.ds-apikeys-empty svg {
  opacity: 0.5;
}

/* ---- Keys table ---- */
.ds-apikeys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.ds-apikeys-table thead th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #9a8e80);
  padding: 0.4rem 0.6rem;
  border-bottom: 2px solid var(--border, #e5dbd0);
  white-space: nowrap;
}

.ds-apikeys-table tbody td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border, #e5dbd0);
  color: var(--text, #1e1a15);
  vertical-align: middle;
}

.ds-apikeys-table tbody tr:last-child td {
  border-bottom: none;
}

.ds-apikeys-table tbody tr:hover td {
  background: rgba(207, 109, 53, 0.04);
}

.ds-apikeys-prefix {
  font-family: 'Fira Code', 'SF Mono', 'Consolas', monospace;
  font-size: 0.78rem;
  background: var(--surface-alt, #f6f1eb);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border, #e5dbd0);
  color: var(--text, #1e1a15);
}

.ds-apikeys-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ---- Revoke button ---- */
.ds-apikeys-revoke-btn {
  padding: 0.25rem 0.55rem;
  background: none;
  border: 1px solid var(--confidence-low, #c23a2e);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--confidence-low, #c23a2e);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.ds-apikeys-revoke-btn:hover {
  background: var(--confidence-low, #c23a2e);
  color: #fff;
}

/* ---- Confirmation dialog overlay ---- */
.ds-apikeys-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 21, 0.55);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ds-fade-in 0.12s ease;
}

.ds-apikeys-confirm-box {
  background: var(--surface, #fff);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(30, 26, 21, 0.22);
  padding: 1.25rem 1.5rem;
  max-width: 420px;
  width: 90vw;
}

.ds-apikeys-confirm-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #1e1a15);
  margin-bottom: 0.6rem;
}

.ds-apikeys-confirm-msg {
  font-size: 0.82rem;
  color: var(--text-secondary, #5e5347);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.ds-apikeys-confirm-msg code {
  font-family: 'Fira Code', 'SF Mono', 'Consolas', monospace;
  font-size: 0.78rem;
  background: var(--surface-alt, #f6f1eb);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  border: 1px solid var(--border, #e5dbd0);
}

.ds-apikeys-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.ds-apikeys-confirm-cancel {
  padding: 0.4rem 0.85rem;
  background: var(--surface-alt, #f6f1eb);
  border: 1px solid var(--border, #e5dbd0);
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text, #1e1a15);
  cursor: pointer;
  transition: all 0.15s;
}

.ds-apikeys-confirm-cancel:hover {
  background: #ece5dc;
}

.ds-apikeys-confirm-revoke {
  padding: 0.4rem 0.85rem;
  background: var(--confidence-low, #c23a2e);
  border: none;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.ds-apikeys-confirm-revoke:hover {
  background: #a82f24;
  box-shadow: 0 2px 8px rgba(194, 58, 46, 0.3);
}

/* ---- Section divider for settings modal ---- */
.ds-settings-divider {
  border: none;
  border-top: 1px solid var(--border, #e5dbd0);
  margin: 1.25rem 0;
}


/* ============================================================
   Apple Glass Morphism — Frosted glass panels, micro-animations
   ============================================================ */

/* ---- Glass panel base ---- */
.ds-glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: box-shadow var(--glass-transition), transform var(--glass-transition);
}

.ds-glass:hover {
  box-shadow: var(--glass-shadow-hover);
}

.ds-glass--heavy {
  background: var(--glass-bg-heavy);
  -webkit-backdrop-filter: blur(var(--glass-blur-heavy)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur-heavy)) saturate(180%);
}

.ds-glass--light {
  background: var(--glass-bg-light);
}

/* ---- Glass cards (applied globally) ---- */
.ds-shortcut-panel,
.ds-command-panel,
.ds-apikeys-confirm-box {
  background: var(--glass-bg-heavy);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 48px rgba(30, 26, 21, 0.15), 0 4px 12px rgba(30, 26, 21, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ---- Glass overlays ---- */
.ds-shortcut-overlay,
.ds-command-palette,
.ds-apikeys-confirm-overlay {
  background: rgba(30, 26, 21, 0.40);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* ---- Nav link hover micro-animation ---- */
.ds-nav-link {
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ds-nav-link:hover {
  transform: translateY(-0.5px);
}

.ds-nav-link.active {
  transform: translateY(0);
}

/* ---- Command palette glass input ---- */
.ds-command-input-wrap {
  border-bottom: 1px solid var(--glass-border-subtle);
}

/* ---- Nav icon button glass effect ---- */
.ds-nav-icon-btn {
  transition: all 0.2s ease;
  border: 1px solid var(--glass-border-subtle);
}

.ds-nav-icon-btn:hover {
  background: var(--glass-bg-light);
  border-color: var(--accent, #cf6d35);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(207, 109, 53, 0.12);
}

/* ---- Cmd+K search button glass ---- */
.ds-nav-cmdk {
  border: 1px solid var(--glass-border-subtle);
  background: var(--glass-bg-light);
  transition: all 0.2s ease;
}

.ds-nav-cmdk:hover {
  background: var(--glass-bg);
  border-color: var(--accent, #cf6d35);
  transform: translateY(-0.5px);
  box-shadow: 0 2px 8px rgba(207, 109, 53, 0.10);
}

/* ---- Confidence pill glass background ---- */
.ds-confidence-pill {
  -webkit-backdrop-filter: blur(4px) saturate(120%);
  backdrop-filter: blur(4px) saturate(120%);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ds-confidence-pill:hover {
  transform: scale(1.03);
}

/* ---- Progress step micro-animation ---- */
.ds-progress-step {
  transition: color 0.25s ease, transform 0.2s ease;
}

.ds-progress-step.completed {
  animation: ds-step-complete 0.4s ease forwards;
}

@keyframes ds-step-complete {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.ds-progress-step-icon {
  transition: all 0.25s ease;
}

.ds-progress-connector {
  transition: background 0.4s ease;
}

/* ---- Toast glass effect ---- */
.ds-toast {
  background: rgba(255, 255, 255, 0.80);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 16px rgba(30, 26, 21, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.ds-toast--success { background: rgba(45, 122, 48, 0.88); }
.ds-toast--error { background: rgba(184, 52, 42, 0.88); }
.ds-toast--info { background: rgba(207, 109, 53, 0.88); }

/* ---- Bulk action bar glass ---- */
.ds-bulk-bar {
  background: rgba(30, 26, 21, 0.85);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
}

/* ---- Keyboard shortcut kbd glass ---- */
kbd {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-subtle);
  transition: transform 0.1s ease;
}

kbd:hover {
  transform: translateY(-1px);
}

/* ---- Sortable header hover ---- */
.ds-sortable {
  transition: background 0.15s ease;
}

.ds-sortable:hover {
  background: rgba(207, 109, 53, 0.04);
}

/* ---- Filter input glass ---- */
.ds-filter-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ds-filter-input:focus {
  background: var(--glass-bg-heavy);
}

/* ---- Visual grounding field hover glass ---- */
.vg-field {
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.vg-field:hover {
  background: rgba(207, 109, 53, 0.05);
  transform: translateX(2px);
}

.vg-field.locked {
  background: rgba(207, 109, 53, 0.12);
}

/* ---- API key generate button micro-animation ---- */
.ds-apikeys-generate-btn {
  transition: all 0.2s ease;
}

.ds-apikeys-generate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(207, 109, 53, 0.25);
}

.ds-apikeys-generate-btn:active {
  transform: scale(0.97) translateY(0);
}

/* ---- Copy button micro-animation ---- */
.ds-apikeys-copy-btn {
  transition: all 0.2s ease;
}

.ds-apikeys-copy-btn:hover {
  transform: translateY(-0.5px);
}

/* ---- Revoke button micro-animation ---- */
.ds-apikeys-revoke-btn {
  transition: all 0.2s ease;
}

.ds-apikeys-revoke-btn:hover {
  transform: translateY(-0.5px);
  box-shadow: 0 2px 8px rgba(194, 58, 46, 0.2);
}

/* ---- Skeleton loading enhanced shimmer ---- */
.ds-skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 100%
  );
}

/* ---- Smooth page transitions (for JS-controlled pages) ---- */
@keyframes ds-page-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ds-page-enter {
  animation: ds-page-enter 0.3s ease forwards;
}

/* ---- Table row hover glass ---- */
.ds-apikeys-table tbody tr {
  transition: background 0.15s ease;
}

.ds-apikeys-table tbody tr:hover td {
  background: rgba(207, 109, 53, 0.03);
}

/* ---- Thumb hover scale ---- */
.vg-thumb {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.vg-thumb:hover {
  transform: scale(1.05);
}


/* ---- Responsive: collapse thumbnails on small screens ---- */
@media (max-width: 900px) {
  .vg-split-pane {
    grid-template-columns: 1fr 350px;
    height: auto;
    min-height: 400px;
  }
  .vg-thumbnails { display: none; }
}

@media (max-width: 650px) {
  .vg-split-pane {
    grid-template-columns: 1fr;
    height: auto;
  }
  .vg-data-panel {
    border-left: none;
    border-top: 1px solid var(--border, #e5dbd0);
    max-height: 350px;
  }
}

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

/* ---- Accessibility: high contrast ---- */
@media (prefers-contrast: more) {
  :root {
    --glass-bg: rgba(255, 255, 255, 0.92);
    --glass-bg-heavy: rgba(255, 255, 255, 0.96);
    --glass-border: 1px solid rgba(30, 26, 21, 0.25);
  }
}
