:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #f8faf7;
  --surface-strong: #ffffff;
  --ink: #101312;
  --muted: #5f6762;
  --line: #dce3dc;
  --accent: #7fa36f;
  --accent-dark: #245c8f;
  --accent-soft: #e8f1ea;
  --accent-line: rgb(36 92 143 / 0.32);
  --green: #1f6f4c;
  --red: #aa3730;
  --blue: #245c8f;
  --steel: #eef3f0;
  --shadow: 0 16px 40px rgb(16 19 18 / 0.06);
  --radius: 8px;
  --max-width: 1180px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(90deg, rgb(16 19 18 / 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgb(16 19 18 / 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 64px 64px;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--green);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 12px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid rgb(16 19 18 / 0.1);
  background: rgb(255 255 255 / 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 48px;
  max-width: 188px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.nav-button,
.filter-button,
.primary-action,
.secondary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.nav-button,
.filter-button,
.ghost-action {
  background: transparent;
}

.nav-button:hover,
.filter-button:hover,
.ghost-action:hover {
  border-color: rgb(16 19 18 / 0.16);
  background: rgb(248 250 247 / 0.96);
}

.nav-button.is-active,
.filter-button.is-active {
  border-color: rgb(16 19 18 / 0.16);
  background: var(--surface-strong);
  box-shadow: 0 6px 18px rgb(16 19 18 / 0.06);
}

main {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero-grid {
  display: block;
  min-height: 0;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 860px;
  min-height: 300px;
  padding: clamp(18px, 4vw, 44px) clamp(4px, 2vw, 28px);
  border-left: 5px solid var(--accent);
}

.eyebrow {
  display: none;
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.05rem, 5.4vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-logo-heading {
  max-width: min(100%, 560px);
  margin-bottom: 18px;
  line-height: 1;
}

.hero-logo {
  display: block;
  width: min(100%, 520px);
  height: auto;
  object-fit: contain;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.55;
}

.hero-actions,
.portfolio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.primary-action {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.secondary-action {
  border-color: rgb(127 163 111 / 0.55);
  background: var(--accent-soft);
  color: var(--ink);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
}

.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.92rem;
}

.market-visual {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.94), rgb(238 243 240 / 0.88)),
    var(--steel);
  box-shadow: var(--shadow);
}

.market-visual canvas {
  width: 100%;
  height: 100%;
  min-height: 430px;
  display: block;
}

.market-strip {
  position: absolute;
  top: 14px;
  right: 14px;
  left: auto;
  bottom: auto;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgb(16 19 18 / 0.12);
  border-radius: 999px;
  padding: 6px 10px 6px 7px;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgb(16 19 18 / 0.08);
}

.market-strip span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--accent));
  color: #ffffff;
  font-weight: 900;
}

.market-strip strong {
  font-size: 0.92rem;
  white-space: nowrap;
}

.market-strip em {
  display: none;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.section-grid,
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.tools-overview {
  grid-column: 1 / -1;
}

.panel,
.content-band {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 12px 34px rgb(16 19 18 / 0.045);
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.content-band {
  margin-top: 18px;
  padding: clamp(18px, 3vw, 30px);
}

.guide-band {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: start;
}

.guide-copy p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.6;
}

/* CTAs en stack a la derecha (sustituye al lead-form) */
.guide-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: start;
}
.guide-cta-stack .primary-action,
.guide-cta-stack .secondary-action {
  text-align: center;
  width: 100%;
}

.guide-points {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.lead-form {
  display: grid;
  gap: 12px;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.lead-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.lead-form input[type="email"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.lead-form input[type="email"]:focus {
  border-color: var(--accent-line);
  background: #ffffff;
}

.consent-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px !important;
  font-weight: 600 !important;
  line-height: 1.45;
}

.consent-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent-dark);
}

.form-status {
  min-height: 22px;
  margin-bottom: 0;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.form-status.is-error {
  color: var(--red);
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading > p:not(.eyebrow) {
  max-width: none;
  font-size: 1.02rem;
  line-height: 1.6;
}

.section-heading p:last-child,
.page-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.priority-list {
  display: grid;
  gap: 14px;
}

.priority-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid rgb(16 19 18 / 0.08);
}

.priority-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.priority-item p,
.tool-link-item p,
.topic-card p,
.post-card p,
.article-body p,
.affiliate-box p {
  color: var(--muted);
  line-height: 1.55;
}

.status-dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
}

.status-dot.accent {
  background: var(--accent);
}

.status-dot.red {
  background: var(--red);
}

.status-dot.green {
  background: var(--green);
}

