:root {
  --bg: #140d0b;
  --bg-soft: #251512;
  --card: rgba(255, 245, 232, 0.09);
  --card-strong: rgba(255, 245, 232, 0.14);
  --stroke: rgba(255, 229, 202, 0.16);
  --text: #fff7f0;
  --muted: #d0bbb0;
  --accent: #ff7b44;
  --accent-soft: #f4b180;
  --gold: #ecd3a1;
  --ok: #91d8b0;
  --warn: #ffd17d;
  --danger: #ff9d8a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-width: 1320px;
}

.ui-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 123, 68, 0.26), transparent 30%),
    radial-gradient(circle at top right, rgba(236, 211, 161, 0.18), transparent 25%),
    linear-gradient(180deg, #1b110e 0%, #100907 55%, #090504 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 -18vh 0;
  height: 40vh;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 123, 68, 0.08), transparent 60%);
  filter: blur(28px);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 90%);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 20px 0 48px;
}

main {
  display: grid;
  gap: 20px;
}

.hero {
  position: relative;
  padding: 12px 0 28px;
}

.hero-ambient {
  position: absolute;
  z-index: 0;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.7;
  pointer-events: none;
}

.hero-ambient-left {
  top: 36px;
  left: -48px;
  background: radial-gradient(circle, rgba(255, 123, 68, 0.25), transparent 70%);
}

.hero-ambient-right {
  top: 84px;
  right: -36px;
  background: radial-gradient(circle, rgba(236, 211, 161, 0.2), transparent 68%);
}

.topbar,
.panel-head,
.toolbar,
.table-toolbar,
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 10;
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(17, 10, 8, 0.52);
  border: 1px solid rgba(255, 229, 202, 0.08);
  backdrop-filter: blur(16px);
}

.brand-logo {
  width: 118px;
  height: 72px;
  object-fit: contain;
  padding: 0;
  background: transparent;
  border: 0;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.22));
}

.hero-grid,
.import-grid {
  display: grid;
  gap: 20px;
}

.top-recommendation-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.full-layout-stack {
  display: grid;
  gap: 20px;
}

.recommendation-results {
  display: grid;
  gap: 20px;
}

.recommendation-results.is-hidden {
  display: none;
}

.builder-card-full {
  width: 100%;
}

.hero-grid.hero-grid-full {
  grid-template-columns: 1fr;
}

.products-marquee {
  margin-top: 20px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 245, 232, 0.15), rgba(255, 245, 232, 0.05)),
    radial-gradient(circle at 12% 0%, rgba(255, 123, 68, 0.2), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(236, 211, 161, 0.12), transparent 24%);
}

.products-marquee::before {
  content: "";
  position: absolute;
  inset: -16% -6% auto;
  height: 240px;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 123, 68, 0.24), transparent 20%),
    radial-gradient(circle at 82% 8%, rgba(236, 211, 161, 0.12), transparent 22%);
  filter: blur(30px);
  opacity: 0.9;
  z-index: 0;
}

.products-showcase-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.products-showcase-copy {
  max-width: 640px;
}

.products-showcase-copy h3 {
  margin: 6px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.products-showcase-description {
  margin: 14px 0 0;
  max-width: 50ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.58;
}

.products-showcase-toolbar {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.products-showcase-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.products-showcase-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.showcase-nav-button {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 232, 208, 0.14);
  border-radius: 50%;
  background: rgba(255, 246, 236, 0.07);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.showcase-nav-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 232, 208, 0.28);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.showcase-nav-button:focus-visible {
  outline: none;
  border-color: rgba(244, 177, 128, 0.5);
  box-shadow: 0 0 0 3px rgba(244, 177, 128, 0.16), 0 12px 28px rgba(0, 0, 0, 0.2);
}

.showcase-nav-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.showcase-nav-icon {
  width: 18px;
  height: 18px;
}

.showcase-nav-icon-prev {
  transform: rotate(180deg);
}

.products-showcase-position {
  min-width: 82px;
  text-align: center;
  color: rgba(255, 247, 240, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.products-showcase-frame {
  position: relative;
  z-index: 1;
  margin-top: 26px;
}

.products-showcase-frame::before,
.products-showcase-frame::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 18px;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.products-showcase-frame::before {
  left: 0;
  background: linear-gradient(90deg, rgba(20, 13, 11, 0.96), rgba(20, 13, 11, 0));
}

.products-showcase-frame::after {
  right: 0;
  background: linear-gradient(270deg, rgba(20, 13, 11, 0.96), rgba(20, 13, 11, 0));
}

.device-showcase-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 8px 6px 18px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 6px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.device-showcase-rail::-webkit-scrollbar {
  display: none;
}

.device-showcase-detail {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(255, 229, 208, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 248, 240, 0.08), rgba(255, 248, 240, 0.04)),
    radial-gradient(circle at 78% 12%, rgba(255, 123, 68, 0.14), transparent 28%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.import-grid {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: start;
}

.hero-grid {
  position: relative;
  z-index: 1;
  margin-top: 18px;
}

.glass-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--card-strong), var(--card));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.glass-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 30%, transparent 70%, rgba(255, 255, 255, 0.04));
}

