:root {
  --ink: #142019;
  --muted: #6f7a72;
  --line: rgba(20, 32, 25, 0.11);
  --green: #174a31;
  --green2: #2d7b4d;
  --soft: #eef6f0;
  --white: #fff;
  --shadow: 0 20px 60px rgba(27, 60, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 5% 10%,
      rgba(183, 225, 193, 0.38),
      transparent 28%
    ),
    radial-gradient(
      circle at 96% 28%,
      rgba(210, 235, 205, 0.34),
      transparent 26%
    ),
    #f7faf7;
}

button,
textarea {
  font: inherit;
}

.advisor-app {
  min-height: 100vh;
  padding-bottom: 154px;
}

.advisor-header {
  height: 104px;
  padding: 18px 34px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid transparent;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 250, 247, 0.82);
  backdrop-filter: blur(18px);
}

.advisor-back {
  font-size: 13px;
  font-weight: 750;
  color: var(--ink);
  text-decoration: none;
}

.advisor-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-self: center;
}

.advisor-logo {
  width: 150px;
  height: 68px;
  object-fit: contain;
}

.advisor-brand > div {
  display: flex;
  flex-direction: column;
}

.advisor-brand strong {
  font-size: 15px;
}

.advisor-brand span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.advisor-header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
}

.advisor-online {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.advisor-online i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38b66b;
  box-shadow: 0 0 0 5px rgba(56, 182, 107, 0.12);
}

.advisor-new {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.advisor-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.advisor-welcome {
  text-align: center;
  max-width: 880px;
  margin: 74px auto 24px;
  transition: 0.35s ease;
}

.advisor-kicker {
  font-size: 12px;
  letter-spacing: 0.09em;
  color: #27613e;
  font-weight: 850;
  margin: 0 0 16px;
}

.advisor-welcome h1 {
  font-size: clamp(38px, 4.8vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin: 0;
}

.advisor-subtitle {
  max-width: 670px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.advisor-suggestions {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.advisor-suggestions button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 10px 15px;
  color: #39443d;
  cursor: pointer;
}

.advisor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  align-items: start;
}

.advisor-chat-column {
  min-height: 280px;
}

.advisor-thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.advisor-message {
  max-width: 850px;
  border-radius: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 35px rgba(29, 57, 39, 0.06);
}

.advisor-message--user {
  align-self: flex-end;
  background: #163d2a;
  color: #fff;
  border-color: #163d2a;
  max-width: 720px;
}

.advisor-message--assistant {
  align-self: stretch;
  background: rgba(255, 255, 255, 0.93);
}

.advisor-message--error {
  align-self: stretch;
  background: #fff0ef;
  color: #8d2828;
}

.advisor-message__label {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.67;
  margin-bottom: 9px;
}

.advisor-message__content {
  font-size: 15px;
  line-height: 1.68;
}

.advisor-message__content p {
  margin: 8px 0;
}

.advisor-message__content h2,
.advisor-message__content h3,
.advisor-message__content h4 {
  letter-spacing: -0.02em;
  margin: 22px 0 8px;
}

.advisor-message__content h2 {
  font-size: 22px;
}

.advisor-message__content h3 {
  font-size: 18px;
}

.advisor-message__content h4 {
  font-size: 16px;
}

.advisor-message__content ul,
.advisor-message__content ol {
  margin: 8px 0 12px;
  padding-left: 22px;
}

.advisor-message__content li {
  margin: 5px 0;
}

.advisor-message__content strong {
  font-weight: 850;
}

.advisor-message__content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(23, 74, 49, 0.08);
  font-size: 0.92em;
}

.advisor-message__images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.advisor-message__images img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 13px;
}

.advisor-analysis {
  background: #eef6f0;
  border: 1px solid rgba(42, 112, 70, 0.14);
  border-radius: 20px;
  padding: 18px;
  margin-top: 16px;
  color: #244b33;
}

.advisor-analysis-title {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.advisor-analysis ul {
  margin: 13px 0 0 27px;
  padding: 0;
  color: #557060;
  font-size: 13px;
  line-height: 1.7;
}

.advisor-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(42, 112, 70, 0.2);
  border-top-color: #2d7b4d;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.advisor-dossier {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 122px;
}