.tool-preview-list,
.topic-list,
.post-grid,
.result-grid,
.portfolio-summary {
  display: grid;
  gap: 12px;
}

.tool-preview-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}

.tool-link-item,
.topic-card {
  display: grid;
  gap: 5px;
  padding: 16px 0;
  border-bottom: 1px solid rgb(16 19 18 / 0.1);
}

.tool-link-item {
  align-content: start;
  min-height: 190px;
  border: 1px solid rgb(16 19 18 / 0.1);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
}

.tool-link-item:last-child {
  border-bottom: 1px solid rgb(16 19 18 / 0.1);
}

.topic-card:last-child {
  border-bottom: 0;
}

.tool-link-item span,
.topic-card p,
.result-grid span,
.portfolio-summary span {
  color: var(--muted);
  font-size: 0.86rem;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgb(16 19 18 / 0.12);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--ink) !important;
  font-size: 1.45rem !important;
  font-weight: 900;
}

.tool-link-item h3 {
  margin-bottom: 8px;
}

.topic-card h3 {
  margin-bottom: 0;
}

.tool-link-item p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.tool-link-item button,
.topic-card button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
}

.tool-link-item button:hover,
.topic-card button:hover,
.post-card h3 a:hover,
.read-more-link:hover {
  color: var(--green);
}

.topic-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.topic-card {
  display: grid;
  justify-items: center;
  text-align: center;
  align-content: start;
  gap: 14px;
  min-height: 220px;
  border: 1px solid rgb(16 19 18 / 0.1);
  border-radius: var(--radius);
  padding: 24px 20px;
  background: var(--surface);
}

.topic-card:last-child {
  border-bottom: 0;
}

.topic-card h3,
.topic-card p {
  grid-column: auto;
}

.topic-image {
  width: 104px;
  height: 104px;
  border: 1px solid rgb(16 19 18 / 0.1);
  border-radius: var(--radius);
  background: var(--surface-strong);
  object-fit: cover;
}

.recommended-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.recommended-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid rgb(16 19 18 / 0.1);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}

.recommended-card.is-featured {
  grid-row: auto;
}

.recommended-image {
  display: block;
  overflow: hidden;
  border: 1px solid rgb(16 19 18 / 0.1);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.recommended-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 180ms ease;
}

.recommended-image:hover img {
  transform: scale(1.025);
}

.recommended-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.recommended-card h3 {
  margin-bottom: 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.recommended-card h3 a {
  color: var(--blue);
  text-decoration: none;
}

.recommended-card h3 a:hover {
  color: var(--green);
}

.recommended-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.latest-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.latest-post {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.latest-post:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.latest-post-image {
  display: block;
  overflow: hidden;
  border: 1px solid rgb(16 19 18 / 0.1);
  border-radius: var(--radius);
  background: var(--surface);
}

.latest-post-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.latest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.latest-post h3 {
  margin-bottom: 6px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.latest-post h3 a {
  color: var(--blue);
  text-decoration: none;
}

.latest-post h3 a:hover {
  color: var(--green);
}

.home-resource-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  gap: 28px;
  align-items: start;
}

.home-resource-intro {
  display: grid;
  gap: 14px;
}

.home-resource-intro img {
  display: block;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
}

.home-resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
}

.home-resource-list a,
.home-resource-list button {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 86px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 16px;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
}

.home-resource-list a:nth-child(n + 3),
.home-resource-list button:nth-child(n + 3) {
  padding-top: 16px;
}

.home-resource-list a:hover,
.home-resource-list button:hover {
  color: var(--green);
}

.home-resource-list span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.page-heading {
  max-width: 860px;
  margin-bottom: 24px;
}

.page-heading h1 {
  margin-bottom: 10px;
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.08;
}

.blog-search {
  display: grid;
  gap: 8px;
  max-width: 620px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.blog-search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
}

.blog-search input:focus {
  border-color: rgb(36 92 143 / 0.42);
  box-shadow: 0 0 0 3px rgb(36 92 143 / 0.1);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.post-grid {
  gap: 0;
  border-top: 1px solid var(--line);
}

.post-card {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  min-height: 0;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.post-image-link {
  display: block;
  overflow: hidden;
  border: 1px solid rgb(16 19 18 / 0.1);
  border-radius: var(--radius);
  background: var(--surface);
}

.post-image-link img,
.article-hero-image img {
  display: block;
  width: 100%;
  object-fit: cover;
}

.post-image-link img {
  aspect-ratio: 16 / 10;
  transition: transform 180ms ease;
}

.post-image-link:hover img {
  transform: scale(1.025);
}

.post-content {
  min-width: 0;
}

.post-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.post-meta-line {
  align-items: center;
  margin-bottom: 8px;
}

.post-card h3 {
  max-width: 680px;
  margin-bottom: 10px;
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
}

.post-card h3 a,
.read-more-link {
  color: var(--blue);
  text-decoration: none;
}

.read-more-link {
  display: inline-flex;
  margin-top: 4px;
  font-weight: 800;
}

/* Noindex badge — visible in the prototype/admin view */
.noindex-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 4px;
  background: #aa3730;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: help;
}

.post-card.is-noindex {
  opacity: 0.6;
}

.post-card.is-noindex:hover {
  opacity: 1;
}

.post-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
}

.pagination-summary {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pagination-arrow,
.pagination-page {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--blue);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.pagination-page {
  font-size: 0.92rem;
}

.pagination-arrow:hover:not(:disabled),
.pagination-page:hover:not(.is-active) {
  border-color: rgb(36 92 143 / 0.38);
  background: var(--accent-soft);
  color: var(--green);
}

.pagination-page.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.pagination-arrow:disabled {
  cursor: default;
  opacity: 0.38;
}

.empty-state {
  margin: 0;
  padding: 26px 0;
  color: var(--muted);
}

.article-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.article-status-badge.accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.article-status-badge.green {
  background: #e1f1e8;
  color: #14533a;
}

.article-status-badge.red {
  background: #f6dfdc;
  color: #7b241f;
}

.resource-feature {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.resource-feature figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  aspect-ratio: 4 / 3;
}

.resource-feature figure picture {
  display: block;
  width: 100%;
  height: 100%;
}

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

.resource-intro {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.resource-link-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.resource-link-list article {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.resource-link-list h2 {
  margin-bottom: 6px;
  font-size: 1.2rem;
}

.resource-link-list h2 a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s;
}

.resource-link-list h2 a:hover {
  color: var(--accent-dark);
}

.resource-link-list p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.resource-feature-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 18px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.resource-feature-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(127 163 111 / 0.3);
}

.article-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 760px);
  align-items: start;
  gap: 24px;
}