.device-spotlight,
.panel-card,
.recommendation-card {
  padding: 28px;
}

.hero-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 40px 44px;
  gap: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 123, 68, 0.14), transparent 65%),
    linear-gradient(180deg, rgba(255, 244, 232, 0.13), rgba(255, 244, 232, 0.06));
}

.hero-cover-top {
  margin-bottom: 22px;
}

.hero-headline {
  text-align: center;
  margin: 0;
  font-size: clamp(3.4rem, 7vw, 6.4rem);
  line-height: 1;
  letter-spacing: -0.01em;
  background: linear-gradient(160deg, #fff8f0 30%, rgba(244, 177, 128, 0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  max-width: 16ch;
}

.hero-descriptor {
  margin: 22px 0 0;
  max-width: 52ch;
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  margin-top: 36px;
}

.hero-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 229, 208, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 248, 240, 0.07), rgba(255, 248, 240, 0.03)),
    radial-gradient(circle at 50% 0%, rgba(255, 123, 68, 0.1), transparent 55%);
  text-align: center;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.hero-pillar:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 229, 208, 0.22);
  box-shadow: 0 8px 28px rgba(255, 123, 68, 0.12);
}

.hero-pillar-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  color: var(--gold);
  opacity: 0.9;
}

.hero-pillar strong {
  display: block;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.hero-pillar span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}

.hero-cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
}

.primary-button-lg {
  padding: 16px 32px;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.hero-cta-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.7;
  letter-spacing: 0.03em;
}

.hero-spec-ribbon {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 229, 208, 0.1);
  width: 100%;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.hero-spec-ribbon em {
  font-style: normal;
  color: var(--text);
  font-weight: 600;
}

.ribbon-divider {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: rgba(255, 229, 208, 0.2);
  align-self: center;
}

@media (max-width: 800px) {
  .ribbon-divider { display: none; }
  .hero-spec-ribbon { gap: 8px 16px; }
}

.builder-card,
.protocol-sheet,
.evidence-card,
.compact-import {
  background:
    linear-gradient(180deg, rgba(255, 245, 232, 0.12), rgba(255, 245, 232, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.eyebrow,
.section-kicker,
.status-pill,
.hint-box p {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.eyebrow,
.section-kicker,
.hint-box p {
  color: var(--gold);
  margin: 0 0 8px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  line-height: 0.95;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4rem);
}

h2 {
  margin-top: 18px;
  font-size: clamp(2.6rem, 5vw, 5rem);
  max-width: 12ch;
}

h3 {
  font-size: clamp(1.8rem, 2.4vw, 2.5rem);
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-headline {
  margin-top: 0 !important;
  max-width: 100% !important;
}

.trust-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.trust-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.07);
  border: 1px solid rgba(255, 229, 208, 0.1);
  color: var(--text);
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.trust-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 229, 208, 0.22);
  background: rgba(255, 248, 240, 0.1);
}

.summary-card,
.alternative-card,
.evidence-item,
.hint-box,
.upload-zone,
.feedback,
.empty-panel {
  border: 1px solid rgba(255, 240, 220, 0.1);
  background: rgba(255, 248, 240, 0.04);
  border-radius: var(--radius-lg);
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  background:
    linear-gradient(180deg, rgba(255, 248, 240, 0.08), rgba(255, 248, 240, 0.04)),
    radial-gradient(circle at top left, rgba(255, 123, 68, 0.08), transparent 40%);
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -30% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 211, 161, 0.16), transparent 68%);
  pointer-events: none;
}

