/*
 * Dual-HST Content Studio — Design System
 * Fidele a l'identite visuelle de dual-hst.ch
 * Palette: navy + teal + orange | Typo: Plus Jakarta Sans + JetBrains Mono
 */

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-sans);
  background: var(--c-navy);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-teal-light); text-decoration: none; }
a:hover { color: var(--c-teal); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ========== CUSTOM PROPERTIES ========== */
:root {
  /* Colors */
  --c-navy: #0e1c36;
  --c-navy-mid: #1a2d4a;
  --c-card: #1a2d4a;
  --c-card-hover: #213755;
  --c-teal: #0891b2;
  --c-teal-light: #22d3ee;
  --c-teal-glow: rgba(8, 145, 178, 0.15);
  --c-orange: #f97316;
  --c-orange-light: #fb923c;
  --c-white: #f8fafc;
  --c-text: #e2e8f0;
  --c-text-muted: #94a3b8;
  --c-border: rgba(8, 145, 178, 0.2);
  --c-success: #10b981;
  --c-danger-bg: rgba(249, 115, 22, 0.1);

  /* Typography */
  --f-sans: 'Plus Jakarta Sans', sans-serif;
  --f-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 36px;
  --sp-2xl: 48px;
  --sp-3xl: 80px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 24px var(--c-teal-glow);

  /* Transitions */
  --t-fast: 150ms ease;
  --t-normal: 300ms ease-out;
}

/* ========== LAYOUT ========== */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 72px;
  background: rgba(14, 28, 54, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-xl);
}

.header__left {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.header__logo {
  height: 48px;
  width: auto;
}

.header__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}

.header__nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-muted);
  transition: color var(--t-fast);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-sm);
}
.header__nav-link:hover,
.header__nav-link.is-active {
  color: var(--c-teal-light);
}

.header__settings-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  color: var(--c-text-muted);
  transition: all var(--t-fast);
}
.header__settings-btn:hover {
  color: var(--c-teal-light);
  background: rgba(8, 145, 178, 0.1);
}

.app-main {
  margin-top: 72px;
  min-height: calc(100vh - 72px - 64px);
  padding: var(--sp-3xl) var(--sp-xl) var(--sp-2xl);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.app-footer {
  border-top: 1px solid var(--c-border);
  padding: var(--sp-lg) var(--sp-xl);
  text-align: center;
  color: var(--c-text-muted);
  font-size: 13px;
}
.app-footer a { color: var(--c-teal-light); }

/* ========== BREADCRUMB ========== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-xl);
  font-size: 13px;
  color: var(--c-text-muted);
}
.breadcrumb__item {
  color: var(--c-text-muted);
  transition: color var(--t-fast);
}
.breadcrumb__item:hover { color: var(--c-teal-light); }
.breadcrumb__item.is-active { color: var(--c-teal-light); pointer-events: none; }
.breadcrumb__sep { color: var(--c-text-muted); opacity: 0.4; }

/* ========== VIEW TRANSITIONS ========== */
.view {
  animation: fadeIn var(--t-normal) both;
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ========== SECTION HEADER ========== */
.section-header {
  margin-bottom: var(--sp-xl);
}
.section-header__number {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--c-teal);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-xs);
}
.section-header__title {
  font-size: 28px;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: -0.5px;
}
.section-header__desc {
  font-size: 15px;
  color: var(--c-text-muted);
  margin-top: var(--sp-sm);
}

/* ========== CARDS ========== */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  transition: all var(--t-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--c-teal);
  box-shadow: var(--shadow-glow);
  background: var(--c-card-hover);
}
.card:focus-visible {
  outline: 2px solid var(--c-teal-light);
  outline-offset: 2px;
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: rgba(8, 145, 178, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-teal-light);
  margin-bottom: var(--sp-md);
}
.card__icon svg { width: 24px; height: 24px; }

.card__number {
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--c-teal);
  margin-bottom: var(--sp-sm);
}

.card__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: var(--sp-sm);
}

.card__desc {
  font-size: 14px;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* Card type grid: 2x2 */
.grid--types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-lg);
}

/* Card theme grid: 4x3 */
.grid--themes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-md);
}

/* Staggered animation for theme cards */
.grid--themes .card {
  animation: fadeIn var(--t-normal) both;
}
.grid--themes .card:nth-child(1)  { animation-delay: 0ms; }
.grid--themes .card:nth-child(2)  { animation-delay: 50ms; }
.grid--themes .card:nth-child(3)  { animation-delay: 100ms; }
.grid--themes .card:nth-child(4)  { animation-delay: 150ms; }
.grid--themes .card:nth-child(5)  { animation-delay: 200ms; }
.grid--themes .card:nth-child(6)  { animation-delay: 250ms; }
.grid--themes .card:nth-child(7)  { animation-delay: 300ms; }
.grid--themes .card:nth-child(8)  { animation-delay: 350ms; }
.grid--themes .card:nth-child(9)  { animation-delay: 400ms; }
.grid--themes .card:nth-child(10) { animation-delay: 450ms; }
.grid--themes .card:nth-child(11) { animation-delay: 500ms; }
.grid--themes .card:nth-child(12) { animation-delay: 550ms; }