.advisor-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 17px;
  box-shadow: 0 12px 40px rgba(29, 57, 39, 0.07);
}

.advisor-card h2 {
  font-size: 14px;
  margin: 0 0 13px;
}

.advisor-card-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 850;
  color: #66806d;
}

.advisor-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
}

.advisor-status-row small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 4px;
}

.advisor-status-row strong {
  font-size: 14px;
}

.advisor-light {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(0, 0, 0, 0.04);
}

.advisor-light--red {
  background: #da5b51;
}

.advisor-light--amber {
  background: #e4a92f;
}

.advisor-light--green {
  background: #38ae67;
}

.advisor-confidence > div:first-child {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.advisor-confidence strong {
  color: var(--ink);
}

.advisor-progress {
  height: 7px;
  background: #e9efea;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 9px;
}

.advisor-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2b7048, #54b775);
  border-radius: 999px;
  transition: 0.35s;
}

.advisor-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.advisor-checklist li {
  font-size: 12px;
  color: #89918c;
  display: flex;
  align-items: center;
  gap: 8px;
}

.advisor-checklist span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #edf0ed;
  color: transparent;
  font-size: 11px;
}

.advisor-checklist li.is-done {
  color: #274331;
  font-weight: 700;
}

.advisor-checklist li.is-done span {
  background: #dff1e4;
  color: #2d7b4d;
}

.advisor-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.advisor-quick-grid button {
  border: 1px solid var(--line);
  background: #f9fbf9;
  border-radius: 12px;
  padding: 10px 7px;
  font-size: 11px;
  cursor: pointer;
}

.advisor-composer-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 12px 20px 14px;
  background: linear-gradient(
    180deg,
    rgba(247, 250, 247, 0),
    rgba(247, 250, 247, 0.94) 26%,
    #f7faf7 100%
  );
}

.advisor-composer {
  width: min(900px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 10px;
  box-shadow: var(--shadow);
}

.advisor-composer textarea {
  border: 0;
  outline: 0;
  resize: none;
  min-height: 44px;
  max-height: 160px;
  padding: 11px 4px;
  line-height: 1.45;
  color: var(--ink);
  background: transparent;
}

.advisor-icon-btn,
.advisor-send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
}

.advisor-icon-btn {
  background: #edf3ee;
  color: #224b33;
  font-size: 22px;
}

.advisor-send {
  background: #163d2a;
  color: #fff;
  font-size: 21px;
}

.advisor-icon-btn:disabled,
.advisor-send:disabled {
  opacity: 0.5;
  cursor: wait;
}

.advisor-note {
  text-align: center;
  color: #7c867f;
  font-size: 10px;
  margin: 7px 0 0;
}

.advisor-previews {
  width: min(900px, 100%);
  margin: 0 auto 8px;
  display: flex;
  gap: 8px;
}

.advisor-preview {
  position: relative;
}

.advisor-preview img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.advisor-preview button {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #17231b;
  color: #fff;
  cursor: pointer;
}

.advisor-footer {
  width: min(1240px, calc(100% - 40px));
  margin: 30px auto 0;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #6f7a72;
  font-size: 11px;
}

.advisor-footer a {
  color: var(--ink);
  text-decoration: none;
  margin-left: 14px;
}

.advisor-legal {
  margin-top: 26px;
  color: #666;
}

.advisor-legal hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 15px;
}

.advisor-legal p {
  margin: 7px 0;
}