.metric-card dt {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.metric-card dd {
  margin-top: 14px;
  font-size: 1.06rem;
  line-height: 1.45;
  max-width: 24ch;
}

dt {
  color: var(--muted);
  font-size: 0.84rem;
}

dd {
  margin: 8px 0 0;
  color: var(--text);
  font-weight: 700;
}

.primary-button,
.secondary-button,
.ghost-button,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.primary-button {
  color: #1c100d;
  background: linear-gradient(135deg, var(--gold), #fff0d6 45%, var(--accent-soft));
  box-shadow: 0 12px 34px rgba(244, 177, 128, 0.24);
}

.secondary-button,
.ghost-button,
.secondary-link {
  color: var(--text);
  background: rgba(255, 246, 236, 0.08);
  border: 1px solid rgba(255, 232, 208, 0.16);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.secondary-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.secondary-link:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

.chip-button {
  cursor: pointer;
  font: inherit;
}

.protocol-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button-icon,
.chip-icon,
.inline-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.chip-icon {
  width: 15px;
  height: 15px;
  color: var(--accent-soft);
}

.inline-icon {
  width: 15px;
  height: 15px;
  margin-right: 8px;
  vertical-align: -2px;
  color: var(--accent-soft);
}

.status-pill.accent {
  color: #28140f;
  background: linear-gradient(135deg, var(--accent-soft), var(--gold));
}

.device-cards,
.results-grid,
.summary-panel {
  display: grid;
  gap: 14px;
}

.device-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.device-card {
  position: relative;
  flex: 0 0 clamp(260px, 28vw, 332px);
  min-width: 0;
  scroll-snap-align: center;
  scroll-margin-inline: 6px;
}

.device-card-button {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.device-card-frame {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 100%;
  padding: 18px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 229, 208, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 248, 240, 0.1), rgba(255, 248, 240, 0.04)),
    radial-gradient(circle at top, rgba(255, 123, 68, 0.08), transparent 48%);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background 220ms ease, opacity 220ms ease;
}

.device-card-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top, rgba(255, 123, 68, 0.16), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 35%, transparent 70%, rgba(255, 255, 255, 0.03));
  opacity: 0.85;
}

.device-card:hover .device-card-frame {
  transform: translateY(-4px);
  border-color: rgba(255, 229, 208, 0.18);
  box-shadow: 0 26px 44px rgba(0, 0, 0, 0.22);
}

.device-card.is-active .device-card-frame {
  transform: translateY(-6px);
  border-color: rgba(244, 177, 128, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 248, 240, 0.13), rgba(255, 248, 240, 0.05)),
    radial-gradient(circle at top, rgba(255, 123, 68, 0.14), transparent 52%);
  box-shadow: 0 28px 48px rgba(0, 0, 0, 0.26);
}

.device-card:not(.is-active) .device-card-frame {
  opacity: 0.92;
}

.device-card-button:focus-visible {
  outline: none;
}

.device-card-button:focus-visible .device-card-frame {
  border-color: rgba(244, 177, 128, 0.5);
  box-shadow: 0 0 0 3px rgba(244, 177, 128, 0.16), 0 24px 44px rgba(0, 0, 0, 0.22);
}

.device-card-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 16px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 229, 208, 0.08);
  background:
    radial-gradient(circle at top, rgba(255, 123, 68, 0.18), transparent 44%),
    linear-gradient(180deg, rgba(17, 10, 8, 0.32), rgba(255, 248, 240, 0.06));
}

.device-card-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.device-image {
  margin: 0;
  width: 100%;
  height: 148px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.24));
}

.device-name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.device-name {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
}

.device-segment-chip,
.device-detail-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  backdrop-filter: blur(10px);
}

.device-segment-chip {
  gap: 6px;
}

