/**
 * GitHub Static Exporter Styles
 * Production-ready monochrome design system
 * @version 3.1.0
 * @license MIT
 */

/* ============================================================================
   IMPORTS
   ========================================================================= */

@import url('https://cdn.jsdelivr.net/npm/normalize.css@8/normalize.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');
@import url('https://unpkg.com/@phosphor-icons/web/src/regular/style.css');
@import url('https://unpkg.com/@phosphor-icons/web/src/fill/style.css');

/* ============================================================================
   DESIGN TOKENS
   ========================================================================= */

:root {
  /* Spacing - 4px Grid System */
  --gh-space-1: 4px;
  --gh-space-2: 8px;
  --gh-space-3: 12px;
  --gh-space-4: 16px;
  --gh-space-5: 20px;
  --gh-space-6: 24px;
  --gh-space-8: 32px;
  --gh-space-10: 40px;
  --gh-space-12: 48px;
  --gh-space-16: 64px;

  /* Colors - Monochrome OKLCH (Light Theme) */
  --gh-mono-0: oklch(100% 0 0);
  --gh-mono-50: oklch(98% 0 0);
  --gh-mono-100: oklch(96% 0 0);
  --gh-mono-200: oklch(92% 0 0);
  --gh-mono-300: oklch(88% 0 0);
  --gh-mono-400: oklch(75% 0 0);
  --gh-mono-500: oklch(60% 0 0);
  --gh-mono-600: oklch(45% 0 0);
  --gh-mono-700: oklch(30% 0 0);
  --gh-mono-800: oklch(20% 0 0);
  --gh-mono-900: oklch(10% 0 0);

  /* Semantic Colors */
  --gh-bg: var(--gh-mono-100);
  --gh-surface: var(--gh-mono-0);
  --gh-surface-raised: var(--gh-mono-50);
  --gh-overlay: oklch(0% 0 0 / 0.4);

  --gh-border: var(--gh-mono-300);
  --gh-border-strong: var(--gh-mono-400);
  --gh-border-subtle: var(--gh-mono-200);

  --gh-text: var(--gh-mono-900);
  --gh-text-secondary: var(--gh-mono-600);
  --gh-text-tertiary: var(--gh-mono-500);
  --gh-text-inverse: var(--gh-mono-0);

  --gh-interactive: var(--gh-mono-900);
  --gh-interactive-hover: var(--gh-mono-800);

  /* Status Colors */
  --gh-success: oklch(60% 0.12 145);
  --gh-error: oklch(60% 0.18 25);
  --gh-info: oklch(60% 0.15 240);

  /* Shadows */
  --gh-shadow-sm: 0 2px 4px oklch(0% 0 0 / 0.06);
  --gh-shadow-md: 0 4px 8px oklch(0% 0 0 / 0.08);
  --gh-shadow-lg: 0 8px 16px oklch(0% 0 0 / 0.10);
  --gh-shadow-xl: 0 16px 32px oklch(0% 0 0 / 0.12);

  /* Focus */
  --gh-focus-ring: 0 0 0 3px oklch(0% 0 0 / 0.08);

  /* Typography */
  --gh-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --gh-font-mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;

  --gh-text-xs: 11px;
  --gh-text-sm: 13px;
  --gh-text-base: 15px;
  --gh-text-lg: 17px;
  --gh-text-xl: 20px;
  --gh-text-2xl: 24px;

  /* Border Radius */
  --gh-radius-sm: 4px;
  --gh-radius-md: 8px;
  --gh-radius-lg: 12px;
  --gh-radius-xl: 16px;
  --gh-radius-2xl: 24px;
  --gh-radius-full: 9999px;

  /* Transitions */
  --gh-transition-fast: 150ms cubic-bezier(0, 0, 0.2, 1);
  --gh-transition-base: 200ms cubic-bezier(0, 0, 0.2, 1);
  --gh-transition-slow: 300ms cubic-bezier(0, 0, 0.2, 1);
  --gh-transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index */
  --gh-z-fixed: 1300;
  --gh-z-overlay: 1400;
  --gh-z-modal: 1500;
}

