:root {
  --bg: #0c0f14;
  --surface: #151a23;
  --surface-2: #1c2330;
  --border: #2a3344;
  --text: #e8ecf4;
  --text-muted: #8b95a8;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #6366f1;
  --radius: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow: hidden;
}

/* ── App shell ─────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 30;
  overflow-y: auto;
  width: 260px;
  min-width: 260px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.4rem 0.75rem;
}

.sidebar__logo {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  color: #fff;
}

.sidebar__name {
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.25;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.nav-item:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--text);
  font-weight: 600;
}

.nav-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sidebar__foot {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.sidebar__langs { display: flex; gap: 0.35rem; }

.sidebar__note {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Context = horizontal strip inside workspace (not a 3rd grid column) */
.context-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.35rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.context-bar[hidden] { display: none !important; }

.context-bar__score {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  flex: 1 1 220px;
}

.context-bar__ring-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.context-bar__ring {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}

.context-bar__ring .score-card__bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 5;
}

.context-bar__ring .score-card__fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 138.2;
  stroke-dashoffset: 138.2;
  transition: stroke-dashoffset 1s ease, stroke 0.3s;
}

.context-bar__score-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.context-bar__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.context-bar__meta strong { font-size: 0.95rem; }

.context-bar__file {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.context-bar__summary {
  flex: 1 1 200px;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 420px;
  margin: 0;
}

.context-bar__filemeta {
  display: flex;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.context-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.context-bar__actions .btn {
  width: auto;
  white-space: nowrap;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.workspace__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.workspace__title {
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.workspace__menu { display: none; }

.workspace__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 2rem;
}

.panel {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Ofertas / Informe: ancho completo + 2 columnas */
.panel.panel--offers,
.panel.panel--report {
  max-width: none;
  width: 100%;
  display: block;
}

.report-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas: "main side";
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}

.report-layout__main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.report-layout__side {
  grid-area: side;
  position: sticky;
  top: 0.75rem;
  align-self: start;
  width: 340px;
  max-width: 100%;
}

.card--cv-coach {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cv-coach__hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.cv-coach__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.cv-coach__provider {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cv-coach__textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  font-family: var(--font);
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.cv-coach__textarea:focus {
  outline: none;
  border-color: var(--accent);
}

@media (max-width: 900px) {
  .report-layout {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "side"
      "main";
  }
  .report-layout__side {
    position: static;
    width: 100%;
  }
}

.offers-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas: "main side";
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.offers-layout__main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.offers-layout__side {
  grid-area: side;
  position: sticky;
  top: 0.75rem;
  align-self: start;
  width: 340px;
  max-width: 100%;
}

.card--job-sticky {
  margin: 0;
  width: 100%;
}

.card--job-sticky .card__title {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.card--job-sticky .job-offer__panel {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card--job-sticky .job-offer__textarea {
  min-height: 220px;
  resize: vertical;
}

.btn--block {
  width: 100%;
  justify-content: center;
}

@media (max-width: 900px) {
  .offers-layout {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "main"
      "side";
  }
  .offers-layout__side {
    position: static;
    width: 100%;
  }
  .card--job-sticky .job-offer__textarea {
    min-height: 160px;
  }
}

.panel[hidden],
[hidden] { display: none !important; }

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}

.panel__title {
  font-size: 1.15rem;
  font-weight: 650;
  margin: 0;
}

.panel--empty {
  align-items: flex-start;
  gap: 1rem;
  color: var(--text-muted);
  padding-top: 2rem;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 25;
}

@media (max-width: 960px) {
  body { overflow: auto; }
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    min-width: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
  }
  .sidebar-backdrop:not([hidden]) { display: block; }
  .context-bar__actions { margin-left: 0; }
  .workspace__menu { display: inline-flex; }
  .workspace__body { overflow: visible; }
}

/* Legacy header bits (unused in shell) */
.header { display: none; }
.header__actions { display: flex; gap: 0.35rem; }

.btn--lang {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
}

.btn--lang.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn--primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn--small {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

.report__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.job-url-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.job-import-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
}

.job-import-meta__chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
}

.job-import-meta__chip strong {
  color: var(--text);
  font-weight: 600;
}

.job-offer__input {
  flex: 1;
  min-width: 200px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
}

.card--history { margin-top: 1.25rem; }

.history__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.history__header .card__title { margin: 0; }

.history__list { display: flex; flex-direction: column; gap: 0.5rem; }

.history__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.history__item:last-child { border-bottom: none; }

.history__info { min-width: 0; flex: 1; }

.history__info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history__actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.4rem;
  align-items: center;
}

.btn--danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.btn--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  color: #fca5a5;
}

.history__meta { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }

.history__empty { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }

.section-scores { display: flex; flex-direction: column; gap: 0.85rem; }

.section-score__header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.section-score__bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.section-score__fill { height: 100%; border-radius: 999px; transition: width 0.8s ease; }

.section-score__notes { font-size: 0.78rem; color: var(--text-muted); }

.experience__summary { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.65rem; }

.experience__periods { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.duplicate-item { font-size: 0.85rem; margin-bottom: 0.4rem; }

.phrase-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.phrase-item:last-child { border-bottom: none; }

.phrase-item__context { font-size: 0.78rem; color: var(--accent); margin-bottom: 0.35rem; }

.phrase-item__text {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  padding: 0.65rem;
  background: var(--surface-2);
  border-radius: 6px;
  border-left: 3px solid var(--success);
}

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

.header__logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.15rem;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.dropzone:hover,
.dropzone:focus,
.dropzone--active {
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 0 0 4px var(--accent-glow);
  outline: none;
}

.dropzone__icon {
  color: var(--accent);
  margin-bottom: 1rem;
}

.dropzone__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.dropzone__hint {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.dropzone__file {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  word-break: break-all;
}

/* Job offer input */
.card--job {
  margin-bottom: 0;
  padding: 1.1rem 1.35rem;
}

.card--job-offers {
  border-color: rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(59, 130, 246, 0.07) 100%);
}

.job-offers__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.job-offers__header-row .card__title {
  margin: 0;
}

.job-offers__header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.job-offers__more-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0.25rem;
}

.job-offers__appending {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.offers-toolbar {
  align-items: flex-start;
  gap: 0.75rem;
}

.offers-toolbar__title {
  flex: 1;
  min-width: 0;
}

.offers-toolbar__title .panel__title {
  margin-bottom: 0.2rem;
}

.offers-toolbar .job-offers__profile {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.offers-quickbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, var(--card-bg, rgba(255, 255, 255, 0.03)));
  position: sticky;
  top: 0.5rem;
  z-index: 5;
  backdrop-filter: blur(8px);
}

.offers-filters {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
}

.offers-filters__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  user-select: none;
}

.offers-filters__summary::-webkit-details-marker {
  display: none;
}

.offers-filters__summary::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.offers-filters[open] > .offers-filters__summary::before {
  transform: rotate(45deg);
}

.offers-filters__hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.offers-filters__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0 0.9rem 0.9rem;
  border-top: 1px solid var(--border);
}