.device-segment-chip .chip-icon {
  width: 12px;
  height: 12px;
  margin: 0;
}

.segment-beauty {
  color: #ffe9dd;
  background: linear-gradient(135deg, rgba(213, 79, 62, 0.28), rgba(166, 44, 32, 0.2));
  border-color: rgba(255, 135, 112, 0.48);
}

.segment-wellness {
  color: #dbf8ff;
  background: linear-gradient(135deg, rgba(34, 137, 158, 0.28), rgba(21, 96, 124, 0.2));
  border-color: rgba(100, 221, 247, 0.4);
}

.device-spec {
  margin: 0;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  color: var(--muted);
}

.device-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.device-stat {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(255, 248, 240, 0.05);
  border: 1px solid rgba(255, 229, 208, 0.08);
}

.device-stat-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 247, 240, 0.55);
}

.device-leds,
.device-irradiance {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: normal;
  color: var(--text);
}

.device-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.device-card-cta {
  color: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.device-card-index,
.device-detail-index {
  color: rgba(255, 247, 240, 0.52);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.device-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: center;
}

.device-detail-copy {
  display: grid;
  gap: 12px;
}

.device-detail-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.device-detail-title {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.device-detail-summary {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.device-detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.device-detail-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 18px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 229, 208, 0.08);
  background:
    radial-gradient(circle at top, rgba(255, 123, 68, 0.18), transparent 44%),
    linear-gradient(180deg, rgba(255, 248, 240, 0.1), rgba(255, 248, 240, 0.04));
}

.device-detail-visual::before {
  content: "";
  position: absolute;
  inset: auto 10% -18% 10%;
  height: 120px;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 123, 68, 0.24), transparent 60%);
  filter: blur(28px);
}

.device-detail-image {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 176px;
  object-fit: contain;
  filter: drop-shadow(0 24px 28px rgba(0, 0, 0, 0.24));
}

.device-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.device-detail-metric {
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 248, 240, 0.05);
  border: 1px solid rgba(255, 229, 208, 0.08);
}

.device-detail-label {
  color: rgba(255, 247, 240, 0.58);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.device-detail-value {
  font-size: 0.98rem;
  line-height: 1.2;
}

.device-detail-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.device-detail-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 12px;
  margin-top: 14px;
}

.device-spectrum-panel,
.device-position-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 248, 240, 0.05);
  border: 1px solid rgba(255, 229, 208, 0.08);
}

.device-wavelength-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wl-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 33px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.67rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.wl-red {
  color: #ffd7d2;
  background: rgba(232, 79, 58, 0.2);
  border-color: rgba(255, 125, 108, 0.34);
}

.wl-nir {
  color: #ffe0dc;
  background: rgba(201, 34, 22, 0.32);
  border-color: rgba(255, 93, 78, 0.52);
}

.wl-ir {
  color: #ffdce4;
  background: rgba(108, 10, 34, 0.35);
  border-color: rgba(164, 38, 76, 0.52);
}

.wl-415 {
  color: #dbefff;
  background: rgba(33, 111, 255, 0.3);
  border-color: rgba(95, 159, 255, 0.52);
}

.wl-other {
  color: #ffeec8;
  background: rgba(220, 184, 107, 0.22);
  border-color: rgba(244, 212, 150, 0.34);
}

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

.form-grid-cover {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.8fr);
  align-items: stretch;
}

.field-main {
  min-height: 100%;
}

.field-main select {
  min-height: 56px;
}

.stacked-note-soft {
  display: grid;
  align-content: center;
  background:
    linear-gradient(180deg, rgba(255, 248, 240, 0.08), rgba(255, 248, 240, 0.04)),
    radial-gradient(circle at top right, rgba(255, 123, 68, 0.1), transparent 45%);
}

.field {
  display: grid;
  gap: 10px;
}

.field span {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 600;
}