/* Dark Theme */
@media (prefers-color-scheme: dark) {
  :root {
    --gh-mono-0: oklch(0% 0 0);
    --gh-mono-50: oklch(10% 0 0);
    --gh-mono-100: oklch(15% 0 0);
    --gh-mono-200: oklch(22% 0 0);
    --gh-mono-300: oklch(28% 0 0);
    --gh-mono-400: oklch(45% 0 0);
    --gh-mono-500: oklch(60% 0 0);
    --gh-mono-600: oklch(75% 0 0);
    --gh-mono-700: oklch(85% 0 0);
    --gh-mono-800: oklch(92% 0 0);
    --gh-mono-900: oklch(96% 0 0);

    --gh-overlay: oklch(100% 0 0 / 0.08);
    --gh-focus-ring: 0 0 0 3px oklch(100% 0 0 / 0.12);
  }
}

/* ============================================================================
   BASE STYLES
   ========================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ============================================================================
   INPUT WRAPPER (Inline Button Pattern)
   ========================================================================= */

.gh-export-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.gh-export-wrapper input[type="file"] {
  width: 100%;
  padding: var(--gh-space-4);
  font-family: var(--gh-font-sans);
  font-size: var(--gh-text-sm);
  color: var(--gh-text-secondary);
  background: var(--gh-surface);
  border: 1px dashed var(--gh-border);
  border-radius: var(--gh-radius-lg);
  cursor: pointer;
  transition: all var(--gh-transition-base);
}

.gh-export-wrapper input[type="file"]:hover {
  border-color: var(--gh-border-strong);
  background: var(--gh-surface-raised);
}

.gh-export-wrapper input[type="file"]:focus-visible {
  outline: none;
  border-color: var(--gh-interactive);
  box-shadow: var(--gh-focus-ring);
}

/* Inline Trigger Button */
.gh-export-trigger {
  margin-top: var(--gh-space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--gh-space-2);
  padding: var(--gh-space-3) var(--gh-space-5);
  font-family: var(--gh-font-sans);
  font-size: var(--gh-text-sm);
  font-weight: 600;
  color: var(--gh-text);
  background: var(--gh-surface-raised);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-lg);
  cursor: pointer;
  transition: all var(--gh-transition-base);
  white-space: nowrap;
}

.gh-export-trigger:hover {
  background: var(--gh-bg);
  border-color: var(--gh-border-strong);
}

.gh-export-trigger:active {
  transform: scale(0.98);
}

.gh-export-trigger i {
  font-size: 18px;
}

@media (max-width: 640px) {
  .gh-export-trigger-text {
    display: none;
  }
}

/* ============================================================================
   FLOATING ACTION BUTTON (FAB Pattern)
   ========================================================================= */

.gh-export-fab {
  position: fixed;
  bottom: var(--gh-space-6);
  right: var(--gh-space-4);
  z-index: var(--gh-z-fixed);
  display: flex;
  align-items: center;
  gap: var(--gh-space-2);
  padding: var(--gh-space-3) var(--gh-space-4);
  font-family: var(--gh-font-sans);
  font-size: var(--gh-text-sm);
  font-weight: 600;
  color: var(--gh-text-inverse);
  background: var(--gh-interactive);
  border: none;
  border-radius: var(--gh-radius-full);
  box-shadow: var(--gh-shadow-lg);
  cursor: pointer;
  transition: all var(--gh-transition-base);
  white-space: nowrap;
}

.gh-export-fab:hover {
  background: var(--gh-interactive-hover);
  box-shadow: var(--gh-shadow-xl);
  transform: translateY(-2px);
}

.gh-export-fab:active {
  transform: translateY(0);
}