.article-meta,
.article-body {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 12px 34px rgb(16 19 18 / 0.045);
}

.article-meta {
  position: sticky;
  top: 98px;
  padding: 18px;
}

.article-meta dl,
.article-meta dd {
  margin: 0;
}

.article-meta dl {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.article-meta dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.article-meta dd {
  margin-top: 4px;
  line-height: 1.4;
}

.article-body {
  padding: clamp(22px, 5vw, 56px);
}

.article-body h1 {
  font-size: clamp(2.2rem, 6vw, 4.3rem);
}

.article-hero-image {
  overflow: hidden;
  margin: 22px 0 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-hero-image img {
  max-height: 420px;
}

.article-content-full {
  max-width: 100%;
  overflow-wrap: break-word;
}

.article-content-full figure,
.article-content-full .wp-block-image,
.article-content-full .wp-block-gallery,
.article-content-full .blocks-gallery-grid,
.article-content-full .blocks-gallery-item {
  max-width: 100% !important;
}

.article-content-full figure {
  margin: 28px 0;
}

.article-content-full .aligncenter {
  margin-right: auto;
  margin-left: auto;
}

.article-content-full .alignleft,
.article-content-full .alignright {
  float: none;
  margin-right: 0;
  margin-left: 0;
}

.article-content-full img {
  display: block;
  width: auto;
  max-width: 100% !important;
  height: auto !important;
  border-radius: var(--radius);
}

.article-content-full figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.article-content-full .wp-block-gallery,
.article-content-full .blocks-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 12px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}

.article-content-full .blocks-gallery-item {
  margin: 0;
  min-width: 0;
}

.article-content-full .blocks-gallery-item figure,
.article-content-full .blocks-gallery-item img {
  width: 100%;
}

.article-content-full iframe,
.article-content-full video {
  max-width: 100%;
}

.article-content-full .wp-block-embed__wrapper {
  max-width: 100%;
  overflow-x: auto;
  overflow-wrap: anywhere;
}

.article-body h2 {
  margin-top: 34px;
}

.article-lead {
  font-size: 1.2rem;
}

.article-callout,
.affiliate-box {
  margin: 28px 0;
  border: 1px solid rgb(16 19 18 / 0.12);
  border-radius: var(--radius);
  padding: 18px;
}

.article-callout {
  background: #eef6f1;
}

.affiliate-box {
  background: #edf4f0;
}

.affiliate-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-weight: 900;
}