.field input,
.field select,
.table-toolbar input {
  width: 100%;
  padding: 14px 16px;
  color: var(--text);
  background: rgba(255, 247, 239, 0.05);
  border: 1px solid rgba(255, 229, 208, 0.12);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.field select:hover,
.field input:hover,
.table-toolbar input:hover {
  border-color: rgba(255, 229, 208, 0.22);
}

.field select:focus,
.field input:focus,
.table-toolbar input:focus {
  border-color: rgba(244, 177, 128, 0.54);
  background: rgba(255, 247, 239, 0.08);
  box-shadow: 0 0 0 4px rgba(244, 177, 128, 0.08);
}

.field input::placeholder,
.table-toolbar input::placeholder {
  color: #a98f83;
}

.stack-block {
  margin-top: 16px;
}

.stacked-note {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 247, 239, 0.04);
  border: 1px solid rgba(255, 229, 208, 0.1);
}

.stacked-note p {
  margin: 0;
}

.upload-zone {
  display: grid;
  gap: 10px;
  padding: 24px;
  cursor: pointer;
  text-align: center;
}

.upload-zone input {
  display: none;
}

.hint-box,
.feedback,
.summary-card,
.alternative-card,
.evidence-item,
.empty-panel,
.stacked-note {
  padding: 18px;
}

.hint-box code {
  display: block;
  color: var(--accent-soft);
  white-space: normal;
  line-height: 1.7;
}

.feedback {
  margin-top: 16px;
  min-height: 56px;
  color: var(--muted);
}

.feedback.success {
  border-color: rgba(145, 216, 176, 0.24);
  color: var(--ok);
}

.feedback.error {
  border-color: rgba(255, 157, 138, 0.24);
  color: var(--danger);
}

.summary-panel {
  margin: 18px 0 22px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.summary-card strong,
.alternative-card strong,
.evidence-item strong {
  display: block;
  color: var(--text);
}

.summary-card,
.spec-card,
.alternative-card,
.evidence-item {
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.summary-card::before,
.spec-card::before,
.alternative-card::before,
.evidence-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 123, 68, 0.45), rgba(236, 211, 161, 0.15), transparent);
}

.summary-card span,
.recommendation-card p,
.evidence-item p,
.muted-copy {
  color: var(--muted);
}

.summary-explainer {
  grid-column: 1 / -1;
}

.summary-explainer p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.summary-explainer p strong {
  display: inline;
  color: var(--text);
}

.summary-warning {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 178, 122, 0.08);
  border: 1px solid rgba(255, 178, 122, 0.25);
  color: #ffb27a;
  font-size: 0.8rem;
  line-height: 1.4;
}

.summary-warning svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.device-sheet-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-sheet-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.device-sheet-list li {
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(236, 211, 161, 0.08);
  border: 1px solid rgba(236, 211, 161, 0.18);
}

.device-sheet-list-warn li {
  color: #ffb27a;
  background: rgba(255, 178, 122, 0.07);
  border-color: rgba(255, 178, 122, 0.22);
}

.summary-card:hover,
.spec-card:hover,
.alternative-card:hover,
.evidence-item:hover,
.insight-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 229, 208, 0.18);
  background: rgba(255, 248, 240, 0.06);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.14);
}

/* ── Producto recomendado ──────────────────────────── */
.recommendation-card {
  padding: 0;
  overflow: hidden;
}

.recom-carousel {
  display: grid;
  gap: 0;
}

.recom-carousel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 229, 208, 0.1);
  background: rgba(255, 248, 240, 0.04);
}

.recom-carousel-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 700;
}

.recom-carousel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.recom-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 229, 208, 0.2);
  background: rgba(255, 248, 240, 0.06);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.recom-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.recom-track::-webkit-scrollbar {
  height: 0;
}

.recom-slide {
  min-width: 100%;
  scroll-snap-align: start;
}

.recom-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 12px 14px 16px;
}

.recom-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 229, 208, 0.24);
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease;
}

.recom-dot.is-active {
  background: var(--gold);
  transform: scale(1.15);
}

.recom-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 380px;
}

.recom-image-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 22px;
  border-right: 1px solid rgba(255, 229, 208, 0.1);
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(255, 123, 68, 0.13), transparent 65%),
    linear-gradient(180deg, rgba(255, 248, 240, 0.09), rgba(255, 248, 240, 0.04));
}

