/* ─── Shared ─── */

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  background: var(--color-brand-soft);
  color: var(--color-brand);
  padding: .3rem .7rem;
  font-size: var(--step--1);
  font-weight: 800;
  line-height: 1.2;
}

/* ─── Buttons ─── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: .75rem 1.25rem;
  font-weight: 700;
  line-height: 1;
  font-size: .92rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  background: linear-gradient(135deg, var(--color-brand), var(--color-brand-strong));
  color: var(--color-white);
  box-shadow: var(--shadow-button);
}

.button-primary:hover {
  background: var(--color-brand-strong);
  box-shadow: var(--shadow-button-lg);
}

.button-secondary {
  border-color: var(--color-line);
  background: var(--color-white);
  color: var(--color-brand);
}

.button-secondary:hover {
  border-color: var(--color-brand);
  background: var(--color-brand-soft);
}

.button-accent {
  background: var(--color-accent);
  color: var(--color-white);
}

.button-accent:hover {
  background: var(--color-accent-strong);
}

.button-ghost {
  border-color: rgb(255 255 255 / .42);
  color: var(--color-white);
}

.button-ghost:hover {
  background: rgb(255 255 255 / .12);
}

.threshold-link {
  position: relative;
  overflow: hidden;
}

.threshold-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .22), transparent);
  transform: translateX(-120%);
  transition: transform 600ms var(--ease-out);
}

.threshold-link:hover::after {
  transform: translateX(120%);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* ─── Cards ─── */

/* ─── 3D Tilt Card System ─── */

.tilt-3d {
  perspective: var(--tilt-perspective);
}

.tilt-3d-inner {
  transition: transform var(--duration) var(--ease-out);
  transform-style: preserve-3d;
  will-change: transform;
}

.tilt-3d-inner:hover {
  transform: rotateX(calc(var(--tilt-y, 0) * var(--tilt-rotate))) rotateY(calc(var(--tilt-x, 0) * var(--tilt-rotate))) scale(var(--tilt-scale));
}

/* ─── 3D Image Effects ─── */

.img-3d {
  position: relative;
  perspective: var(--perspective-mid);
  overflow: visible;
}

.img-3d img {
  transition: transform var(--duration-slow) var(--ease-emphasized), box-shadow var(--duration-slow) var(--ease-out);
  transform-style: preserve-3d;
  will-change: transform;
}

.img-3d:hover img {
  transform: rotateX(calc(var(--mouse-y, 0) * -1deg)) rotateY(calc(var(--mouse-x, 0) * 1deg)) scale(1.03);
  box-shadow: var(--depth-shadow);
}

.img-3d::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--shimmer-3d);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out);
  pointer-events: none;
}

.img-3d:hover::after {
  opacity: 1;
}

/* ─── Service Card ─── */

.service-card {
  display: grid;
  overflow: hidden;
  min-height: 100%;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-white);
  text-decoration: none;
  perspective: var(--perspective-far);
  transition:
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out),
    border-color var(--duration) var(--ease-out);
}

.service-card:hover {
  transform: translateY(-6px) rotateX(1.5deg);
  border-color: color-mix(in srgb, var(--color-brand) 40%, var(--color-line));
  box-shadow: var(--depth-shadow);
}

.service-card figure {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-surface-strong);
}

.service-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-emphasized);
}

.service-card:hover img {
  transform: scale(1.08);
}

.service-card-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  flex: 1;
}

.service-card-content .tag {
  align-self: flex-start;
}

.service-card-content .button {
  margin-top: auto;
  align-self: flex-start;
  pointer-events: none;
}

.service-card .tag {
  justify-self: start;
}

.service-card h2,
.service-card h3,
.feature-card h2,
.contact-card h2 {
  max-width: 22ch;
  font-size: var(--step-2);
  line-height: 1.08;
  word-break: break-word;
  hyphens: auto;
  overflow-wrap: break-word;
}

.feature-card {
  display: grid;
  gap: var(--space-4);
  min-height: 100%;
  padding: clamp(1.4rem, 2.2vw, 2rem);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-white);
  box-shadow: 0 1px 0 rgb(16 21 36 / .04);
  perspective: var(--perspective-far);
  transition:
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out),
    border-color var(--duration) var(--ease-out);
}