/* Error card */
.card--error {
  background: var(--c-danger-bg);
  border-color: var(--c-orange);
  cursor: default;
}
.card--error:hover {
  transform: none;
  box-shadow: none;
}
.card--error .card__icon {
  background: rgba(249, 115, 22, 0.2);
  color: var(--c-orange);
}
.card--error .card__title { color: var(--c-orange); }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--r-md);
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--c-teal-light);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--c-teal);
  color: var(--c-white);
}
.btn--primary:hover {
  background: var(--c-teal-light);
  color: var(--c-navy);
}
.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--secondary {
  background: transparent;
  border: 1.5px solid var(--c-teal);
  color: var(--c-teal-light);
}
.btn--secondary:hover {
  background: rgba(8, 145, 178, 0.1);
}

.btn--ghost {
  background: transparent;
  color: var(--c-text-muted);
}
.btn--ghost:hover { color: var(--c-teal-light); }

.btn--danger {
  background: var(--c-orange);
  color: var(--c-white);
}
.btn--danger:hover {
  background: var(--c-orange-light);
}

.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--r-md);
}

.btn--sm { padding: 8px 16px; font-size: 13px; }
.btn--lg { padding: 16px 32px; font-size: 16px; }

.btn svg { width: 18px; height: 18px; }

/* Loading state */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}
.btn.is-loading .btn__spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: var(--sp-lg);
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(14, 28, 54, 0.6);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-size: 14px;
  transition: border-color var(--t-fast);
}
.form-input:focus {
  outline: none;
  border-color: var(--c-teal);
  box-shadow: 0 0 0 3px var(--c-teal-glow);
}
.form-input::placeholder { color: var(--c-text-muted); opacity: 0.6; }
.form-input.is-error { border-color: var(--c-orange); }

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: var(--sp-xs);
}
.form-error {
  font-size: 12px;
  color: var(--c-orange);
  margin-top: var(--sp-xs);
}

/* Password toggle wrapper */
.input-password-wrap {
  position: relative;
}
.input-password-wrap .form-input { padding-right: 44px; }
.input-password-wrap .toggle-visibility {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.input-password-wrap .toggle-visibility:hover { color: var(--c-teal-light); }

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle__slider {
  position: absolute;
  inset: 0;
  background: rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.toggle__slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--c-white);
  border-radius: 50%;
  transition: transform var(--t-fast);
}
.toggle input:checked + .toggle__slider {
  background: var(--c-teal);
}
.toggle input:checked + .toggle__slider::before {
  transform: translateX(20px);
}
.toggle input:focus-visible + .toggle__slider {
  box-shadow: 0 0 0 3px var(--c-teal-glow);
}

/* Character counter */
.char-counter {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--c-text-muted);
  text-align: right;
}
.char-counter.is-over { color: var(--c-orange); }

/* ========== EDITOR ========== */
.editor {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.editor__toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--c-border);
  background: rgba(14, 28, 54, 0.4);
  flex-wrap: wrap;
}
.editor__toolbar-sep {
  width: 1px;
  height: 24px;
  background: var(--c-border);
  margin: 0 var(--sp-sm);
}

.editor__toolbar-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--c-text-muted);
  font-size: 14px;
  font-weight: 700;
  transition: all var(--t-fast);
}
.editor__toolbar-btn:hover {
  background: rgba(8, 145, 178, 0.1);
  color: var(--c-teal-light);
}
.editor__toolbar-btn.is-active {
  background: rgba(8, 145, 178, 0.2);
  color: var(--c-teal-light);
}
.editor__toolbar-btn svg { width: 18px; height: 18px; }

.editor__content {
  padding: var(--sp-xl);
  min-height: 400px;
  outline: none;
  color: var(--c-text);
  font-size: 15px;
  line-height: 1.7;
}
.editor__content:focus {
  box-shadow: inset 0 0 0 2px var(--c-teal-glow);
}

/* Content styling inside editor */
.editor__content h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: var(--sp-md);
}
.editor__content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-white);
  margin-top: var(--sp-lg);
  margin-bottom: var(--sp-md);
}
.editor__content h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--c-teal-light);
  margin-top: var(--sp-lg);
  margin-bottom: var(--sp-sm);
}
.editor__content p {
  margin-bottom: var(--sp-md);
}
.editor__content ul, .editor__content ol {
  margin-left: var(--sp-lg);
  margin-bottom: var(--sp-md);
}
.editor__content ul { list-style: disc; }
.editor__content ol { list-style: decimal; }
.editor__content li { margin-bottom: var(--sp-xs); }
.editor__content strong { color: var(--c-white); }
.editor__content em { font-style: italic; }

/* Source citations in editor */
.editor__content cite.source {
  color: var(--c-teal-light);
  background: rgba(8, 145, 178, 0.1);
  padding: 1px 6px;
  border-radius: 3px;
  font-style: normal;
  font-size: 13px;
  cursor: help;
  position: relative;
  transition: background var(--t-fast);
}
.editor__content cite.source:hover {
  background: rgba(8, 145, 178, 0.25);
}