.recom-image-wrap {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 229, 208, 0.14);
  background: rgba(255, 248, 240, 0.05);
  padding: 16px;
  overflow: hidden;
}

.recom-img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  display: block;
  transition: transform 320ms ease;
}

.recom-image-col:hover .recom-img {
  transform: scale(1.05);
}

.recom-score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid rgba(255, 229, 208, 0.18);
  background: rgba(255, 248, 240, 0.06);
}

.recom-score-badge.match-high {
  border-color: rgba(145, 216, 176, 0.4);
  background: rgba(145, 216, 176, 0.08);
}

.recom-score-badge.match-medium {
  border-color: rgba(236, 211, 161, 0.4);
  background: rgba(236, 211, 161, 0.07);
}

.recom-score-badge.match-low {
  border-color: rgba(255, 157, 138, 0.4);
  background: rgba(255, 157, 138, 0.07);
}

.recom-score-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.recom-score-pct {
  font-size: 0.9rem;
}

.recom-score-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 2px;
}

.recom-content-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  overflow: hidden;
}

.recom-header {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.recom-focus {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-soft);
}

.recom-rank-chip {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 248, 240, 0.08);
  border: 1px solid rgba(255, 229, 208, 0.16);
}

.recom-device-name {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.2rem, 3vw, 3.2rem);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 0.95;
}

.recom-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recom-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 229, 208, 0.11);
  color: var(--text);
  font-size: 0.77rem;
}

.recom-summary {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--muted);
}

.recom-chips-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.recom-chip {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 248, 240, 0.05);
  border: 1px solid rgba(255, 229, 208, 0.1);
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.recom-chip::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 123, 68, 0.5), rgba(236, 211, 161, 0.15), transparent);
}

.recom-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 229, 208, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.recom-chip-label {
  display: block;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 5px;
}

.recom-chip strong {
  font-size: 0.9rem;
  color: var(--text);
}

.recom-reason {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 229, 208, 0.08);
}

.recom-affinity-panel {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 229, 208, 0.08);
  display: grid;
  gap: 10px;
}

.recom-affinity-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.recom-affinity-title {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.recom-affinity-subtitle {
  font-size: 0.72rem;
  color: var(--muted);
}

.recom-affinity-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.recom-affinity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 229, 208, 0.1);
  background: rgba(255, 248, 240, 0.04);
}

.recom-affinity-item.is-primary {
  border-color: rgba(236, 211, 161, 0.3);
  background: rgba(236, 211, 161, 0.09);
}

.recom-affinity-item.is-unsuitable {
  opacity: 0.6;
}

.recom-affinity-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffb27a;
  background: rgba(255, 178, 122, 0.1);
  border: 1px solid rgba(255, 178, 122, 0.28);
  vertical-align: middle;
}

.recom-unsuitable-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 178, 122, 0.08);
  border: 1px solid rgba(255, 178, 122, 0.28);
  color: #ffb27a;
  font-size: 0.78rem;
  line-height: 1.4;
}

.recom-unsuitable-banner svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.recom-affinity-rank {
  min-width: 34px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 248, 240, 0.09);
  border: 1px solid rgba(255, 229, 208, 0.15);
}

.recom-affinity-body {
  display: grid;
  gap: 5px;
}

.recom-affinity-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.recom-affinity-top strong {
  font-size: 0.9rem;
  color: var(--text);
}

.recom-affinity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.recom-affinity-body p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
}

.recom-affinity-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Protocolo recomendado specs ───────────────────── */
.pspec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pspec-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 248, 240, 0.05);
  border: 1px solid rgba(255, 240, 220, 0.1);
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.pspec-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 123, 68, 0.5), rgba(236, 211, 161, 0.15), transparent);
}

.pspec-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 229, 208, 0.2);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14);
}

.pspec-icon-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pspec-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.pspec-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.pspec-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.77rem;
}

.pspec-row span:first-child {
  color: var(--muted);
}

.pspec-row span:last-child {
  color: var(--text);
  font-weight: 600;
}

.pspec-note {
  margin: 0;
  font-size: 0.79rem;
  color: var(--muted);
  line-height: 1.5;
}

.pspec-note.pspec-warning {
  color: #ffb27a;
  font-weight: 500;
}