.feature-card:hover {
  transform: translateY(-4px) rotateX(1deg);
  border-color: color-mix(in srgb, var(--color-brand) 30%, var(--color-line));
  box-shadow: var(--depth-shadow);
}

.feature-card-number {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-brand-soft);
  color: var(--color-brand);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 820;
  flex-shrink: 0;
}

.feature-card .button {
  margin-top: auto;
  justify-self: start;
}

/* ─── Metrics ─── */

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / .16);
}

.metric {
  padding: var(--space-5);
  background: rgb(255 255 255 / .08);
  backdrop-filter: blur(4px);
}

.metric strong {
  display: block;
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 800;
  line-height: .95;
}

.metric span {
  display: block;
  margin-top: var(--space-2);
  color: rgb(255 255 255 / .84);
  font-size: var(--step--1);
  font-weight: 700;
  line-height: 1.4;
}

/* ─── Lists ─── */

.feature-list,
.check-list {
  display: grid;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.feature-list li,
.check-list li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--color-ink-soft);
}

.feature-list li::before,
.check-list li::before {
  content: "";
  position: absolute;
  top: .68em;
  left: 0;
  width: .55rem;
  height: .55rem;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 14%, transparent);
}

/* ─── Table ─── */

.info-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-white);
  perspective: var(--perspective-far);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}

.info-table:hover {
  box-shadow: var(--depth-shadow);
  transform: rotateX(.5deg);
}

.info-table th,
.info-table td {
  border-bottom: 1px solid var(--color-line);
  padding: var(--space-5);
  text-align: left;
  vertical-align: top;
}

.info-table th {
  width: 30%;
  background: linear-gradient(135deg, var(--color-brand-soft), #fff);
  color: var(--color-brand);
  font-weight: 850;
  font-size: .95rem;
}

.info-table tr:last-child th,
.info-table tr:last-child td {
  border-bottom: 0;
}

/* ─── Breadcrumb ─── */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  color: var(--color-muted);
  font-size: var(--step--1);
}

.breadcrumb a {
  color: var(--color-brand);
  text-decoration: none;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.breadcrumb a:hover {
  opacity: .7;
}

.page-hero .breadcrumb,
.hero .breadcrumb {
  color: rgb(255 255 255 / .7);
}

.page-hero .breadcrumb a,
.hero .breadcrumb a {
  color: var(--color-white);
}

/* ─── Forms ─── */

.form-grid {
  display: grid;
  gap: var(--space-4);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field label,
.choice-group legend {
  color: var(--color-ink);
  font-weight: 780;
  font-size: .92rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-ink);
  padding: .9rem .95rem;
  font: inherit;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.field textarea {
  min-height: 136px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-soft);
  outline: 0;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--color-muted);
  opacity: .7;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.checkbox-field input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: .22rem;
  accent-color: var(--color-brand);
}

.form-status {
  min-height: 1.5rem;
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: .92rem;
  font-weight: 600;
}

.form-status:empty {
  display: none;
}

.form-status[data-state="error"] {
  background: #fef0ee;
  color: var(--color-danger);
  border: 1px solid color-mix(in srgb, var(--color-danger) 20%, transparent);
}

.form-status[data-state="success"] {
  background: #eaf7f1;
  color: var(--color-success);
  border: 1px solid color-mix(in srgb, var(--color-success) 20%, transparent);
}

/* ─── Footer ─── */

.site-footer {
  background:
    radial-gradient(circle at 15% 10%, rgb(74 164 133 / .18), transparent 22rem),
    var(--color-brand-strong);
  color: var(--color-white);
}

.site-footer a {
  color: inherit;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.site-footer a:hover {
  opacity: .8;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-8);
  padding-block: var(--space-12);
}

.footer-grid p {
  color: rgb(255 255 255 / .78);
  line-height: 1.6;
}

.site-footer li {
  color: rgb(255 255 255 / .78);
}

