/* ==========================================================================
   Design System & Custom Properties (Tokens)
   ========================================================================== */

:root {
  /* Colors */
  --bg: #0b0f19;
  --bg-secondary: #111827;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --surface-active: rgba(255, 255, 255, 0.1);
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-border-active: rgba(99, 102, 241, 0.4);

  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --accent: #6366f1;         /* Indigo */
  --accent-hover: #4f46e5;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-2: #06b6d4;       /* Cyan */
  --accent-2-glow: rgba(6, 182, 212, 0.25);
  --surface-light: rgba(255, 255, 255, 0.06);
  
  --ok: #22c55e;
  --ok-glow: rgba(34, 197, 94, 0.2);
  --err: #ef4444;
  --err-glow: rgba(239, 68, 68, 0.2);

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  /* Shadows */
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--accent-glow);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
}

.hidden {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

/* Glassmorphism Card Utility */
.glass {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

/* ==========================================================================
   Header & Brand
   ========================================================================== */

.app-header {
  padding: 1.25rem 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 0.6rem;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.header-badges {
  display: flex;
  gap: 0.5rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
}

.badge-accent {
  background: var(--accent);
  color: #fff;
}

.badge-outline {
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
}

.badge-ok {
  background: var(--ok-glow);
  color: var(--ok);
  border: 1px solid var(--ok);
}

.badge-warn {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
  border: 1px solid #eab308;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--surface-border);
}

.badge-error {
  background: var(--err-glow);
  color: var(--err);
  border: 1px solid var(--err);
}

/* ==========================================================================
   Main Layout & Upload Section
   ========================================================================== */

.app-main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 2rem 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

/* Dropzone */
.dropzone {
  border: 2px dashed var(--surface-border);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
}

.dropzone:focus-visible {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--accent-2-glow);
}

.upload-icon-wrapper {
  color: var(--accent);
  margin-bottom: 1rem;
  transition: transform 0.2s ease;
}

.dropzone:hover .upload-icon-wrapper {
  transform: translateY(-4px);
}

.dropzone-idle h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.dropzone-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Selected File Info */
.dropzone-file-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.file-icon {
  color: var(--accent-2);
}

.file-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.file-name {
  font-weight: 600;
  font-size: 1rem;
}

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

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  color: var(--err);
  background: rgba(239, 68, 68, 0.15);
}

/* Options Panel */
.options-panel {
  padding: 0.75rem 1.25rem;
}

.options-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.options-summary:hover {
  color: var(--text);
}

.summary-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.options-body {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.option-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.checkbox-hint {
  margin-left: 1.8rem;
}

.options-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.25rem;
  align-items: start;
  margin-bottom: 1rem;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.option-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.option-group select,
.option-group input[type="text"],
.option-group input[type="url"],
.option-group input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 2.5rem;
  padding: 0 0.85rem;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.option-group select:hover,
.option-group input:hover {
  border-color: var(--surface-border-active);
}

.option-group select:focus-visible,
.option-group input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.option-group input::placeholder {
  color: var(--text-dim);
}

.option-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.option-group select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Action Button */
.action-row {
  display: flex;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

/* ==========================================================================
   Progress Section & Stage Tracker
   ========================================================================== */

.progress-section {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.stage-tracker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.stage-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  z-index: 1;
}

.stage-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--surface-border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.stage-item.is-active .stage-dot {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: var(--shadow-glow);
}

.stage-item.is-done .stage-dot {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}

.stage-item.is-failed .stage-dot {
  border-color: var(--err);
  background: var(--err);
  color: #fff;
}

.stage-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stage-line {
  flex: 1;
  height: 2px;
  background: var(--surface-border);
  margin: 0 0.5rem;
  transform: translateY(-12px);
}

/* Progress Bar */
.progress-bar-wrapper {
  width: 100%;
}

.progress-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0%;
  transition: width 0.3s ease;
}

.progress-bar-fill.indeterminate {
  width: 40%;
  animation: shimmer 1.5s infinite linear;
}

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

.status-message-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.status-text {
  color: var(--text);
  font-weight: 500;
}

.job-id-display {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Summary Badges */
.summary-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface-border);
}

.summary-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--surface-border);
  padding: 0.6rem 0.8rem;
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

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

.summary-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-2);
}

/* ==========================================================================
   Viewer Section (Split Screen)
   ========================================================================== */

.viewer-section {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--surface-border);
  flex-wrap: wrap;
  gap: 1rem;
}

.view-mode-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem;
  border-radius: var(--r-md);
  border: 1px solid var(--surface-border);
}

.btn-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-toggle.active {
  background: var(--surface-hover);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.viewer-actions {
  display: flex;
  gap: 0.5rem;
}

/* Viewer Grid */
.viewer-grid {
  display: grid;
  min-height: 600px;
  max-height: 800px;
}

.viewer-grid.mode-split {
  grid-template-columns: 1fr 1fr;
}

.viewer-grid.mode-rendered {
  grid-template-columns: 1fr 0fr;
}

.viewer-grid.mode-rendered #pane-raw {
  display: none;
}

.viewer-grid.mode-raw {
  grid-template-columns: 0fr 1fr;
}