/* Editor actions bar */
.editor__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  border-top: 1px solid var(--c-border);
  background: rgba(14, 28, 54, 0.4);
}
.editor__actions-right {
  margin-left: auto;
  display: flex;
  gap: var(--sp-sm);
}

/* Sources panel */
.sources-panel {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-top: var(--sp-lg);
}
.sources-panel__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-md);
}
.sources-panel__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.sources-panel__item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-sm);
  font-size: 13px;
}
.sources-panel__item:hover { background: rgba(8, 145, 178, 0.05); }
.sources-panel__badge {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--c-teal);
  background: rgba(8, 145, 178, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.sources-panel__name { color: var(--c-text); flex: 1; }
.sources-panel__link {
  color: var(--c-text-muted);
  font-size: 12px;
}
.sources-panel__link:hover { color: var(--c-teal-light); }

/* ========== GENERATION VIEW ========== */
.generate-summary {
  display: flex;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-xl);
}
.generate-summary__item {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-md) var(--sp-lg);
  flex: 1;
}
.generate-summary__label {
  font-size: 11px;
  font-family: var(--f-mono);
  color: var(--c-teal);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-xs);
}
.generate-summary__value {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-white);
}

/* Sources selection */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
}
.source-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md);
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  transition: border-color var(--t-fast);
}
.source-toggle.is-active {
  border-color: var(--c-teal);
}
.source-toggle__info { flex: 1; }
.source-toggle__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-white);
}
.source-toggle__country {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--c-text-muted);
}

/* ========== SETTINGS ========== */
.settings-section {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  margin-bottom: var(--sp-lg);
}
.settings-section__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-md);
  border-bottom: 1px solid var(--c-border);
}

/* Source table */
.source-table {
  width: 100%;
  border-collapse: collapse;
}
.source-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--c-border);
}
.source-table td {
  padding: var(--sp-sm) var(--sp-md);
  font-size: 14px;
  color: var(--c-text);
  border-bottom: 1px solid rgba(8, 145, 178, 0.08);
}
.source-table tr:hover td {
  background: rgba(8, 145, 178, 0.03);
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 28, 54, 0.8);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 200ms ease;
}
.modal {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  width: 90%;
  max-width: 500px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}
.modal__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: var(--sp-md);
}
.modal__body {
  color: var(--c-text-muted);
  font-size: 14px;
  margin-bottom: var(--sp-xl);
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-md);
}

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  top: 84px;
  right: var(--sp-lg);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  font-size: 14px;
  animation: slideIn var(--t-normal) both;
  min-width: 280px;
}
.toast--success { border-color: var(--c-success); }
.toast--success .toast__icon { color: var(--c-success); }
.toast--error { border-color: var(--c-orange); }
.toast--error .toast__icon { color: var(--c-orange); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}
.toast.is-exiting { animation: slideOut var(--t-normal) both; }

/* ========== SKELETON LOADING ========== */
.skeleton {
  background: linear-gradient(90deg, var(--c-card) 25%, var(--c-card-hover) 50%, var(--c-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r-sm);
}
.skeleton--title { height: 28px; width: 60%; margin-bottom: var(--sp-lg); }
.skeleton--text { height: 16px; width: 100%; margin-bottom: var(--sp-sm); }
.skeleton--text-short { height: 16px; width: 40%; margin-bottom: var(--sp-md); }
.skeleton--block { height: 120px; width: 100%; margin-bottom: var(--sp-md); }

/* ========== TOOLTIP ========== */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--c-navy);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--c-text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  z-index: 50;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ========== UTILITIES ========== */
.text-teal { color: var(--c-teal-light); }
.text-orange { color: var(--c-orange); }
.text-muted { color: var(--c-text-muted); }
.font-mono { font-family: var(--f-mono); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mt-xl { margin-top: var(--sp-xl); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }

/* ========== PRINT STYLES ========== */
@media print {
  .app-header, .app-footer, .editor__toolbar, .editor__actions,
  .breadcrumb, .btn, .toast-container { display: none !important; }

  body { background: white; color: #1a1a1a; }
  .app-main { margin: 0; padding: 20px; max-width: 100%; }
  .editor { border: none; background: white; }
  .editor__content {
    color: #1a1a1a;
    padding: 0;
    min-height: auto;
  }
  .editor__content h1, .editor__content h2, .editor__content h3,
  .editor__content strong { color: #1a1a1a; }
  .editor__content h3 { color: #0891b2; }
  .editor__content cite.source {
    color: #0891b2;
    background: none;
  }
  .editor__content cite.source::after {
    content: " (" attr(data-url) ")";
    font-size: 10px;
    color: #666;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .grid--themes {
    grid-template-columns: repeat(3, 1fr);
  }
  .sources-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-header { padding: 0 var(--sp-md); }
  .app-main { padding: var(--sp-lg) var(--sp-md); }

  .grid--types {
    grid-template-columns: 1fr;
  }
  .grid--themes {
    grid-template-columns: repeat(2, 1fr);
  }
  .generate-summary {
    flex-direction: column;
  }
  .editor__actions {
    flex-wrap: wrap;
  }
  .section-header__title { font-size: 22px; }
}