.footer-grid ul {
  display: grid;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.footer-title {
  margin-bottom: var(--space-3);
  color: var(--color-white);
  font-weight: 850;
}

.footer-title,
.contact-card > h2 {
  font-family: var(--font-display);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  border-top: 1px solid rgb(255 255 255 / .14);
  padding-block: var(--space-5);
  color: rgb(255 255 255 / .7);
  font-size: var(--step--1);
}

/* ─── Catalog ─── */

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
}

.catalog-item {
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-white);
  box-shadow: var(--shadow-card);
  perspective: var(--perspective-far);
  transition:
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out);
}

.catalog-item:hover {
  transform: translateY(-4px) rotateX(1.5deg) scale(1.01);
  box-shadow: var(--depth-shadow);
}

.catalog-item figure {
  aspect-ratio: 5 / 6;
  overflow: hidden;
  background: var(--color-surface-alt);
}

.catalog-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-emphasized);
}

.catalog-item:hover img {
  transform: scale(1.05);
}

.catalog-item figcaption {
  padding: var(--space-4);
  color: var(--color-ink);
  font-weight: 800;
  font-size: .92rem;
}

.catalog-item-body {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-5);
}

.catalog-item-title {
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.3;
}

.catalog-specs {
  display: grid;
  gap: var(--space-1);
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: var(--step--1);
  color: var(--color-muted);
}

.catalog-specs li {
  padding-left: 0;
}

.catalog-specs li::before {
  display: none;
}

.catalog-specs strong {
  color: var(--color-ink-soft);
  font-weight: 600;
}

/* Condiciones comerciales — puertas de acceso */

.commercial-conditions-section {
  position: relative;
}

.commercial-conditions {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-brand) 22%, var(--color-line));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--color-accent) 16%, transparent), transparent 38%),
    linear-gradient(145deg, var(--color-white), color-mix(in srgb, var(--color-surface-alt) 78%, var(--color-white)));
  box-shadow: var(--depth-shadow);
}

.commercial-conditions-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
  border-bottom: 1px solid color-mix(in srgb, var(--color-line) 78%, transparent);
}

.commercial-conditions-header h2 {
  margin: 0;
  color: var(--color-ink);
  font-size: clamp(1.5rem, 3vw, 2.35rem);
}

.commercial-conditions-mark,
.commercial-condition-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--color-brand);
  background: color-mix(in srgb, var(--color-brand) 9%, var(--color-white));
  border: 1px solid color-mix(in srgb, var(--color-brand) 18%, transparent);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--color-brand) 12%, transparent);
}

.commercial-conditions-mark {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 1rem;
}

.commercial-conditions-mark svg {
  width: 2.25rem;
  height: 2.25rem;
}

.commercial-conditions-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
}

.commercial-condition {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-4);
  border-top: 1px solid color-mix(in srgb, var(--color-line) 82%, transparent);
}

.commercial-condition:first-child {
  border-top: 0;
}

.commercial-condition-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
}

.commercial-condition-icon svg {
  width: 1.75rem;
  height: 1.75rem;
}

.commercial-condition h3 {
  margin: 0 0 .25rem;
  color: var(--color-ink);
  font-size: var(--step-0);
}

.commercial-condition p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.55;
}

.commercial-conditions-footer {
  display: flex;
  padding: 0 var(--space-6) var(--space-6);
}

.commercial-conditions-footer .button {
  width: 100%;
}

@media (min-width: 40rem) {
  .commercial-conditions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commercial-condition:nth-child(-n + 2) {
    border-top: 0;
  }

  .commercial-condition:nth-child(even) {
    border-inline-start: 1px solid color-mix(in srgb, var(--color-line) 82%, transparent);
  }

  .commercial-conditions-footer .button {
    width: auto;
  }
}

@media (min-width: 70rem) {
  .commercial-conditions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .commercial-condition {
    border-top: 0;
  }

  .commercial-condition + .commercial-condition {
    border-inline-start: 1px solid color-mix(in srgb, var(--color-line) 82%, transparent);
  }
}