.viewer-grid.mode-raw #pane-rendered {
  display: none;
}

.viewer-pane {
  overflow-y: auto;
  padding: 1.5rem 2rem;
}

.pane-rendered {
  border-right: 1px solid var(--surface-border);
}

.pane-raw pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   Rendered Markdown Typography (.prose)
   ========================================================================== */

.prose {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-display);
  color: #fff;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.prose h1 { font-size: 1.75rem; border-bottom: 1px solid var(--surface-border); padding-bottom: 0.5rem; }
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.15rem; }

.prose p { margin-bottom: 1rem; }

.prose ul, .prose ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.prose blockquote {
  border-left: 3px solid var(--accent-2);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.85rem;
}

.prose th, .prose td {
  border: 1px solid var(--surface-border);
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.prose th {
  background: var(--surface-hover);
  color: #fff;
  font-weight: 600;
}

.prose tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.prose img {
  max-width: 100%;
  border-radius: var(--r-sm);
  margin: 1rem 0;
  cursor: zoom-in;
  border: 1px solid var(--surface-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.prose img:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.prose code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent-2);
}

.prose pre code {
  padding: 1rem;
  display: block;
  overflow-x: auto;
  border-radius: var(--r-sm);
  color: var(--text);
}

/* ==========================================================================
   Lightbox Modal
   ========================================================================== */

.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  z-index: 1001;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img-wrapper img {
  max-width: 85vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--r-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
}

.lightbox-caption {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--surface-border);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.nav-prev { left: -60px; }
.nav-next { right: -60px; }

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 0.8rem 1.2rem;
  border-radius: var(--r-md);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: toastSlideIn 0.25s ease forwards;
}

.toast.toast-err { border-left: 4px solid var(--err); }
.toast.toast-ok { border-left: 4px solid var(--ok); }

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Footer & Responsiveness
   ========================================================================== */

.app-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--surface-border);
}

@media (max-width: 900px) {
  .app-main { padding: 1rem; }
  .viewer-grid.mode-split { grid-template-columns: 1fr; }
  .pane-rendered { border-right: none; border-bottom: 1px solid var(--surface-border); }
  .nav-prev { left: 10px; }
  .nav-next { right: 10px; }
  .options-row { grid-template-columns: 1fr; }
}

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

/* ==========================================================================
   Auth & History Styles
   ========================================================================== */

.auth-area { display: flex; align-items: center; gap: 0.5rem; }
.user-menu { display: flex; align-items: center; gap: 0.5rem; }
.user-email-badge {
  font-size: 0.8rem;
  color: var(--accent-light);
  background: var(--surface-light);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid var(--surface-border);
}

.auth-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.auth-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
}
.auth-dialog {
  position: relative; z-index: 1001; width: 100%; max-width: 400px; padding: 1.5rem; border-radius: 12px;
}
.auth-dialog-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem;
}
.auth-tabs { display: flex; gap: 0.5rem; }
.auth-tab {
  background: transparent; border: none; color: var(--text-dim); font-size: 1.1rem; font-weight: 600; cursor: pointer; padding-bottom: 0.2rem;
}
.auth-tab.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.85rem; color: var(--text-dim); }
.form-group input {
  padding: 0.6rem 0.8rem; background: var(--surface); border: 1px solid var(--surface-border); border-radius: 6px; color: var(--text); font-size: 0.9rem;
}
.auth-error {
  color: var(--err); font-size: 0.8rem; background: rgba(239, 68, 68, 0.1); padding: 0.5rem 0.8rem; border-radius: 6px; border: 1px solid var(--err);
}
.auth-notice {
  font-size: 0.8rem; color: var(--text-dim);
  background: var(--surface-light); border: 1px solid var(--surface-border);
  border-radius: 6px; padding: 0.5rem 0.8rem; margin-bottom: 1rem;
}
.btn-full { width: 100%; justify-content: center; margin-top: 0.5rem; }

.history-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; z-index: 900;
  background: var(--surface); border-left: 1px solid var(--surface-border);
  display: flex; flex-direction: column; padding: 1.5rem; box-shadow: -10px 0 25px rgba(0,0,0,0.5);
  transition: transform 0.3s ease;
}
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--surface-border); }
.history-body { flex: 1; overflow-y: auto; }
.history-empty { color: var(--text-dim); font-size: 0.9rem; text-align: center; margin-top: 2rem; }
.history-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.history-item {
  background: var(--surface-light); border: 1px solid var(--surface-border); border-radius: 8px; padding: 0.8rem; display: flex; justify-content: space-between; align-items: center;
}
.history-item-title { font-weight: 600; font-size: 0.85rem; display: flex; align-items: center; gap: 0.4rem; }
.history-item-meta { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.2rem; }
.history-item-actions { display: flex; align-items: center; gap: 0.4rem; }
.history-disabled-link { font-size: 0.75rem; color: var(--text-dim); padding: 0.25rem 0.5rem; background: var(--surface-border); border-radius: 4px; }

/* Login-First Gate — 세션 판정 전에는 본문 전체를 감춘다. */
.auth-pending body > *:not(#auth-modal):not(#toast-container) {
  visibility: hidden;
}
.auth-pending body {
  overflow: hidden;
}