.gh-export-fab i {
  font-size: 20px;
}

.gh-export-fab-text {
  display: none;
}

@media (min-width: 640px) {
  .gh-export-fab {
    bottom: var(--gh-space-8);
    right: var(--gh-space-8);
    padding: var(--gh-space-4) var(--gh-space-6);
  }

  .gh-export-fab-text {
    display: inline;
  }
}

/* ============================================================================
   MODAL
   ========================================================================= */

.gh-export-modal {
  position: fixed;
  inset: 0;
  z-index: var(--gh-z-modal);
  display: flex;
  align-items: flex-end;
  font-family: var(--gh-font-sans);
  color: var(--gh-text);
  animation: gh-fade-in var(--gh-transition-base);
}

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

.gh-export-overlay {
  position: absolute;
  inset: 0;
  background: var(--gh-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gh-export-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 90vh;
  background: var(--gh-surface);
  border-radius: var(--gh-radius-2xl) var(--gh-radius-2xl) 0 0;
  box-shadow: var(--gh-shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: gh-slide-up var(--gh-transition-slow);
}

@keyframes gh-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (min-width: 768px) {
  .gh-export-modal {
    align-items: center;
    justify-content: center;
    padding: var(--gh-space-6);
  }

  .gh-export-content {
    max-width: 520px;
    max-height: 85vh;
    border-radius: var(--gh-radius-2xl);
    animation: gh-scale-in var(--gh-transition-slow);
  }

  @keyframes gh-scale-in {
    from {
      opacity: 0;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
}

/* Modal Handle (Mobile) */
.gh-export-handle {
  width: 36px;
  height: 4px;
  margin: var(--gh-space-3) auto var(--gh-space-4);
  background: var(--gh-border);
  border-radius: var(--gh-radius-full);
}

@media (min-width: 768px) {
  .gh-export-handle {
    display: none;
  }
}

/* Modal Header */
.gh-export-header {
  position: relative;
  padding: var(--gh-space-5) var(--gh-space-6);
  border-bottom: 1px solid var(--gh-border-subtle);
  flex-shrink: 0;
}

.gh-export-title {
  font-size: var(--gh-text-xl);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  padding-right: var(--gh-space-10);
}

.gh-export-close {
  position: absolute;
  top: var(--gh-space-4);
  right: var(--gh-space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--gh-radius-md);
  color: var(--gh-text-tertiary);
  cursor: pointer;
  transition: all var(--gh-transition-fast);
}

.gh-export-close:hover {
  background: var(--gh-surface-raised);
  color: var(--gh-text);
}

.gh-export-close i {
  font-size: 20px;
}

/* Modal Body */
.gh-export-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.gh-export-body::-webkit-scrollbar {
  width: 8px;
}

.gh-export-body::-webkit-scrollbar-track {
  background: transparent;
}

.gh-export-body::-webkit-scrollbar-thumb {
  background: var(--gh-border);
  border-radius: var(--gh-radius-full);
}

/* ============================================================================
   SCREENS
   ========================================================================= */

/* Auth Screen */
.gh-export-auth {
  padding: var(--gh-space-6);
  display: flex;
  flex-direction: column;
  gap: var(--gh-space-8);
}

.gh-export-section {
  display: flex;
  flex-direction: column;
  gap: var(--gh-space-4);
}

.gh-export-section-title {
  font-size: var(--gh-text-lg);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.gh-export-section-desc {
  font-size: var(--gh-text-sm);
  line-height: 1.5;
  color: var(--gh-text-secondary);
}

.gh-export-section-desc a {
  color: var(--gh-text);
  text-decoration: underline;
  text-decoration-color: var(--gh-border);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--gh-transition-fast);
}

.gh-export-section-desc a:hover {
  text-decoration-color: var(--gh-text);
}

/* Divider */
.gh-export-divider {
  position: relative;
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--gh-text-tertiary);
  font-size: var(--gh-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.gh-export-divider::before,
.gh-export-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gh-border-subtle);
}

.gh-export-divider span {
  padding: 0 var(--gh-space-4);
}

/* ============================================================================
   FORM ELEMENTS
   ========================================================================= */

.gh-export-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--gh-space-2);
}

.gh-export-label {
  font-size: var(--gh-text-sm);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.gh-export-input {
  width: 100%;
  padding: var(--gh-space-3) var(--gh-space-4);
  font-family: var(--gh-font-sans);
  font-size: var(--gh-text-base);
  color: var(--gh-text);
  background: var(--gh-bg);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-lg);
  transition: all var(--gh-transition-base);
}

.gh-export-input::placeholder {
  color: var(--gh-text-tertiary);
}

.gh-export-input:hover {
  border-color: var(--gh-border-strong);
}

.gh-export-input:focus {
  outline: none;
  border-color: var(--gh-interactive);
  box-shadow: var(--gh-focus-ring);
  background: var(--gh-surface);
}

.gh-export-input[type="password"] {
  font-family: var(--gh-font-mono);
  letter-spacing: 0.1em;
}

/* Search Input */
.gh-export-search {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--gh-surface);
  padding: var(--gh-space-4) var(--gh-space-6);
  margin: 0 calc(-1 * var(--gh-space-6)) var(--gh-space-4);
  border-bottom: 1px solid var(--gh-border-subtle);
}