.catalog-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-line);
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.qty-minus,
.qty-plus {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  background: var(--color-surface-alt);
  color: var(--color-ink-soft);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.qty-minus:hover,
.qty-plus:hover {
  background: var(--color-surface-strong);
  color: var(--color-brand);
}

.qty-input {
  width: 40px;
  height: 36px;
  border: 0;
  border-inline: 1px solid var(--color-line);
  text-align: center;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--color-ink);
  background: var(--color-white);
  -moz-appearance: textfield;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.catalog-actions .button {
  flex: 1;
  min-width: 0;
  font-size: var(--step--1);
  padding-block: .45rem;
}

/* ─── Logo Grid ─── */

.logo-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-4);
}

.logo-tile {
  display: grid;
  place-items: center;
  min-height: 118px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgb(255 255 255 / .96), rgb(247 249 253 / .96));
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  perspective: var(--perspective-far);
  transition:
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out);
}

.logo-tile:hover {
  transform: translateY(-3px) rotateX(1deg);
  box-shadow: var(--depth-shadow);
}

.logo-tile img {
  max-height: 68px;
  object-fit: contain;
  filter: grayscale(.3);
  opacity: .8;
  transition:
    filter var(--duration) var(--ease-out),
    opacity var(--duration) var(--ease-out);
}

.logo-tile:hover img {
  filter: grayscale(0);
  opacity: 1;
}

/* ─── Gallery ─── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.gallery-grid figure {
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-surface-strong);
  perspective: var(--perspective-far);
  transition: box-shadow var(--duration) var(--ease-out);
}

.gallery-grid figure:hover {
  box-shadow: var(--depth-shadow);
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / .86;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-emphasized);
}

.gallery-grid figure:hover img {
  transform: scale(1.06) rotateX(1deg);
}

/* ─── Process rail ─── */

.process-rail {
  position: relative;
  display: grid;
  gap: var(--space-5);
}

.process-rail::before {
  content: "";
  position: absolute;
  top: 1.4rem;
  bottom: 1.4rem;
  left: 1.3rem;
  width: 2px;
  background: var(--color-line);
}

.process-step {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
}

.process-step > span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-brand);
  color: var(--color-white);
  font-weight: 850;
}

/* ─── Contact ─── */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: var(--space-8);
  align-items: start;
}

.contact-card {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-white);
  box-shadow: var(--shadow-card);
  perspective: var(--perspective-far);
  transition: transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}

.contact-card:hover {
  transform: translateY(-2px) rotateX(.5deg);
  box-shadow: var(--depth-shadow);
}

.contact-list {
  display: grid;
  gap: var(--space-4);
  padding: 0;
  list-style: none;
}

.contact-list a {
  color: var(--color-brand);
  font-weight: 800;
  text-decoration: none;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.contact-list a:hover {
  opacity: .75;
}

/* ─── Assistant ─── */

/* Floating button */

.assistant-launch {
  position: fixed;
  z-index: 90;
  right: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 48px;
  border: 0;
  border-radius: 24px;
  background: var(--color-brand);
  color: var(--color-white);
  box-shadow: 0 8px 32px rgb(37 53 116 / .32);
  padding: .6rem 1rem .6rem .85rem;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    background 200ms ease;
}

.assistant-launch:hover {
  background: var(--color-brand-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgb(37 53 116 / .4);
}

.assistant-launch:active {
  transform: translateY(0);
}

.assistant-launch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgb(255 255 255 / .15);
  flex-shrink: 0;
}

.assistant-launch-label {
  line-height: 1;
}

.assistant-launch-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  flex-shrink: 0;
  position: relative;
}

.assistant-launch-pulse {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #34c759;
  opacity: 0;
  animation: pulse-inactive 0.01s forwards;
}

@keyframes pulse-active {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(2.5); opacity: 0; }
}

.assistant-launch .assistant-launch-pulse {
  animation: pulse-active 2s ease-out 3;
}

@media (prefers-reduced-motion: reduce) {
  .assistant-launch {
    transition: none;
  }
  .assistant-launch .assistant-launch-pulse {
    animation: none;
    display: none;
  }
}

/* Prompt bubble */

.chat-prompt-bubble {
  position: fixed;
  z-index: 85;
  right: 1rem;
  bottom: 5rem;
  width: min(360px, calc(100vw - 2rem));
  opacity: 0;
  transform: translateY(12px) scale(.97);
  transition:
    opacity 400ms ease,
    transform 400ms ease;
  pointer-events: none;
}