.pspec-mix {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.protocol-evidence-drawer {
  border: 1px solid rgba(255, 229, 208, 0.12);
  background: rgba(255, 248, 240, 0.05);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.protocol-evidence-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
}

.protocol-evidence-modal.is-hidden {
  display: none;
}

.protocol-evidence-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(9, 6, 5, 0.72);
}

.protocol-evidence-panel {
  position: relative;
  width: min(920px, calc(100% - 28px));
  max-height: min(84vh, 860px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 229, 208, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 248, 240, 0.1), rgba(255, 248, 240, 0.05)),
    rgba(23, 15, 13, 0.95);
  padding: 14px;
  overflow: hidden;
}

.protocol-evidence-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.protocol-evidence-modal-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
}

.protocol-evidence-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 229, 208, 0.2);
  background: rgba(255, 248, 240, 0.07);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.protocol-evidence-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.protocol-evidence-head strong {
  color: var(--text);
  font-size: 0.9rem;
}

.protocol-evidence-head span {
  color: var(--muted);
  font-size: 0.74rem;
}

.protocol-evidence-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: min(62vh, 640px);
  overflow-y: auto;
}

.protocol-evidence-item {
  border: 1px solid rgba(255, 229, 208, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 248, 240, 0.04);
}

.protocol-evidence-item strong {
  display: block;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.35;
}

.protocol-evidence-item p,
.protocol-evidence-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.protocol-evidence-link {
  display: inline-flex;
  margin-top: 6px;
  color: var(--gold);
  font-size: 0.75rem;
  text-decoration: none;
}

.protocol-evidence-link:hover {
  text-decoration: underline;
}

/* ── Alternativas: tags y cabecera ─────────────────── */
.alt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.protocol-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 229, 208, 0.1);
  color: var(--text);
  font-size: 0.78rem;
  transition: transform 180ms ease, background-color 180ms ease;
}

.protocol-tag.match-high {
  background: rgba(145, 216, 176, 0.14);
  border-color: rgba(145, 216, 176, 0.3);
  color: var(--ok);
}

.protocol-tag.match-medium {
  background: rgba(236, 211, 161, 0.12);
  border-color: rgba(236, 211, 161, 0.25);
  color: var(--gold);
}

.protocol-tag.match-low {
  background: rgba(255, 157, 138, 0.12);
  border-color: rgba(255, 157, 138, 0.25);
  color: var(--danger);
}

/* ── Wavelength mix bars ───────────────────────────── */
.mix-row {
  display: grid;
  grid-template-columns: 72px 1fr 54px;
  gap: 12px;
  align-items: center;
}

.mix-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.mix-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.table-label {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.evidence-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.evidence-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.evidence-stats div {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 248, 240, 0.05);
  border: 1px solid rgba(255, 229, 208, 0.08);
}

.evidence-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.evidence-stats strong {
  margin-top: 8px;
  font-size: 1.1rem;
}

.evidence-item {
  display: grid;
  gap: 8px;
}

.evidence-item p,
.alternative-card p,
.summary-card p {
  margin: 0;
}

.medical-disclaimer {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 157, 138, 0.35);
  background: rgba(255, 157, 138, 0.1);
}

.medical-disclaimer strong {
  color: #ffd6cd;
}

.medical-disclaimer p {
  margin: 8px 0 0;
  color: #ffd6cd;
}

.empty-panel {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 180px;
}

.hidden {
  display: none;
}