.gh-export-search .gh-export-form-group {
  margin-right: var(--gh-space-6);
  margin-left: var(--gh-space-6);
}

/* Buttons */
.gh-export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gh-space-2);
  padding: var(--gh-space-3) var(--gh-space-5);
  font-family: var(--gh-font-sans);
  font-size: var(--gh-text-sm);
  font-weight: 600;
  color: var(--gh-text);
  background: var(--gh-surface-raised);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-lg);
  cursor: pointer;
  transition: all var(--gh-transition-base);
  white-space: nowrap;
}

.gh-export-button:hover {
  background: var(--gh-bg);
  border-color: var(--gh-border-strong);
}

.gh-export-button:active {
  transform: scale(0.98);
}

.gh-export-button:focus-visible {
  outline: none;
  box-shadow: var(--gh-focus-ring);
}

.gh-export-button i {
  font-size: 18px;
}

.gh-export-button-primary {
  color: var(--gh-text-inverse);
  background: var(--gh-interactive);
  border-color: var(--gh-interactive);
}

.gh-export-button-primary:hover {
  background: var(--gh-interactive-hover);
  border-color: var(--gh-interactive-hover);
}

/* ============================================================================
   LISTS
   ========================================================================= */

.gh-export-list-wrapper {
  padding: var(--gh-space-6);
}

.gh-export-list {
  display: flex;
  flex-direction: column;
  gap: var(--gh-space-3);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 50vh;
  -webkit-overflow-scrolling: touch;
}

.gh-export-list::-webkit-scrollbar {
  width: 6px;
}

.gh-export-list::-webkit-scrollbar-track {
  background: var(--gh-border-subtle);
  border-radius: var(--gh-radius-full);
}

.gh-export-list::-webkit-scrollbar-thumb {
  background: var(--gh-border-strong);
  border-radius: var(--gh-radius-full);
}

@media (min-width: 640px) {
  .gh-export-list {
    max-height: 400px;
  }
}

.gh-export-list-item {
  width: 100%;
  padding: var(--gh-space-4) !important;
  background: var(--gh-surface-raised);
  border: 1px solid var(--gh-border-subtle);
  border-radius: var(--gh-radius-lg);
  cursor: pointer;
  transition: all var(--gh-transition-base);
  text-align: left;
  display: flex;
  align-items: center;
  gap: var(--gh-space-3);
}

.gh-export-list-item:hover {
  background: var(--gh-bg);
  border-color: var(--gh-border);
  box-shadow: var(--gh-shadow-sm);
}