.chat-prompt-bubble--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-prompt-content {
  display: grid;
  gap: .75rem;
  padding: 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  background: var(--color-white);
  box-shadow: 0 16px 48px rgb(16 21 36 / .14);
}

.chat-prompt-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-ink);
  line-height: 1.3;
}

.chat-prompt-desc {
  font-size: .88rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.chat-prompt-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.chat-prompt-actions .button {
  flex: 1;
  min-height: 40px;
  padding: .45rem .85rem;
  font-size: .85rem;
}

.chat-prompt-later {
  flex-shrink: 0;
  border: 1px solid var(--color-line);
  border-radius: 6px;
  background: transparent;
  color: var(--color-muted);
  padding: .45rem .85rem;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    color 150ms ease;
}

.chat-prompt-later:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

@media (prefers-reduced-motion: reduce) {
  .chat-prompt-bubble {
    transition: none;
  }
  .chat-prompt-bubble--visible {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 420px) {
  .chat-prompt-bubble {
    right: .5rem;
    left: .5rem;
    bottom: 4.5rem;
    width: auto;
  }
}

/* Modal */

.assistant-modal {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: end;
  background: rgb(8 13 29 / .55);
  padding: var(--space-4);
  backdrop-filter: blur(4px);
}

.assistant-modal[hidden] {
  display: none;
}

.assistant-panel {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  width: min(100%, 440px);
  max-height: min(680px, calc(100svh - 2rem));
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  background: var(--color-white);
  box-shadow: 0 28px 90px rgb(0 0 0 / .28);
}

/* Chat header */

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-white);
}

.chat-header-info {
  display: grid;
  gap: .15rem;
}

.chat-header-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--color-ink);
  line-height: 1.2;
}

.chat-header-status {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--color-muted);
  font-weight: 500;
}

.chat-header-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34c759;
  flex-shrink: 0;
}

.chat-header-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
  flex-shrink: 0;
}

.chat-header-close:hover {
  background: var(--color-brand-soft);
  border-color: var(--color-brand);
  color: var(--color-brand);
}

/* Progress */

.chat-progress {
  height: 4px;
  background: var(--color-surface-strong);
}

.chat-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-strong));
  transition: width 350ms ease;
}

.chat-progress-label {
  display: flex;
  justify-content: flex-end;
  padding: .25rem .75rem .15rem;
  font-size: .72rem;
  color: var(--color-muted);
  font-weight: 600;
  letter-spacing: .02em;
}

/* Chat body */

.chat-body {
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  scroll-behavior: smooth;
}

/* Messages */

.chat-msg {
  display: flex;
  max-width: 88%;
  animation: msg-enter 350ms ease both;
}

@keyframes msg-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg--entering {
  opacity: 0;
  transform: translateY(8px);
}

.chat-msg--assistant {
  align-self: flex-start;
}

.chat-msg--user {
  align-self: flex-end;
}

.chat-bubble {
  padding: .7rem 1rem;
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-msg--assistant .chat-bubble {
  background: var(--color-surface-alt);
  color: var(--color-ink);
  border-bottom-left-radius: 4px;
}

.chat-msg--user .chat-bubble {
  background: var(--color-brand);
  color: var(--color-white);
  border-bottom-right-radius: 4px;
}

/* Typing indicator */

.chat-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: .7rem 1rem;
  background: var(--color-surface-alt);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.chat-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-muted);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.chat-typing-dot:nth-child(2) { animation-delay: .2s; }
.chat-typing-dot:nth-child(3) { animation-delay: .4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-msg {
    animation: none;
  }
  .chat-typing-dot {
    animation: none;
  }
  .chat-typing {
    opacity: 1;
  }
}

/* Options */

.chat-footer {
  border-top: 1px solid var(--color-line);
  padding: .75rem 1rem;
  max-height: 220px;
  overflow-y: auto;
}