.offers-filters .search-terms,
.offers-filters .job-offers__dealbreakers-label,
.offers-filters .job-source-filters {
  margin: 0;
}

.job-offers__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 0.25rem;
}

.job-offers__mode-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.job-offers__mode-select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.search-terms {
  margin: 0.75rem 0 0.35rem;
}

.search-terms__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

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

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn--ghost:hover {
  color: var(--danger, #b91c1c);
  border-color: rgba(185, 28, 28, 0.35);
  background: rgba(185, 28, 28, 0.06);
}

.search-terms__add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
  align-items: center;
}

.search-terms__input {
  flex: 1 1 180px;
  min-width: 140px;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.search-terms__hint {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tags--search {
  gap: 0.45rem;
}

.tag--search {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  cursor: default;
}

.tag--search.tag--custom {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
}

.tag--search .tag__label {
  border: none;
  background: transparent;
  color: inherit;
  cursor: default;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.2;
  padding: 0.35rem 0.55rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.tag--search .tag__remove {
  border: none;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tag--search .tag__remove:hover,
.tag--search .tag__remove:focus-visible {
  background: rgba(185, 28, 28, 0.14);
  color: var(--danger, #b91c1c);
  outline: none;
}

.job-offers__dealbreakers-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.65rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.job-offers__dealbreakers {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  width: 100%;
}

.job-listing__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.job-listing__actions .btn-use-listing {
  font-weight: 600;
}

.job-listing__actions .btn--ghost-action {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  padding-inline: 0.55rem;
}

.job-listing__actions .btn--ghost-action:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
  border-color: transparent;
}

.job-listing__actions .btn--saved {
  color: #86efac;
}

.llm-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.llm-badge--ok {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}

.llm-badge--off {
  border-color: rgba(148, 163, 184, 0.35);
  color: #94a3b8;
}

.card--tracker {
  margin-top: 1rem;
  border-color: rgba(245, 158, 11, 0.3);
}

.panel__head--tracker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.tracker__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.tracker__view-toggle {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.15rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
}
.tracker__view-btn.active {
  background: var(--bg, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.tracker__hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}

.tracker__followups {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(8, 145, 178, 0.25);
  background: rgba(8, 145, 178, 0.08);
}
.tracker__followups-title {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
}
.tracker__followups-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}
.tracker__followups-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.85rem;
  align-items: baseline;
}
.tracker__followups-item--overdue em { color: #b91c1c; font-style: normal; font-weight: 600; }
.tracker__followups-item--today em { color: #c2410c; font-style: normal; font-weight: 600; }
.tracker__followups-item--soon em { color: #0e7490; font-style: normal; font-weight: 600; }

.tracker__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: end;
  width: 100%;
  margin-top: 0.35rem;
}
.tracker__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.tracker__field select,
.tracker__followup {
  min-width: 8rem;
  font-size: 0.85rem;
}
.tracker__fu-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.tracker__fu-badge--overdue { background: #fee2e2; color: #991b1b; }
.tracker__fu-badge--today { background: #ffedd5; color: #9a3412; }
.tracker__fu-badge--soon { background: #cffafe; color: #155e75; }

.tracker__item--prio-high { border-left: 3px solid #dc2626; }
.tracker__item--prio-medium { border-left: 3px solid #0891b2; }
.tracker__item--prio-low { border-left: 3px solid #94a3b8; }

.tracker__kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-top: 0.5rem;
}
.kanban__col {
  min-width: 200px;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 720px);
}
.kanban__col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.kanban__col-head h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}
.kanban__count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.06);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}
.kanban__drop {
  flex: 1;
  overflow-y: auto;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
}
.kanban__drop--over {
  outline: 2px dashed #0891b2;
  outline-offset: -4px;
  background: rgba(8, 145, 178, 0.08);
}
.kanban__empty {
  margin: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}
.kanban__card {
  background: var(--bg, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.kanban__card--dragging {
  opacity: 0.55;
}
.kanban__card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  align-items: start;
}
.tracker__fields--compact .tracker__field select,
.tracker__fields--compact .tracker__followup {
  min-width: 0;
  width: 100%;
}

@media (max-width: 900px) {
  .tracker__kanban {
    grid-template-columns: repeat(5, minmax(180px, 85vw));
  }
}

.tracker__list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tracker__item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.tracker__item:last-child {
  border-bottom: none;
}

.tracker__top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
}

.tracker__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.tracker__title:hover {
  color: var(--accent, #60a5fa);
}

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

.tracker__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.tracker__status {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.cover-dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  max-width: min(640px, 94vw);
  width: 100%;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.cover-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.cover-dialog__form {
  padding: 1rem 1.15rem 1.15rem;
}

.cover-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.cover-dialog__header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.cover-dialog__meta,
.cover-dialog__provider {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cover-dialog__textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

.cover-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.job-listing__badges {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.35rem;
}

.job-listing__score.score--high {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.job-listing__score.score--mid {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
}

.job-listing__score.score--low,
.job-listing__score.score--none {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.job-listing__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.job-listing__reasons {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.job-listing__skills .tag--missing {
  opacity: 0.85;
}

#btn-load-more-offers {
  margin-top: 0.85rem;
  width: 100%;
}

.job-source-filters {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.75rem 0 0.25rem;
}

.job-filters__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.job-filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.source-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
}

.source-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.source-chip--active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  color: var(--text);
  font-weight: 600;
}

.source-chip--skill.source-chip--active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.55);
}

.source-chip__count {
  opacity: 0.7;
  margin-left: 0.2rem;
  font-weight: 500;
}

.tag--filter-active {
  outline: 2px solid rgba(16, 185, 129, 0.65);
  outline-offset: 1px;
}

.job-listing__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.job-listing__source {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-listing__score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .job-listing {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
  .job-listing__scorecol {
    justify-content: flex-start;
  }
  .job-listing__score {
    min-width: auto;
    height: auto;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
  }
}

.job-offers__profile {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.65rem;
}

.job-offers__list-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.35rem 0 0.65rem;
}

.job-offers__subtitle {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.job-offers__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}

.job-offers__empty {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0.75rem 0;
  padding: 1.25rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
}

.job-listings {
  margin-top: 0.15rem;
}

.job-listings__stack {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.job-listing {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface, var(--bg));
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.job-listing:hover {
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.job-listing--score--high {
  border-left: 3px solid #22c55e;
}
.job-listing--score--mid {
  border-left: 3px solid #f59e0b;
}
.job-listing--score--low,
.job-listing--score--none {
  border-left: 3px solid #64748b;
}

.job-listing__scorecol {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.1rem;
}

.job-listing__body {
  min-width: 0;
}

.job-listing__title {
  font-weight: 650;
  font-size: 0.98rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}

.job-listing__title:hover {
  color: var(--accent);
  text-decoration: underline;
}

.job-listing__meta {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.job-listing__snippet {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-listing .btn {
  flex-shrink: 0;
}

.offers-roles {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.offers-roles__summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  list-style: none;
}

.offers-roles__summary::-webkit-details-marker { display: none; }

.offers-roles__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0 0.9rem 0.9rem;
  border-top: 1px solid var(--border);
}

.job-offers__list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.job-offer-role {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.job-offer-role__title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.job-offer-role__reason {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.job-offer-role__boards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

a.job-offer-role__link {
  text-decoration: none;
  color: inherit;
}

.job-offers__hint {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.job-offer__header { margin-bottom: 0; }

.job-offer__toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.job-offer__toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.job-offer__hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 0.4rem;
  margin-left: 1.6rem;
}

.job-offer__panel { margin-top: 0.85rem; }

.job-offer__textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.55;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 140px;
}

.job-offer__textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.job-offer__textarea::placeholder { color: var(--text-muted); opacity: 0.7; }

/* Job match results */
.card--job-match {
  border-color: rgba(139, 92, 246, 0.35);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(139, 92, 246, 0.08) 100%);
}

.job-match__score {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.job-match__bar-wrap {
  flex: 1;
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.job-match__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8b5cf6, #3b82f6);
  border-radius: 999px;
  transition: width 1s ease;
}

.job-match__stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 100px;
}

.job-match__percent {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

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

.job-match__title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.job-match__summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.job-match__subtitle {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.job-match__subtitle--ok { color: var(--success); }
.job-match__subtitle--missing { color: var(--danger); }

.job-match__keywords { margin-top: 0.5rem; }

.job-match__gate {
  margin: 0.4rem 0 0.6rem;
  font-size: 0.9rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  background: #f4f4f5;
}
.job-match__gate--fail { background: #fde8e8; color: #9b1c1c; }
.job-match__gate--flag { background: #fef3c7; color: #92400e; }
.job-match__gate--pass { background: #e8f8ef; color: #166534; }

.job-match__dimensions {
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0;
}
.job-match__dim {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
}
.job-match__dim-label { color: var(--muted, #555); }
.job-match__dim-bar-wrap {
  height: 6px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}
.job-match__dim-bar {
  height: 100%;
  background: var(--accent, #2563eb);
  border-radius: 99px;
}
.job-match__dim-score { font-variant-numeric: tabular-nums; min-width: 2.5rem; text-align: right; }
.job-match__dim-notes {
  grid-column: 1 / -1;
  color: var(--muted, #666);
  font-size: 0.8rem;
  margin: -0.15rem 0 0.25rem;
}
.job-match__list {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
}
.job-match__list li { margin: 0.2rem 0; }

.job-match__adapt {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.job-match__adapt-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 36rem;
  line-height: 1.4;
}

.tracker__capture {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
}
.tracker__capture-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.input {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg, #fff);
  color: inherit;
  font: inherit;
}
.tracker__capture-row .input {
  flex: 1 1 14rem;
  min-width: 0;
}
.tracker__hint--small {
  margin-top: 0.75rem;
  font-size: 0.8rem;
}
.tracker__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.tracker__notes {
  width: 100%;
  margin-top: 0.45rem;
  min-height: 2.4rem;
  resize: vertical;
  font-size: 0.85rem;
}

.offers-bg-banner {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  background: rgba(8, 145, 178, 0.12);
  border: 1px solid rgba(8, 145, 178, 0.35);
  color: #0e7490;
  font-size: 0.85rem;
  font-weight: 500;
}
.offers-bg-banner[hidden] {
  display: none !important;
}
.app-shell.offers-searching #nav-offers .nav-item__label::after {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.35rem;
  border-radius: 50%;
  background: #0891b2;
  animation: offers-pulse 1s ease-in-out infinite;
}
@keyframes offers-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* —— Vista previa CV (HTML = diseño PDF referencia) —— */
.cv-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: #0f172a;
}
.cv-preview-modal[hidden] {
  display: none !important;
}
.cv-preview-modal__chrome {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1.1rem;
  background: #1e293b;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}
.cv-preview-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f8fafc;
}
.cv-preview-modal__sub {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}
.cv-preview-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.cv-preview-modal__frame {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #e2e8f0;
}

.tag--matched {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--success);
}

.tag--missing {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.error-banner {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.9rem;
}

/* Loading */
.loading-section {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  align-items: center;
}

.loading-section__sub {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Report below upload */
.report {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

.report__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.report__title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.upload-section--compact .dropzone {
  padding: 1.5rem 1rem;
}

.upload-section--compact .dropzone__icon svg {
  width: 32px;
  height: 32px;
}

.upload-section--compact .dropzone__title {
  font-size: 1rem;
}

/* Hemingway writing analysis */
.card--hemingway {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(180deg, #1a1814 0%, var(--surface) 120px);
}

.hemingway__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.hemingway__subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.hemingway__subtitle a {
  color: #fbbf24;
  text-decoration: none;
}

.hemingway__subtitle a:hover { text-decoration: underline; }

.hemingway__score {
  text-align: right;
  flex-shrink: 0;
}

.hemingway__score span {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fbbf24;
  line-height: 1.1;
}

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

.hemingway__summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hemingway__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hemingway__stat {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.hemingway__stat strong {
  color: var(--text);
  font-weight: 600;
}

.hemingway__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.hemingway__key {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.hemingway__key--very-hard { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.hemingway__key--hard { background: rgba(245, 158, 11, 0.25); color: #fcd34d; }
.hemingway__key--adverb { background: rgba(59, 130, 246, 0.25); color: #93c5fd; }
.hemingway__key--passive { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.hemingway__key--wordy { background: rgba(168, 85, 247, 0.25); color: #d8b4fe; }
.hemingway__key--skip { background: rgba(139, 149, 168, 0.2); color: var(--text-muted); }

.hemingway__note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.hemingway__editor mark.hl--skip {
  background: rgba(139, 149, 168, 0.2);
  color: #6b7280;
  cursor: default;
}

.hemingway__editor {
  font-family: "Literata", Georgia, serif;
  font-size: 1rem;
  line-height: 1.75;
  padding: 1.25rem 1.5rem;
  background: #faf8f5;
  color: #1a1a1a;
  border-radius: 8px;
  border: 1px solid #e5e0d8;
  max-height: 420px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 1rem;
  min-height: 8rem;
}

.hemingway__editor--plain {
  opacity: 0.95;
}

.hemingway__empty {
  margin: 0;
  color: #6b7280;
  font-style: italic;
  font-size: 0.92rem;
}

.hemingway__editor mark {
  border-radius: 2px;
  padding: 0 2px;
  cursor: help;
}

.hemingway__editor mark.hl--very-hard { background: rgba(239, 68, 68, 0.45); }
.hemingway__editor mark.hl--hard { background: rgba(245, 158, 11, 0.45); }
.hemingway__editor mark.hl--adverb { background: rgba(59, 130, 246, 0.35); color: #1e3a5f; }
.hemingway__editor mark.hl--passive { background: rgba(34, 197, 94, 0.35); }
.hemingway__editor mark.hl--wordy { background: rgba(168, 85, 247, 0.35); }

.hemingway__issues { margin-bottom: 0.75rem; }

.hemingway__issue {
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: var(--surface-2);
  border-left: 3px solid var(--warning);
  font-size: 0.85rem;
}

.hemingway__issue--alta { border-color: var(--danger); }
.hemingway__issue--media { border-color: var(--warning); }
.hemingway__issue--baja { border-color: var(--info); }

.hemingway__issue strong { display: block; margin-bottom: 0.2rem; }
.hemingway__issue em { color: var(--text-muted); font-style: normal; font-size: 0.82rem; }

.hemingway__external {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.hemingway__external a {
  color: #fbbf24;
  text-decoration: none;
  font-weight: 500;
}

.hemingway__external a:hover { text-decoration: underline; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Results */
.results__toolbar { margin-bottom: 1.5rem; }

.btn {
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

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

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

/* Score card */
.score-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.score-card__circle {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.score-card__circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-card__bg {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 8;
}

.score-card__fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 138.2;
  stroke-dashoffset: 138.2;
  transition: stroke-dashoffset 1s ease, stroke 0.3s;
}

.score-card__value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
}

.score-card__value small {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.score-card__info h2 {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.score-card__info p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 480px;
}

.score-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.score-card__meta span::before {
  content: "·";
  margin-right: 0.75rem;
  opacity: 0.4;
}

.score-card__meta span:first-child::before { content: none; margin: 0; }

.badge {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge--ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge--bad {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Grid & cards */
.grid {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel .card {
  margin-bottom: 0;
}

.panel .grid {
  margin-bottom: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}

.card--highlight {
  border-color: rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(59, 130, 246, 0.06) 100%);
}

.card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.card--collapsible { padding: 0; overflow: hidden; }

.card__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
}

.card__toggle .card__title { margin: 0; }

.card__chevron {
  color: var(--text-muted);
  transition: transform 0.2s;
  font-size: 0.75rem;
}

.card__toggle[aria-expanded="true"] .card__chevron { transform: rotate(180deg); }

/* Contact */
.contact-list {
  display: grid;
  gap: 0.65rem;
}

.contact-list dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.contact-list dd {
  font-size: 0.95rem;
  word-break: break-all;
}

.contact-list dd.missing { color: var(--text-muted); font-style: italic; }

/* Section coverage */
.section-coverage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}

.coverage-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  background: var(--surface-2);
}

.coverage-item--ok { color: var(--success); }
.coverage-item--missing { color: var(--text-muted); }

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

.tags--empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.languages-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.language-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.language-item__name {
  font-weight: 600;
  font-size: 0.9rem;
}

.language-item__level {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Lists */
.list { list-style: none; }

.list li {
  padding: 0.45rem 0;
  padding-left: 1.25rem;
  position: relative;
  font-size: 0.9rem;
}

.list--success li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

/* Issues */
.issue {
  padding: 0.85rem;
  border-radius: 8px;
  margin-bottom: 0.65rem;
  border-left: 3px solid;
}

.issue--critical {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--danger);
}

.issue--warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--warning);
}

.issue--info {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--info);
}

.issue__title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

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

.issue__suggestion {
  font-size: 0.85rem;
  margin-top: 0.35rem;
  color: var(--accent);
}

/* Improvements */
.improvement {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.improvement:last-child { border-bottom: none; padding-bottom: 0; }

.improvement__priority {
  flex-shrink: 0;
  width: 52px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0;
  border-radius: 4px;
  align-self: flex-start;
}

.improvement__priority--alta {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.improvement__priority--media {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.improvement__priority--baja {
  background: rgba(99, 102, 241, 0.15);
  color: var(--info);
}

.improvement__title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.improvement__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.improvement__action {
  font-size: 0.85rem;
  color: var(--success);
}

/* Sections extracted */
.section-block {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.section-block:last-child { border-bottom: none; }

.section-block h4 {
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.section-block p {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  max-height: 120px;
  overflow: hidden;
  position: relative;
}

.section-block p.expanded { max-height: none; }

/* Raw text */
.raw-text {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  padding: 1.35rem;
  background: var(--bg);
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}

/* Footer */
.footer { display: none; }

.card--history { margin-top: 0; }
.panel--tracker .tracker__list { margin-top: 0.5rem; }

@media (max-width: 600px) {
  .score-card { flex-direction: column; text-align: center; }
  .score-card__meta { justify-content: center; }
}