.gh-export-list-item:active {
  transform: scale(0.98);
}

.gh-export-list-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gh-space-1);
}

.gh-export-list-item-main strong {
  font-size: var(--gh-text-base);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.gh-export-list-item-meta {
  font-size: var(--gh-text-xs);
  font-family: var(--gh-font-mono);
  color: var(--gh-text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-export-list-item i {
  flex-shrink: 0;
  font-size: 18px;
  color: var(--gh-text-tertiary);
}

/* Badge */
.gh-export-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--gh-space-1) var(--gh-space-3);
  font-size: var(--gh-text-xs);
  font-weight: 500;
  color: var(--gh-info);
  background: oklch(from var(--gh-info) l c h / 0.1);
  border-radius: var(--gh-radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.gh-export-badge-default {
  color: var(--gh-success);
  background: oklch(from var(--gh-success) l c h / 0.1);
}

.gh-export-badge-entry {
  color: var(--gh-interactive);
  background: oklch(from var(--gh-interactive) l c h / 0.1);
}

/* Breadcrumb */
.gh-export-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--gh-space-2);
  padding: var(--gh-space-4) var(--gh-space-6);
  background: var(--gh-surface-raised);
  border-bottom: 1px solid var(--gh-border-subtle);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gh-export-breadcrumb::-webkit-scrollbar {
  display: none;
}

.gh-export-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: var(--gh-space-2);
  padding: 0;
  font-size: var(--gh-text-sm);
  font-family: var(--gh-font-mono);
  color: var(--gh-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--gh-transition-fast);
}

.gh-export-breadcrumb-item:hover {
  color: var(--gh-text);
}

.gh-export-breadcrumb-item i {
  font-size: 16px;
}

.gh-export-breadcrumb-separator {
  color: var(--gh-border-strong);
  user-select: none;
}

/* ============================================================================
   STATES
   ========================================================================= */

/* Loading */
.gh-export-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gh-space-4);
  padding: var(--gh-space-16) var(--gh-space-6);
  text-align: center;
}

.gh-export-loading p {
  font-size: var(--gh-text-sm);
  color: var(--gh-text-secondary);
}

.gh-export-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gh-border-subtle);
  border-top-color: var(--gh-interactive);
  border-radius: var(--gh-radius-full);
  animation: gh-spin 0.8s linear infinite;
}

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

/* Progress Bar */
.gh-export-progress {
  width: 100%;
  height: 4px;
  background: var(--gh-border-subtle);
  border-radius: var(--gh-radius-full);
  overflow: hidden;
  margin-top: var(--gh-space-4);
}

.gh-export-progress-bar {
  height: 100%;
  background: var(--gh-interactive);
  border-radius: var(--gh-radius-full);
  transition: width var(--gh-transition-slow);
}

.gh-export-progress-text {
  font-size: var(--gh-text-xs);
  color: var(--gh-text-tertiary);
  margin-top: var(--gh-space-3);
}

/* Success */
.gh-export-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gh-space-4);
  padding: var(--gh-space-12) var(--gh-space-6);
  text-align: center;
}

.gh-export-success i {
  font-size: 48px;
  color: var(--gh-success);
}

.gh-export-success h3 {
  font-size: var(--gh-text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gh-export-success p {
  font-size: var(--gh-text-sm);
  color: var(--gh-text-secondary);
  line-height: 1.5;
  max-width: 360px;
}

.gh-export-file-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gh-space-2);
  padding: var(--gh-space-4);
  background: oklch(from var(--gh-success) l c h / 0.08);
  border-radius: var(--gh-radius-lg);
  margin-top: var(--gh-space-2);
}

.gh-export-file-info strong {
  font-family: var(--gh-font-mono);
  font-size: var(--gh-text-sm);
  font-weight: 600;
}