.advisor-legal a {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.advisor-legal a:hover {
  text-decoration: underline;
}

.advisor-app.is-active .advisor-welcome {
  display: none;
}

.advisor-app:not(.is-active) .advisor-workspace {
  display: none;
}

.advisor-app:not(.is-active) .advisor-dossier {
  display: none;
}

.advisor-app:not(.is-active) .advisor-composer-wrap {
  bottom: 82px;
}

.advisor-app.is-active .advisor-header {
  height: 86px;
  border-bottom-color: var(--line);
}

.advisor-app.is-active .advisor-logo {
  width: 118px;
  height: 52px;
}

.advisor-app.is-active .advisor-shell {
  padding-top: 24px;
}

/* Productos recomendados — compatible con advisor.js v4 */

.advisor-products {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.advisor-products__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.advisor-products__header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.advisor-products__header p {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 800;
}

.advisor-products__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.advisor-product {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 190px;
  overflow: hidden;
  border: 1px solid rgba(23, 74, 49, 0.12);
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #f7fbf8);
  box-shadow: 0 10px 26px rgba(29, 57, 39, 0.07);
}

.advisor-product--primary {
  grid-column: 1 / -1;
  grid-template-columns: 180px minmax(0, 1fr);
  border: 2px solid rgba(45, 123, 77, 0.35);
  background: linear-gradient(135deg, #f1faf3, #fff);
  box-shadow: 0 18px 45px rgba(32, 105, 63, 0.14);
}

.advisor-product__image {
  display: grid;
  place-items: center;
  background: #eef6f0;
  min-height: 100%;
  overflow: hidden;
}

.advisor-product__image img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: contain;
  padding: 12px;
  transition: transform 0.25s ease;
}

.advisor-product__image:hover img {
  transform: scale(1.03);
}

.advisor-product__body {
  padding: 15px 15px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.advisor-product__badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #dff1e4;
  color: #21643c;
  padding: 5px 9px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.advisor-product--primary .advisor-product__badge::before {
  content: "★";
  margin-right: 5px;
}

.advisor-product h4 {
  margin: 10px 0 5px;
  font-size: 19px;
  line-height: 1.08;
  color: #163d2a;
}

.advisor-product--primary h4 {
  font-size: 25px;
}

.advisor-product__role,
.advisor-product__reason {
  font-size: 12px;
  line-height: 1.45;
  margin: 4px 0;
  color: #4e6155;
}

.advisor-product__reason {
  color: #68766d;
}

.advisor-product__meta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 8px;
  padding-top: 9px;
  border-top: 1px solid rgba(23, 74, 49, 0.1);
}

.advisor-product__meta strong {
  font-size: 17px;
  color: #174a31;
}

.advisor-product__meta span {
  font-size: 10px;
  font-weight: 800;
  color: #43835b;
  text-align: right;
}

.advisor-product__button {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  background: #174a31;
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 850;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.advisor-product__button:hover {
  background: #0f3824;
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 960px) {
  .advisor-header {
    grid-template-columns: 1fr auto;
  }

  .advisor-brand {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .advisor-back {
    grid-row: 2;
  }

  .advisor-header-actions {
    grid-row: 2;
  }

  .advisor-workspace {
    grid-template-columns: 1fr;
  }

  .advisor-dossier {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    order: -1;
  }

  .advisor-app.is-active .advisor-header {
    height: auto;
  }

  .advisor-app.is-active .advisor-dossier {
    display: grid;
  }

  .advisor-footer {
    display: none;
  }
}

@media (max-width: 720px) {
  .advisor-products__grid {
    grid-template-columns: 1fr;
  }

  .advisor-product,
  .advisor-product--primary {
    grid-column: auto;
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .advisor-product--primary h4 {
    font-size: 21px;
  }

  .advisor-product__image img {
    min-height: 180px;
    padding: 9px;
  }

  .advisor-products__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

@media (max-width: 680px) {
  .advisor-app {
    padding-bottom: 138px;
  }

  .advisor-header {
    padding: 12px 16px;
    height: auto;
  }

  .advisor-logo {
    width: 130px;
    height: 56px;
  }

  .advisor-brand > div {
    display: none;
  }

  .advisor-online {
    display: none;
  }

  .advisor-shell {
    width: min(100% - 24px, 1240px);
  }

  .advisor-welcome {
    margin-top: 42px;
  }

  .advisor-welcome h1 {
    font-size: 38px;
  }

  .advisor-subtitle {
    font-size: 15px;
  }

  .advisor-dossier {
    grid-template-columns: 1fr;
  }

  .advisor-dossier .advisor-card:nth-child(n + 2) {
    display: none;
  }

  .advisor-message {
    padding: 15px;
    border-radius: 18px;
  }

  .advisor-message__images img {
    height: 100px;
  }

  .advisor-composer-wrap {
    padding-left: 10px;
    padding-right: 10px;
  }

  .advisor-composer {
    border-radius: 18px;
  }

  .advisor-app:not(.is-active) .advisor-composer-wrap {
    bottom: 28px;
  }

  .advisor-footer {
    display: none;
  }
}