.chat-options {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.chat-options--entering {
  opacity: 0;
  transform: translateY(8px);
}

.chat-option {
  width: 100%;
  border: 1.5px solid var(--color-line);
  border-radius: 10px;
  background: var(--color-white);
  color: var(--color-ink);
  padding: .7rem 1rem;
  text-align: left;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
  min-height: 44px;
}

.chat-option:hover {
  border-color: var(--color-brand);
  background: rgb(37 53 116 / .04);
  color: var(--color-brand);
}

.chat-option:focus-visible {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-soft);
  outline: 0;
}

.chat-option:active {
  background: var(--color-brand-soft);
}

/* Summary */

.chat-summary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: .5rem 0;
}

.chat-summary-title {
  font-size: .9rem;
  color: var(--color-ink);
  line-height: 1.5;
  font-weight: 500;
}

.chat-summary-list {
  display: grid;
  gap: .35rem;
  margin: 0;
}

.chat-summary-list dt {
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-brand);
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-top: .5rem;
}

.chat-summary-list dt:first-child {
  margin-top: 0;
}

.chat-summary-list dd {
  margin: .1rem 0 0;
  font-size: .9rem;
  color: var(--color-ink);
  cursor: pointer;
  padding: .25rem .4rem;
  border-radius: 4px;
  transition: background 150ms ease;
}

.chat-summary-list dd:hover {
  background: var(--color-brand-soft);
}

.chat-summary-hint {
  font-size: .8rem;
  color: var(--color-muted);
  font-style: italic;
}

.chat-summary-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .5rem;
}

.chat-summary-actions .button {
  width: 100%;
  min-height: 46px;
  font-size: .9rem;
}

.chat-summary-notice {
  font-size: .75rem;
  color: var(--color-muted);
  line-height: 1.4;
  padding: .6rem;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-surface-alt);
}

/* Copy feedback */

.chat-copy-feedback {
  position: sticky;
  bottom: .5rem;
  align-self: center;
  padding: .4rem 1rem;
  border-radius: 20px;
  background: var(--color-brand);
  color: var(--color-white);
  font-size: .82rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgb(37 53 116 / .25);
  animation: feedback-in 250ms ease both;
  pointer-events: none;
}

@keyframes feedback-in {
  from { opacity: 0; transform: translateY(8px) scale(.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Footer nav */

.chat-nav {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  border-top: 1px solid var(--color-line);
  padding: .5rem .75rem;
}

.chat-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-muted);
  padding: .35rem .6rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.chat-nav-btn:hover:not(:disabled) {
  background: var(--color-brand-soft);
  color: var(--color-brand);
}

.chat-nav-btn:disabled {
  opacity: .35;
  cursor: default;
}

.chat-nav-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--color-brand-soft);
  outline: 0;
}

/* ─── Legacy .floating-mobile-cta (preserved for compatibility) ─── */

.floating-mobile-cta {
  position: fixed;
  z-index: 80;
  right: 1rem;
  bottom: 1rem;
  display: none;
  box-shadow: var(--shadow-elevated);
}

@media (max-width: 720px) {
  .floating-mobile-cta {
    display: inline-flex;
  }
  .assistant-launch {
    bottom: 1rem;
    right: 1rem;
    padding: .5rem .75rem .5rem .6rem;
    gap: .4rem;
    font-size: .82rem;
    min-height: 44px;
  }
  .assistant-launch-icon {
    width: 28px;
    height: 28px;
  }
  .assistant-modal {
    padding: 0;
    align-items: end;
  }
  .assistant-panel {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px));
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }
  .chat-body {
    padding: .75rem 1rem;
  }
  .chat-footer {
    padding: .5rem .75rem;
    max-height: 180px;
  }
  .chat-option {
    padding: .6rem .85rem;
    font-size: .85rem;
    min-height: 42px;
  }
}

@media (max-width: 420px) {
  .assistant-panel {
    max-height: 100dvh;
    border-radius: 0;
  }
  .chat-header {
    padding: .75rem 1rem;
  }
  .chat-body {
    padding: .5rem .75rem;
  }
  .chat-footer {
    padding: .5rem .5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-progress span {
    transition: none;
  }
  .chat-summary-actions .button {
    transition: none;
  }
  .chat-copy-feedback {
    animation: none;
  }
}