.gh-export-file-info span {
  font-size: var(--gh-text-xs);
  color: var(--gh-text-tertiary);
}

/* Error */
.gh-export-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gh-space-4);
  padding: var(--gh-space-12) var(--gh-space-6);
  text-align: center;
}

.gh-export-error i {
  font-size: 48px;
  color: var(--gh-error);
}

.gh-export-error h3 {
  font-size: var(--gh-text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gh-export-error p {
  font-size: var(--gh-text-sm);
  font-family: var(--gh-font-mono);
  color: var(--gh-text-secondary);
  line-height: 1.5;
  max-width: 360px;
  padding: var(--gh-space-4);
  background: oklch(from var(--gh-error) l c h / 0.08);
  border-radius: var(--gh-radius-lg);
}

/* ============================================================================
   MODAL FOOTER
   ========================================================================= */

.gh-export-footer {
  display: flex;
  align-items: center;
  gap: var(--gh-space-3);
  padding: var(--gh-space-5) var(--gh-space-6);
  border-top: 1px solid var(--gh-border-subtle);
  flex-shrink: 0;
}

.gh-export-footer .gh-export-button {
  flex: 1;
}

/* ============================================================================
   FILE BROWSER
   ========================================================================= */

.gh-export-file-browser {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.gh-export-file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gh-space-4);
  padding: var(--gh-space-4) var(--gh-space-6);
  background: var(--gh-surface-raised);
  border-bottom: 1px solid var(--gh-border-subtle);
  flex-wrap: wrap;
}

.gh-export-file-header-left {
  display: flex;
  align-items: center;
  gap: var(--gh-space-4);
}

.gh-export-file-header-right {
  flex: 1;
  min-width: 150px;
  max-width: 250px;
}

.gh-export-file-search {
  padding: var(--gh-space-2) var(--gh-space-3) !important;
  font-size: var(--gh-text-sm) !important;
}

.gh-export-file-count {
  font-size: var(--gh-text-xs);
  color: var(--gh-text-tertiary);
  white-space: nowrap;
}

/* Checkbox Styles */
.gh-export-checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  gap: var(--gh-space-2);
  cursor: pointer;
}

.gh-export-checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--gh-interactive);
}

.gh-export-checkbox-wrapper input[type="checkbox"][data-partial="true"] {
  opacity: 0.6;
}

.gh-export-checkbox-label {
  font-size: var(--gh-text-sm);
  font-weight: 500;
  color: var(--gh-text);
  user-select: none;
}

/* File Tree */
.gh-export-file-tree {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--gh-space-4) var(--gh-space-6);
  max-height: 40vh;
  -webkit-overflow-scrolling: touch;
}

.gh-export-file-tree::-webkit-scrollbar {
  width: 6px;
}

.gh-export-file-tree::-webkit-scrollbar-track {
  background: var(--gh-border-subtle);
  border-radius: var(--gh-radius-full);
}

.gh-export-file-tree::-webkit-scrollbar-thumb {
  background: var(--gh-border-strong);
  border-radius: var(--gh-radius-full);
}

/* Folder */
.gh-export-folder {
  margin-bottom: var(--gh-space-1);
}

.gh-export-folder-header {
  display: flex;
  align-items: center;
  gap: var(--gh-space-2);
  padding: var(--gh-space-2) 0;
}

.gh-export-folder-toggle {
  display: flex;
  align-items: center;
  gap: var(--gh-space-2);
  flex: 1;
  padding: var(--gh-space-2) var(--gh-space-3);
  background: transparent;
  border: none;
  border-radius: var(--gh-radius-md);
  cursor: pointer;
  font-family: var(--gh-font-sans);
  font-size: var(--gh-text-sm);
  font-weight: 500;
  color: var(--gh-text);
  text-align: left;
  transition: background var(--gh-transition-fast);
}

.gh-export-folder-toggle:hover {
  background: var(--gh-surface-raised);
}