@media (max-width: 1080px) {
  .hero-grid,
  .top-recommendation-grid,
  .import-grid,
  .summary-panel,
  .alternatives-grid {
    grid-template-columns: 1fr;
  }

  .recom-layout {
    grid-template-columns: 1fr;
  }

  .recom-image-col {
    border-right: none;
    border-bottom: 1px solid rgba(255, 229, 208, 0.1);
    flex-direction: row;
    justify-content: center;
    padding: 22px;
    gap: 24px;
  }

  .recom-image-wrap {
    max-width: 160px;
  }

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

  .device-cards,
  .evidence-stats {
    grid-template-columns: 1fr;
  }

  .hero-pillars {
    grid-template-columns: 1fr;
  }

  .device-detail-bottom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .products-showcase-head {
    flex-direction: column;
    align-items: stretch;
  }

  .products-showcase-toolbar {
    justify-items: start;
  }

  .products-showcase-pills {
    justify-content: flex-start;
  }

  .device-card {
    flex-basis: clamp(244px, 48vw, 296px);
  }

  .device-showcase-detail {
    padding: 20px;
  }

  .device-detail-top {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }

  .device-detail-visual {
    min-height: 180px;
    padding: 14px;
  }

  .device-detail-image {
    height: 150px;
  }

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

  .device-detail-metric {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: 12px;
  }

  .topbar,
  .panel-head,
  .toolbar,
  .alt-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-cover,
  .device-spotlight,
  .panel-card {
    padding: 20px;
  }

  .recom-layout {
    grid-template-columns: 1fr;
  }

  .recom-image-col {
    flex-direction: column;
    padding: 20px 20px 14px;
  }

  .recom-image-wrap {
    max-width: 100%;
  }

  .recom-content-col {
    padding: 20px;
  }

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

  .recom-carousel-head {
    padding: 12px;
  }

  .recom-carousel-kicker {
    font-size: 0.64rem;
  }

  .recom-affinity-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .recom-affinity-list {
    max-height: 220px;
  }

  .pspec-grid {
    grid-template-columns: 1fr;
  }

  .hero-cover {
    padding: 36px 20px 32px;
  }

  .toolbar button {
    width: 100%;
  }

  .status-pill {
    align-self: flex-start;
  }

  .protocol-head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar {
    position: static;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .brand-wrap {
    width: 100%;
    justify-content: center;
  }

  .panel-head > div {
    width: 100%;
  }

  .brand-logo {
    width: 96px;
    height: 58px;
  }

  .form-grid,
  .form-grid-cover,
  .summary-panel,
  .alternatives-grid,
  .device-cards,
  .evidence-stats {
    grid-template-columns: 1fr;
  }

  h2 {
    max-width: 100%;
  }

  .metric-card {
    min-height: auto;
  }

  .recom-device-name {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .mix-row {
    grid-template-columns: 56px 1fr 44px;
  }

  .products-marquee {
    padding: 22px 18px 18px;
  }

  .products-showcase-description {
    max-width: none;
    font-size: 0.84rem;
    line-height: 1.5;
  }

  .products-showcase-nav {
    width: 100%;
    justify-content: space-between;
  }

  .products-showcase-frame {
    margin-top: 22px;
  }

  .products-showcase-frame::before,
  .products-showcase-frame::after {
    width: 30px;
  }

  .device-showcase-rail {
    gap: 14px;
    padding-inline: 2px;
  }

  .device-card {
    flex-basis: min(82vw, 296px);
  }

  .device-card-frame,
  .device-showcase-detail {
    padding: 16px;
  }

  .device-card-visual {
    min-height: 150px;
  }

  .device-image {
    height: 132px;
  }

  .device-detail-top {
    grid-template-columns: minmax(0, 1fr) 124px;
    gap: 12px;
    align-items: start;
  }

  .device-detail-copy {
    gap: 10px;
  }

  .device-detail-kicker {
    gap: 8px;
  }

  .device-detail-visual {
    min-height: 136px;
    padding: 10px;
    border-radius: 18px;
  }

  .device-detail-image {
    height: 112px;
  }

  .device-detail-title {
    font-size: clamp(1.7rem, 9vw, 2.2rem);
  }

  .device-detail-summary {
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .device-detail-pill {
    min-height: 22px;
    padding: 0 8px;
    font-size: 0.6rem;
    letter-spacing: 0.07em;
  }

  .device-card-metrics,
  .device-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .device-detail-metric {
    padding: 12px;
    gap: 6px;
    border-radius: 14px;
  }

  .device-detail-label {
    font-size: 0.58rem;
  }

  .device-detail-value {
    font-size: 0.9rem;
  }

  .device-detail-note {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .device-detail-bottom {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .device-spectrum-panel,
  .device-position-panel {
    padding: 12px;
    gap: 8px;
    border-radius: 14px;
  }
}