.check-list {
  display: grid;
  gap: 10px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.tool-panel {
  min-height: 600px;
}

.legacy-trading-panel {
  grid-column: 1 / -1;
  min-height: 0;
}

.portfolio-tool-panel,
.dca-tool-panel {
  grid-column: 1 / -1;
}

.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tool-tab {
  min-height: 40px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-radius: var(--radius);
  padding: 0 13px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.tool-tab.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.dca-data-status {
  margin: -4px 0 16px;
  border: 1px solid rgb(36 92 143 / 0.2);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #eef5f8;
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 800;
}

.dca-data-status.is-loading {
  border-color: rgb(31 111 76 / 0.24);
  background: #edf7f1;
  color: var(--green);
}

.dca-data-status.is-warning {
  border-color: rgb(170 55 48 / 0.22);
  background: #fff8f7;
  color: var(--red);
}

.dca-form {
  display: grid;
  gap: 16px;
}

.dca-form fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid rgb(16 19 18 / 0.12);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}

.dca-form legend {
  padding: 0 6px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.dca-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dca-fieldset-note {
  max-width: 860px;
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.dca-simulated-field.is-inactive {
  opacity: 0.56;
}

.dca-simulated-field.is-inactive .dca-input-shell {
  background: #f3f5f2;
}

.dca-simulated-field input:disabled {
  cursor: not-allowed;
}

.dca-field,
.dca-check-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.dca-input-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-radius: var(--radius);
  background: #ffffff;
}

.dca-input-shell input,
.dca-input-shell select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 0;
  padding: 0 11px;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.dca-input-shell span {
  max-width: 112px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.dca-check-field {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  align-content: center;
  min-height: 44px;
  border: 1px solid rgb(16 19 18 / 0.08);
  border-radius: var(--radius);
  padding: 11px;
  background: #ffffff;
  line-height: 1.35;
}

.dca-check-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.dca-results {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.dca-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.dca-summary-grid div,
.dca-chart-card,
.dca-operation-panel,
.risk-note {
  border: 1px solid rgb(16 19 18 / 0.1);
  border-radius: var(--radius);
  background: var(--surface);
}

.dca-summary-grid div {
  min-height: 104px;
  padding: 14px;
}

.dca-field select {
  color: var(--ink);
  font-weight: 800;
}

.dca-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dca-summary-grid strong {
  display: block;
  margin-top: 12px;
  overflow-wrap: anywhere;
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  line-height: 1.15;
}

.dca-summary-grid .is-negative,
.dca-table .is-negative {
  color: var(--red);
}

.dca-table .is-positive {
  color: var(--green);
  font-weight: 900;
}

.dca-chart-card {
  overflow: hidden;
}

.dca-operation-panel {
  overflow: visible;
}

.dca-chart-card canvas {
  display: block;
  max-width: 100%;
}

.dca-chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgb(16 19 18 / 0.1);
  padding: 13px 14px;
  background: #ffffff;
}

.dca-chart-heading h3 {
  margin: 0;
}

.dca-chart-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.pf-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.pf-charts-grid canvas {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 820px) {
  .pf-charts-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Panel de resumen (lado derecho) ── */
.pf-stats-card {
  display: flex;
  flex-direction: column;
}

.pf-stats-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 24px;
  flex: 1;
  min-height: 300px;
  background: #ffffff;
}

.pf-stats-empty {
  margin: auto;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.pf-stats-hero {
  text-align: center;
  padding: 8px 0 14px;
  border-bottom: 1px solid rgb(16 19 18 / 0.08);
}

.pf-stats-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.pf-stats-value {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 800;
  color: var(--ink);
  margin: 4px 0 6px;
  line-height: 1.05;
}

.pf-stats-pnl {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.pf-stats-pnl span {
  font-weight: 600;
  margin-left: 4px;
}

.pf-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pf-stat-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pf-stat-k {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.pf-stat-v {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.pf-stats-extremes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pf-stat-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.92rem;
}

.pf-stat-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pf-stat-row strong {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pf-stat-row-val {
  font-weight: 700;
}

.pf-stats-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
}

.pf-chart-toggle {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.pf-chart-toggle-btn {
  border: 0;
  background: transparent;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.pf-chart-toggle-btn:hover {
  color: var(--ink);
}

.pf-chart-toggle-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.pf-chart-toggle-btn + .pf-chart-toggle-btn {
  border-left: 1px solid var(--line);
}

.pf-chart-toggle-btn.is-active + .pf-chart-toggle-btn,
.pf-chart-toggle-btn:has(+ .is-active) {
  border-color: var(--accent);
}

#dcaChart {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 320px;
}

.dca-table-wrap {
  overflow-x: auto;
  border: 1px solid rgb(16 19 18 / 0.1);
  border-radius: var(--radius);
}

.dca-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  background: #ffffff;
}

.dca-table th,
.dca-table td {
  border-bottom: 1px solid rgb(16 19 18 / 0.08);
  padding: 12px;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

.dca-table th {
  background: var(--steel);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dca-table td strong,
.dca-table td span {
  display: block;
}

.dca-table td span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.dca-operation-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 12px;
  height: 300px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.dca-operation-list::-webkit-scrollbar {
  width: 5px;
}

.dca-operation-list::-webkit-scrollbar-track {
  background: transparent;
}

.dca-operation-list::-webkit-scrollbar-thumb {
  background: rgb(16 19 18 / 0.18);
  border-radius: 4px;
}

.dca-operation-list::-webkit-scrollbar-thumb:hover {
  background: rgb(16 19 18 / 0.32);
}

.dca-operation {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  border: none;
  border-left: 3px solid var(--green);
  border-radius: 0 3px 3px 0;
  padding: 5px 10px;
  background: #ffffff;
}

.dca-operation.is-sell {
  border-left-color: var(--red);
  background: #fdf9f8;
}

.dca-operation span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  min-width: 58px;
  flex-shrink: 0;
}

.dca-operation strong {
  display: inline;
  margin: 0;
  font-size: 0.84rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.dca-operation p {
  margin: 0;
  color: var(--muted);
  font-size: 0.80rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.risk-note p,
.empty-state {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
}

.risk-note {
  margin-top: 18px;
  border-color: rgb(170 55 48 / 0.22);
  padding: 14px;
  background: #fff8f7;
}

/* ── DCA Tutorial ───────────────────────────────────────── */

.dca-tutorial {
  max-width: 860px;
  margin: 48px auto 0;
  padding: 0 20px 64px;
}

.dca-tutorial-header {
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--green);
}

.dca-tutorial-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 10px;
}

.dca-tutorial-lead {
  font-size: 1rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.dca-tutorial-section {
  margin-bottom: 40px;
}

.dca-tutorial-section h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgb(16 19 18 / 0.1);
}

.dca-tutorial-section h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--accent-dark);
  margin: 22px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dca-tutorial-section p {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 12px;
}

.dca-param-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dca-param-list > div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px 16px;
  padding: 9px 0;
  border-bottom: 1px solid rgb(16 19 18 / 0.06);
  align-items: baseline;
}

.dca-param-list > div:last-child {
  border-bottom: none;
}

.dca-param-list dt {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
}

.dca-param-list dd {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.dca-examples-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dca-example {
  background: var(--surface);
  border: 1px solid rgb(16 19 18 / 0.1);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 16px;
}

.dca-example h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 12px;
  text-transform: none;
  letter-spacing: 0;
}

.dca-example ul {
  margin: 0 0 10px;
  padding-left: 16px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
}

.dca-example p {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.dca-faq {
  background: var(--surface);
  border: 1px solid rgb(16 19 18 / 0.1);
  border-radius: var(--radius);
  padding: 24px;
}

.dca-faq h3 {
  border-bottom-color: rgb(16 19 18 / 0.1);
}

.dca-faq-item {
  padding: 16px 0;
  border-bottom: 1px solid rgb(16 19 18 / 0.07);
}

.dca-faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dca-faq-item h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px;
  text-transform: none;
  letter-spacing: 0;
}

.dca-faq-item p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.dca-legend-buy {
  color: var(--green);
  font-weight: 700;
}

.dca-legend-sell {
  color: var(--red);
  font-weight: 700;
}

@media (max-width: 600px) {
  .dca-examples-grid {
    grid-template-columns: 1fr;
  }

  .dca-param-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.risk-note strong {
  color: var(--red);
}

.legacy-calculator {
  display: grid;
  gap: 16px;
}

.legacy-calc-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.legacy-calc-title p {
  max-width: 940px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  font-weight: 750;
  line-height: 1.4;
}

.legacy-calc-top,
.legacy-calc-main {
  display: grid;
  gap: 16px;
}

.legacy-calc-top {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.legacy-calc-main {
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 0.85fr);
  align-items: start;
}

.legacy-calc-left,
.legacy-calc-side {
  display: grid;
  gap: 16px;
}

.legacy-calc-card {
  overflow: hidden;
  border: 1px solid rgb(16 19 18 / 0.12);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.legacy-calc-card .card-header {
  border-bottom: 1px solid rgb(16 19 18 / 0.1);
  padding: 11px 14px;
  background: var(--steel);
}

.legacy-result-card .card-header {
  background: var(--green);
  color: #ffffff;
}

.legacy-calc-card h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  text-align: center;
}

.legacy-calc-card .card-body {
  overflow-x: auto;
}

.legacy-calculator table {
  width: 100%;
  border-collapse: collapse;
}

.legacy-calculator .table-responsive table {
  min-width: 720px;
}

.legacy-calculator td {
  min-height: 50px;
  border-bottom: 1px solid rgb(16 19 18 / 0.08);
  padding: 9px 10px;
  vertical-align: middle;
  font-size: 0.9rem;
}

.legacy-calculator tr:last-child td {
  border-bottom: 0;
}

.legacy-calculator thead td {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.legacy-calculator .text-center {
  text-align: center;
}

.legacy-calculator .form-control,
.legacy-save-row .form-control {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.legacy-calculator .form-control:focus,
.legacy-save-row .form-control:focus {
  border-color: var(--accent-line);
  background: #ffffff;
}

.legacy-calculator .input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.legacy-calculator .input-group .form-control {
  border-radius: 6px 0 0 6px;
}

.legacy-calculator .input-group-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  padding: 0 10px;
  background: #eef3f0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.legacy-calculator .btn,
.legacy-save-row .btn {
  min-height: 40px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-radius: 6px;
  padding: 0 12px;
  font-weight: 800;
}

.legacy-calculator .btn-default {
  background: var(--surface);
  color: var(--accent-dark);
}

.legacy-calculator .btn-secondary {
  background: #e6edf1;
  color: var(--accent-dark);
}

.legacy-calculator .btn-success,
.legacy-save-row .btn-success {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.legacy-calculator .add-row-button {
  width: 100%;
  border-radius: 0;
}

.legacy-calculator .delete {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgb(170 55 48 / 0.3);
  border-radius: 50%;
  background: #f6dfdc;
  color: var(--red);
  font-weight: 900;
}

.legacy-result-card td:last-child,
.legacy-calculator [data-entry-currency],
.legacy-calculator [data-entry-asset],
.legacy-calculator [data-exit-currency],
.legacy-calculator [data-exit-asset] {
  font-weight: 800;
}

#posicion_trade,
#posicion_trade_fiat {
  display: block;
}

.legacy-backup-row {
  display: flex;
  gap: 0.45rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  margin-top: 0.25rem;
}

.legacy-backup-row .btn {
  flex: 1;
  font-size: 0.78rem !important;
  min-height: 34px;
  padding: 0 8px;
}

.legacy-import-feedback {
  font-size: 0.76rem;
  min-height: 1rem;
  margin: 0.25rem 0 0;
  line-height: 1.4;
}

.legacy-import-feedback.is-ok  { color: #2a7a2a; }
.legacy-import-feedback.is-err { color: #d94040; }

.legacy-save-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.legacy-error {
  display: none;
  gap: 4px;
  border: 1px solid rgb(170 55 48 / 0.26);
  border-radius: var(--radius);
  padding: 12px;
  background: #f6dfdc;
  color: var(--red);
}

.legacy-error.is-visible {
  display: grid;
}

.saved-trade-button,
.saved-delete-button {
  min-height: 34px;
  border: 1px solid rgb(16 19 18 / 0.12);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.saved-trade-button {
  margin-right: 6px;
  padding: 0 10px;
}

.saved-delete-button {
  width: 34px;
  color: var(--red);
}

.saved-empty,
.legacy-help {
  color: var(--muted);
  font-size: 0.9rem;
}

.legacy-help {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 12px;
}

.legacy-help p {
  margin-bottom: 1rem;
}

.legacy-tutorial {
  max-width: 820px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: clamp(24px, 4vw, 42px) 0 0;
  background: transparent;
  box-shadow: none;
}

.legacy-tutorial h2 {
  margin-top: 0;
  color: var(--ink);
  font-size: clamp(1.7rem, 3.6vw, 2.55rem);
}

.legacy-tutorial h3 {
  margin-top: 32px;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.3vw, 1.55rem);
}

.legacy-tutorial h4 {
  margin: 20px 0 8px;
  color: var(--ink);
  font-size: 1.05rem;
}

.legacy-tutorial p,
.legacy-tutorial strong {
  color: var(--ink);
}

.legacy-tutorial a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.legacy-tutorial hr {
  height: 1px;
  margin: 30px 0;
  border: 0;
  background: var(--line);
}

.calc-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.calc-form label,
.search-box {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.input-shell {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 48px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-radius: var(--radius);
  background: var(--surface);
}

.input-shell input,
.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.input-shell input {
  padding: 0 12px;
}

.input-shell span {
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.result-grid,
.portfolio-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.result-grid div,
.portfolio-summary div {
  min-height: 96px;
  border: 1px solid rgb(16 19 18 / 0.1);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}

.result-grid strong,
.portfolio-summary strong {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.trade-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.trade-row {
  display: grid;
  grid-template-columns: 1fr 1fr 42px;
  gap: 8px;
  align-items: end;
}

.trade-row label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.trade-row input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-radius: var(--radius);
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
}

.remove-trade {
  width: 42px;
  height: 42px;
  border: 1px solid rgb(170 55 48 / 0.28);
  border-radius: var(--radius);
  background: #f6dfdc;
  color: var(--red);
  font-weight: 900;
}

.search-box {
  min-width: min(100%, 420px);
}

.search-box input {
  min-height: 44px;
  border: 1px solid rgb(16 19 18 / 0.14);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--surface-strong);
}

.site-footer {
  border-top: 1px solid rgb(16 19 18 / 0.1);
  background: rgb(255 255 255 / 0.72);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 42px;
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.footer-brand img {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
  margin-bottom: 14px;
}

.footer-brand p {
  max-width: 360px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.footer-nav div {
  display: grid;
  align-content: start;
  gap: 9px;
}

.footer-nav h2 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.9rem;
}

.footer-nav a,
.footer-nav button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav button:hover {
  color: var(--green);
}

.footer-legal {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  border-top: 1px solid rgb(16 19 18 / 0.08);
  padding: 14px 0 20px;
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .section-grid,
  .tools-grid,
  .legacy-calc-top,
  .legacy-calc-main,
  .dca-form-grid,
  .dca-summary-grid,
  .dca-operation-list,
  .guide-band,
  .article-layout,
  .resource-feature,
  .home-resource-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .lead-form {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 20px;
    padding-left: 0;
  }

  .recommended-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recommended-card.is-featured {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .article-meta {
    position: static;
  }

  .topic-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-card {
    grid-template-columns: minmax(160px, 230px) minmax(0, 1fr);
  }

  .post-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .site-header {
    position: static;
    display: grid;
  }

  main {
    width: min(100% - 20px, var(--max-width));
    padding-top: 18px;
  }

  .hero-copy {
    min-height: 260px;
  }

  .tool-preview-list,
  .recommended-list,
  .topic-list,
  .calc-form,
  .result-grid,
  .portfolio-summary,
  .dca-form-grid,
  .dca-summary-grid,
  .dca-operation-list,
  .home-resource-list,
  .footer-nav {
    grid-template-columns: 1fr;
  }

  .legacy-save-row {
    grid-template-columns: 1fr;
  }

  .legacy-calc-title {
    grid-template-columns: 1fr;
  }

  .latest-post {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
  }

  .post-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .trade-row {
    grid-template-columns: 1fr;
  }

  .remove-trade {
    width: 100%;
  }

}

@media (min-width: 701px) {
  .dca-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 300px));
    justify-content: start;
    align-items: start;
  }
}

/* ─── Portfolio tool ─────────────────────────────────────────────────────── */

.portfolio-tool-panel {
  overflow: visible;
}

/* Toolbar */
.pf-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.pf-currency-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

.pf-currency-label select {
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
}

.pf-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.pf-toolbar-actions button,
.pf-import-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pf-toolbar-actions button:hover,
.pf-import-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

#pfAddTrade {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

#pfAddTrade:hover {
  background: #186043;
  border-color: #186043;
}

#pfReset {
  color: var(--red);
  border-color: rgba(170, 55, 48, 0.35);
}

#pfReset:hover {
  background: rgba(170, 55, 48, 0.07);
}

.pf-import-btn input[type="file"] {
  display: none;
}

/* Price status */
.pf-price-status {
  font-size: 12px;
  padding: 6px 16px;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pf-status--ok    { color: var(--green); }
.pf-status--warning { color: #7a5c00; }
.pf-status--error  { color: var(--red); }
.pf-status--loading { color: var(--muted); font-style: italic; }
.pf-status--info  { color: var(--muted); }

/* Column headers */
.pf-trade-header {
  display: grid;
  grid-template-columns: 100px 160px 100px 120px 1fr 84px 60px;
  gap: 6px;
  padding: 6px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}

/* Trade list */
.pf-trade-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  max-height: 320px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.pf-trade-list::-webkit-scrollbar { width: 5px; }
.pf-trade-list::-webkit-scrollbar-thumb {
  background: rgb(16 19 18 / 0.15);
  border-radius: 4px;
}

.pf-trade-row {
  display: grid;
  grid-template-columns: 100px 160px 100px 120px 1fr 84px 60px;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  padding: 4px 4px;
  border-radius: 4px;
  background: var(--surface-strong);
  border-left: 3px solid var(--green);
  transition: background 0.1s;
}

.pf-trade-row:hover {
  background: var(--accent-soft);
}

/* Inputs */
.pf-input {
  width: 100%;
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.12s;
}

.pf-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-strong);
}

.pf-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pf-input-wrap .pf-input {
  padding-right: 28px;
}

.pf-unit {
  position: absolute;
  right: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
  letter-spacing: 0.02em;
}

.pf-input--label {
  color: var(--muted);
  font-style: italic;
}

.pf-price-paid {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  padding-right: 2px;
}

.pf-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0.55;
  transition: opacity 0.12s, background 0.12s;
  padding: 0;
}

.pf-remove:hover {
  opacity: 1;
  background: rgba(170, 55, 48, 0.1);
}

.pf-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pf-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
  transition: background 0.12s, transform 0.12s;
}

.pf-confirm:hover {
  background: var(--accent-dark);
  transform: scale(1.05);
}

/* Indicador visual de fila pendiente de aceptar */
.pf-trade-row--draft {
  background: #fff8ec;
  border-left: 3px solid var(--accent);
}

.pf-trade-row--draft .pf-confirm {
  animation: pf-pulse-confirm 1.4s ease-in-out infinite;
}

@keyframes pf-pulse-confirm {
  0%, 100% { box-shadow: 0 0 0 0 rgba(127, 163, 111, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(127, 163, 111, 0); }
}

/* Summary */
.pf-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 12px 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.pf-summary > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface-strong);
}

.pf-summary > div span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pf-summary > div strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  display: block;
}

.pf-profit { color: var(--green) !important; }
.pf-loss   { color: var(--red)   !important; }

/* Storage note */
.pf-storage-note {
  margin: 12px 16px 16px;
}

/* Selector de moneda (legacy <select>, mantener por compatibilidad) */
.pf-coin-select {
  font-size: 12px;
  font-weight: 600;
  appearance: auto;
  cursor: pointer;
}

/* Combobox de moneda (input filtrable + dropdown) */
.pf-coin-combo {
  position: relative;
  min-width: 0;
}

.pf-coin-search {
  font-size: 12px;
  font-weight: 600;
  cursor: text;
  width: 100%;
}

.pf-coin-options {
  position: fixed; /* fixed para que no lo recorte el overflow del scroll-container */
  z-index: 1000;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgb(16 19 18 / 0.18);
}

.pf-coin-option {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.4;
  transition: background 0.1s;
}

.pf-coin-option-sym {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.pf-coin-option-name {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-coin-option:hover,
.pf-coin-option--active {
  background: var(--accent-soft);
}

.pf-coin-option--selected .pf-coin-option-sym {
  color: var(--accent-dark);
}

.pf-coin-option--empty {
  cursor: default;
  color: var(--muted);
  font-style: italic;
  grid-template-columns: 1fr;
  padding: 10px 12px;
}

.pf-coin-combo--open .pf-coin-search {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

/* Punto de color por activo */
.pf-coin-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 2px;
}

/* Tabla de resumen */
.pf-summary {
  margin: 12px 0 0;
  overflow-x: auto;
}

.pf-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pf-summary-table th {
  padding: 8px 12px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.pf-summary-table th:first-child { text-align: left; }

.pf-summary-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.pf-summary-table tbody tr:hover td {
  background: var(--accent-soft);
}

.pf-st-coin {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.pf-st-symbol {
  font-weight: 700;
  font-size: 13px;
}

.pf-st-name {
  font-size: 11px;
  color: var(--muted);
}

.pf-st-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pf-st-total td {
  background: var(--steel);
  border-top: 2px solid var(--line);
  border-bottom: none;
}

/* Mobile */
@media (max-width: 700px) {
  .pf-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .pf-toolbar-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .pf-trade-header {
    display: none;
  }

  .pf-trade-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
  }

  .pf-trade-row .pf-input--date   { grid-column: 1 / 3; }
  .pf-trade-row .pf-coin-select   { grid-column: 1 / 3; }
  .pf-trade-row .pf-coin-combo    { grid-column: 1 / 3; }
  .pf-trade-row .pf-input-wrap    { grid-column: span 1; }
  .pf-trade-row .pf-input--label  { grid-column: 1; }
  .pf-trade-row .pf-price-paid    { grid-column: 2; text-align: right; }
  .pf-trade-row .pf-row-actions   { grid-column: 1 / 3; justify-content: center; }
  .pf-trade-row .pf-remove        { width: 100%; height: 28px; }

  .pf-summary-table th:nth-child(n+3),
  .pf-summary-table td:nth-child(n+3) {
    display: none;
  }
}