.gh-export-folder-toggle i {
  font-size: 18px;
  color: var(--gh-text-secondary);
}

.gh-export-folder-toggle span {
  flex: 1;
}

.gh-export-folder-arrow {
  font-size: 14px !important;
  color: var(--gh-text-tertiary) !important;
}

.gh-export-folder-contents {
  margin-left: var(--gh-space-8);
  padding-left: var(--gh-space-4);
  border-left: 1px solid var(--gh-border-subtle);
}

/* File Item */
.gh-export-file-item {
  display: flex;
  align-items: center;
  gap: var(--gh-space-3);
  padding: var(--gh-space-2) var(--gh-space-3);
  margin: var(--gh-space-1) 0;
  background: transparent;
  border-radius: var(--gh-radius-md);
  transition: background var(--gh-transition-fast);
}

.gh-export-file-item:hover {
  background: var(--gh-surface-raised);
}

.gh-export-file-item.gh-export-file-selected {
  background: oklch(from var(--gh-interactive) l c h / 0.05);
}

.gh-export-file-item.gh-export-file-entry {
  background: oklch(from var(--gh-success) l c h / 0.08);
}

.gh-export-file-item i {
  font-size: 18px;
  color: var(--gh-text-secondary);
  flex-shrink: 0;
}

.gh-export-file-name {
  flex: 1;
  font-size: var(--gh-text-sm);
  font-family: var(--gh-font-mono);
  color: var(--gh-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Entry Point Selector */
.gh-export-entry-point {
  padding: var(--gh-space-4) var(--gh-space-6);
  background: var(--gh-surface-raised);
  border-top: 1px solid var(--gh-border-subtle);
}

.gh-export-entry-point-header {
  display: flex;
  align-items: center;
  gap: var(--gh-space-2);
  margin-bottom: var(--gh-space-3);
  font-size: var(--gh-text-sm);
  font-weight: 600;
  color: var(--gh-text);
}

.gh-export-entry-point-header i {
  font-size: 18px;
  color: var(--gh-text-secondary);
}

.gh-export-entry-point-selector {
  display: flex;
  flex-direction: column;
  gap: var(--gh-space-2);
}

.gh-export-select {
  width: 100%;
  padding: var(--gh-space-3) var(--gh-space-4);
  font-family: var(--gh-font-mono);
  font-size: var(--gh-text-sm);
  color: var(--gh-text);
  background: var(--gh-surface);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-lg);
  cursor: pointer;
  transition: all var(--gh-transition-base);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%23666' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--gh-space-3) center;
  padding-right: var(--gh-space-10);
}

.gh-export-select:hover {
  border-color: var(--gh-border-strong);
}

.gh-export-select:focus {
  outline: none;
  border-color: var(--gh-interactive);
  box-shadow: var(--gh-focus-ring);
}

.gh-export-entry-point-hint {
  font-size: var(--gh-text-xs);
  color: var(--gh-text-tertiary);
  line-height: 1.4;
}

/* Disabled Button State */
.gh-export-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gh-export-button:disabled:hover {
  transform: none;
  background: var(--gh-surface-raised);
  border-color: var(--gh-border);
}

.gh-export-button-primary:disabled:hover {
  background: var(--gh-interactive);
  border-color: var(--gh-interactive);
}

@media (max-width: 640px) {
  .gh-export-file-header {
    flex-direction: column;
    align-items: stretch;
  }

  .gh-export-file-header-right {
    max-width: none;
  }

  .gh-export-file-tree {
    max-height: 35vh;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ========================================================================= */

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

:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-contrast: high) {
  :root {
    --gh-border: var(--gh-mono-700);
    --gh-border-strong: var(--gh-mono-800);
  }
}

@media (hover: none) and (pointer: coarse) {
  .gh-export-button,
  .gh-export-list-item,
  .gh-export-fab,
  .gh-export-trigger {
    min-height: 44px;
  }
}
