:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --panel: rgba(248, 250, 252, 0.98);
  --panel-strong: rgba(255, 255, 255, 0.98);

  --text: #0f172a;
  --muted: #475569;

  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.24);

  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.12);

  --success: #22c55e;

  --shadow:
    0 18px 50px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(37, 99, 235, 0.04);

  --shadow-soft:
    0 10px 28px rgba(15, 23, 42, 0.1);

  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 18px;

  --blur: blur(20px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;

  font-family: "Manrope", sans-serif;
  color: var(--text);

  background: #ffffff;
}

/* GRID FUTURISTA */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;

  background-image:
    linear-gradient(rgba(59, 130, 246, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.035) 1px, transparent 1px);

  background-size: 42px 42px;

  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.26), transparent 70%);

  opacity: 0.24;
}

/* GLOW BACKGROUND */

.page-glow {
  position: fixed;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.22;
  z-index: -1;
}

.page-glow-a {
  top: -12rem;
  left: -10rem;
  background: rgba(37, 99, 235, 0.12);
}

.page-glow-b {
  right: -12rem;
  bottom: -14rem;
  background: rgba(14, 165, 233, 0.1);
}

/* LAYOUT */

.layout {
  position: relative;
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

/* TOPBAR */

.topbar {
  position: sticky;
  top: 0;
  z-index: 999;
  padding: 14px 0;
}

.topbar-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  padding: 16px 20px;

  border: 1px solid rgba(226, 232, 240, 0.95);

  border-radius: 28px;

  background: rgba(255, 255, 255, 0.96);

  backdrop-filter: var(--blur);

  box-shadow:
    0 18px 50px rgba(2, 6, 23, 0.16),
    0 0 0 1px rgba(15, 23, 42, 0.04);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.topbar-panel:hover {
  border-color: rgba(59, 130, 246, 0.26);
}

.mobile-menu-button {
  display: none;
}

/* BRAND */

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 14px;

  text-decoration: none;
  color: inherit;
}

.brandmark-logo {
  width: 48px;
  height: 48px;

  display: block;
  flex: 0 0 auto;

  object-fit: contain;

  filter:
    drop-shadow(0 8px 14px rgba(15, 23, 42, 0.18));
}

.brandmark-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
}

/* NAV */

.topnav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.topnav-link {
  position: relative;

  padding: 12px 18px;

  border-radius: 999px;

  color: #475569;
  text-decoration: none;

  font-size: 0.92rem;
  font-weight: 700;

  transition:
    all 0.2s ease;
}

.topnav-link:hover {
  color: #0f172a;
  background: rgba(59, 130, 246, 0.08);
}

.topnav-link-active {
  color: #1e3a8a;

  background:
    linear-gradient(
      135deg,
      rgba(219, 234, 254, 0.96),
      rgba(191, 219, 254, 0.88)
    );

  border: 1px solid rgba(96, 165, 250, 0.36);

  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.08),
    0 10px 24px rgba(37, 99, 235, 0.12);
}

/* LANGUAGE */

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 10px 14px;

  border-radius: 999px;

  background: rgba(241, 245, 249, 0.92);

  border: 1px solid rgba(203, 213, 225, 0.86);

  cursor: pointer;
}

.language-picker label {
  color: #64748b;

  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.language-picker select {
  background: transparent;
  border: none;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

/* INTRO GRID */

.intro-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;

  align-items: start;

  margin-top: 40px;
  margin-bottom: 34px;
}

/* HERO */

.hero {
  padding-top: 10px;
}

.eyebrow {
  margin: 0 0 10px;

  font-size: 0.78rem;
  font-weight: 800;

  text-transform: uppercase;
  letter-spacing: 0.22em;

  color: #2563eb;
}

h1 {
  margin: 0;

  max-width: 9ch;

  font-size: clamp(3rem, 5vw, 5.4rem);

  line-height: 0.92;
  letter-spacing: -0.08em;

  font-weight: 800;

  color: #0f172a;
}

h1 span {
  display: inline-block;

  margin-top: 0.1em;

  color: #2563eb;

  font-family: "Instrument Serif", serif;
  font-weight: 400;

  line-height: 0.9;
}

.intro {
  margin-top: 18px;

  max-width: 60ch;

  font-size: 1rem;
  line-height: 1.7;

  color: #475569;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 12px;

  margin-top: 24px;

  padding: 12px 16px;

  border-radius: 999px;

  background: rgba(248, 250, 252, 0.96);

  border: 1px solid rgba(148, 163, 184, 0.34);

  color: #0f172a;

  backdrop-filter: blur(12px);
}

.hero-note-dot {
  width: 10px;
  height: 10px;

  border-radius: 999px;

  background: #3b82f6;

  box-shadow:
    0 0 0 6px rgba(59, 130, 246, 0.14),
    0 0 20px rgba(59, 130, 246, 0.5);
}

/* SUPPORT */

.support-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  align-items: stretch;
  margin-top: 54px;
}

.support-hero {
  padding-top: 10px;
}

.support-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(226, 232, 240, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow:
    0 28px 70px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.support-mark {
  width: 96px;
  height: 96px;
  margin-bottom: 22px;
}

.support-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(15, 23, 42, 0.18));
}

.support-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: fit-content;
  align-self: center;
  margin-top: auto;
  padding: 0 24px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.24);
  transition: background 0.2s ease, transform 0.2s ease;
}

.support-button:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* ASIDE */

.hero-aside {
  padding: 28px;

  border-radius: var(--radius-xl);

  background:
    linear-gradient(
      180deg,
      rgba(248, 250, 252, 0.98),
      rgba(226, 232, 240, 0.96)
    );

  border: 1px solid rgba(148, 163, 184, 0.34);

  backdrop-filter: var(--blur);

  box-shadow: var(--shadow-soft);
}

.aside-kicker {
  margin: 0 0 10px;

  color: #2563eb;

  font-size: 0.75rem;
  font-weight: 800;

  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.aside-title {
  margin: 0 0 16px;

  font-size: 1.4rem;

  line-height: 1.15;

  letter-spacing: -0.03em;

  color: #0f172a;
}

.aside-list {
  margin: 0;
  padding-left: 18px;

  color: #475569;

  line-height: 1.7;
}

.aside-list li::marker {
  color: #2563eb;
}

/* PANEL */

.panel {
  display: block;
}

.tool-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
}

body[data-page="classifier"] .intro-grid,
body[data-page="classifier"] .tool-panel {
  grid-template-columns: 1fr;
}

body[data-page="classifier"] .hero,
body[data-page="classifier"] .tool-heading {
  display: none;
}

body[data-page="classifier"] .hero-aside,
body[data-page="classifier"] .form {
  width: 100%;
}

body[data-page="classifier"].classifier-analysis-active .intro-grid,
body[data-page="classifier"].classifier-analysis-active #classifier-form {
  display: none;
}

body[data-page="classifier"].classifier-analysis-active .tool-panel {
  display: block;
}

/* SUPPORT PAGE */

.support-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
}

body[data-page="support"] .tool-panel {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  height: 100%;
}

body[data-page="support"] .tool-heading {
  position: static;
  text-align: center;
  justify-items: center;
  margin-bottom: 32px;
}

body[data-page="support"] .tool-title {
  max-width: 20ch;
}

body[data-page="support"] #support-result {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 18px;
  width: 100%;
  margin: 0 auto;
}

body[data-page="support"] #about-result {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 18px;
  width: 100%;
  margin: 0 auto;
}

body[data-page="support"] .support-mark {
  margin: 0 auto 16px;
}

body[data-page="support"] #support-result .eyebrow {
  margin-bottom: 12px;
}

body[data-page="support"] #support-result h3 {
  margin: 0 0 12px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #0f172a;
}

body[data-page="support"] #support-result .intro {
  margin-top: 0;
  margin-bottom: 22px;
  max-width: 38ch;
}

body[data-page="support"] .support-button {
  justify-self: center;
  align-self: center;
}

.contact-card {
  width: 100%;
  margin-top: 28px;
  padding: 24px;
  border-radius: 20px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.22);
}

.contact-card p {
  margin: 8px 0;
  color: #475569;
}

.contact-card p:first-child {
  margin: 0 0 14px;
  color: #0f172a;
  font-weight: 700;
}

.contact-card a {
  color: #2563eb;
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* TOOL HEADING */

.tool-heading {
  display: grid;
  gap: 12px;

  align-content: start;

  position: sticky;
  top: 110px;
}

.tool-kicker {
  margin: 0;

  font-size: 0.75rem;
  font-weight: 800;

  letter-spacing: 0.16em;
  text-transform: uppercase;

  color: #2563eb;
}

.tool-title {
  margin: 0;

  font-size: clamp(2rem, 3vw, 3.3rem);

  line-height: 0.95;

  letter-spacing: -0.05em;

  color: #0f172a;
}

.tool-copy {
  margin: 0;

  max-width: 32ch;

  color: #475569;

  line-height: 1.7;
}

/* FORM */

.form,
.result,
.card {
  border-radius: var(--radius-xl);

  background:
    linear-gradient(
      180deg,
      rgba(248, 250, 252, 0.98),
      rgba(226, 232, 240, 0.96)
    );

  border: 1px solid rgba(148, 163, 184, 0.34);

  backdrop-filter: var(--blur);

  box-shadow: var(--shadow);
}

.form {
  display: grid;
  gap: 18px;

  padding: 34px;
}

label {
  color: #334155;

  font-size: 0.78rem;
  font-weight: 800;

  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* TEXTAREA */

textarea {
  width: 100%;
  min-height: 240px;

  resize: vertical;

  padding: 22px;

  border-radius: 22px;

  border: 1px solid rgba(148, 163, 184, 0.5);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(241, 245, 249, 0.98)
    );

  color: #0f172a;

  font: inherit;
  font-size: 1rem;
  line-height: 1.7;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

textarea::placeholder {
  color: #64748b;
}

input[type="text"],
input[type="number"] {
  width: 100%;

  padding: 14px 16px;

  border-radius: 16px;

  border: 1px solid rgba(148, 163, 184, 0.5);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(241, 245, 249, 0.98)
    );

  color: #0f172a;

  font: inherit;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;

  border-color: rgba(59, 130, 246, 0.55);

  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.12),
    0 0 24px rgba(59, 130, 246, 0.12);
}

textarea:focus {
  outline: none;

  border-color: rgba(59, 130, 246, 0.55);

  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.12),
    0 0 24px rgba(59, 130, 246, 0.12);

  transform: translateY(-1px);
}

/* BUTTON */

button {
  width: fit-content;

  padding: 15px 22px;

  border: 1px solid rgba(59, 130, 246, 0.2);

  border-radius: 999px;

  background:
    linear-gradient(
      135deg,
      #3b82f6,
      #2563eb
    );

  color: white;

  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;

  cursor: pointer;

  box-shadow:
    0 12px 30px rgba(37, 99, 235, 0.3);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

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

  box-shadow:
    0 18px 36px rgba(37, 99, 235, 0.4),
    0 0 30px rgba(59, 130, 246, 0.18);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* RESULT */

.result {
  grid-column: 1 / -1;
  padding: 30px;
}

body[data-page="classifier"] .result[data-state="loading"] {
  display: grid;
  min-height: calc(100vh - 190px);
  place-items: center;
}

body[data-page="classifier"] .loading-state {
  display: grid;
  justify-items: center;
  gap: 20px;
}

body[data-page="classifier"] .loading-spinner {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 5px solid rgba(37, 99, 235, 0.16);
  border-top-color: #2563eb;
  animation: loading-spin 0.8s linear infinite;
}

body[data-page="classifier"] .result[data-state="loading"] .empty {
  max-width: 42rem;
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 800;
  text-align: center;
}

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

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

.identified-product {
  display: grid;
  gap: 8px;

  margin: 16px 0 22px;
  padding: 16px 18px;

  border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: 18px;

  background: rgba(14, 165, 233, 0.08);
}

.identified-product-label {
  margin: 0;

  color: #0369a1;

  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.identified-product-value {
  margin: 0;

  color: #0f172a;

  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.45;
}

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

  margin-top: 12px;
}

.clarification-groups {
  display: grid;
  gap: 18px;

  margin-top: 12px;
}

.clarification-group {
  display: grid;
  gap: 10px;

  min-width: 0;
  margin: 0;
  padding: 0;

  border: 0;
}

.clarification-group legend {
  margin-bottom: 4px;

  color: #0f172a;

  font-size: 1rem;
  font-weight: 800;
}

.clarification-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;

  padding: 14px 16px;

  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.82);

  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.clarification-choice input {
  margin-top: 3px;
}

.clarification-choice-copy {
  display: grid;
  gap: 5px;
}

.clarification-option {
  display: grid;
  justify-items: start;
  gap: 8px;

  width: 100%;
  min-height: 132px;
  padding: 18px;

  border-radius: 18px;
  border-color: rgba(37, 99, 235, 0.18);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(239, 246, 255, 0.95)
    );

  color: #0f172a;
  text-align: left;

  box-shadow: var(--shadow-soft);
}

.clarification-option-label {
  font-size: 1rem;
  font-weight: 800;
}

.clarification-option-description {
  color: #475569;

  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
}

.clarification-option-action {
  margin-top: auto;

  color: #1d4ed8;

  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clarification-submit {
  margin-top: 4px;
}

.hidden {
  display: none;
}

/* CARD */

.card {
  padding: 24px;

  background:
    linear-gradient(
      180deg,
      rgba(248, 250, 252, 0.98),
      rgba(226, 232, 240, 0.96)
    );

  border-color: rgba(148, 163, 184, 0.34);
}

.card-primary {
  grid-column: 1 / -1;
  border-color: rgba(59, 130, 246, 0.42);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.99),
      rgba(219, 234, 254, 0.96)
    );
}

.card-alternative {
  min-width: 0;
  box-shadow: var(--shadow-soft);
}

.result-card-grid .section-title {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* BADGES */

.badge,
.confidence {
  display: inline-flex;
  align-items: center;

  padding: 10px 14px;

  border-radius: 999px;

  font-size: 0.82rem;
  font-weight: 700;
}

.badge {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;

  border: 1px solid rgba(37, 99, 235, 0.22);
}

.confidence {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;

  border: 1px solid rgba(22, 163, 74, 0.18);
}

.confidence-warning {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.22);
}

.confidence-caution {
  background: rgba(217, 119, 6, 0.12);
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.2);
}

.confidence-help {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.confidence-help-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(71, 85, 105, 0.24);
  color: #334155;
  font-size: 0.8rem;
  font-weight: 800;
}

.confidence-help-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 2;
  width: min(280px, 72vw);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  font-size: 0.82rem;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.confidence-help:hover .confidence-help-tooltip,
.confidence-help-icon:focus + .confidence-help-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* CODE OPTIONS */

.code-options {
  display: flex;
  flex-wrap: wrap;

  gap: 12px;

  margin-top: 18px;
}

.copyable-code-option {
  flex: 0 1 auto;
  min-width: max-content;
  max-width: 100%;
  padding: 14px;

  border-radius: 18px;

  background: rgba(15, 23, 42, 0.04);

  border: 1px solid rgba(15, 23, 42, 0.08);

  box-shadow: none;
  color: #0f172a;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.copyable-code-option:hover {
  transform: translateY(-2px);

  border-color: rgba(59, 130, 246, 0.24);

  background: rgba(37, 99, 235, 0.08);
}

.copyable-code-label {
  display: block;
  max-width: 100%;

  margin-bottom: 6px;

  font-size: 0.72rem;
  font-weight: 800;

  letter-spacing: 0.08em;
  text-transform: uppercase;

  color: #64748b;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copyable-code-value {
  display: block;
  max-width: 100%;

  font-size: 1rem;
  font-weight: 800;

  color: #0f172a;

  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  word-break: normal;
  scrollbar-width: thin;
}

/* TITLES */

.title {
  margin: 18px 0 12px;

  font-size: 1.5rem;

  line-height: 1.2;

  letter-spacing: -0.03em;

  color: #0f172a;
}

.card .title {
  color: #0f172a;
}

.hierarchy {
  margin: 16px 0 12px;

  color: #334155;

  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.55;
}

.summary,
.empty,
.reasons {
  color: #475569;

  line-height: 1.7;
}

.card .summary,
.card .reasons {
  color: #475569;
}

.reasons {
  padding-left: 20px;
}

.secondary-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: fit-content;
  margin-top: 18px;
  padding: 14px 18px;

  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.24);

  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;

  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.result-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.result-actions-top {
  justify-content: flex-end;
  margin-top: 0;
  margin-bottom: 18px;
}

.result-actions-secondary {
  justify-content: flex-end;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.search-again-button {
  background:
    linear-gradient(
      135deg,
      #0f172a,
      #1d4ed8
    );
}

.secondary-search-button {
  padding: 11px 14px;
  border: 1px solid rgba(185, 28, 28, 0.26);
  background: rgba(254, 226, 226, 0.65);
  color: #b91c1c;
  box-shadow: none;
}

.secondary-search-button:hover {
  border-color: rgba(153, 27, 27, 0.38);
  background: rgba(254, 202, 202, 0.82);
  color: #991b1b;
  transform: none;
  box-shadow: none;
}

.warning-banner,
.disclaimer {
  margin: 18px 0 0;
  color: #475569;
  line-height: 1.7;
}

.warning-banner {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(217, 119, 6, 0.22);
  background: rgba(217, 119, 6, 0.1);
  color: #92400e;
}

.inline-notice,
.autocomplete-results,
.metric-card,
.cost-summary,
.checkbox-row {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
}

.inline-notice,
.cost-summary,
.checkbox-row {
  padding: 14px 16px;
}

.metric-card {
  padding: 18px;
}

.metric-label,
.metric-note {
  color: #64748b;
}

.metric-value {
  color: #0f172a;
}

/* HISTORY */

.history-layout {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 80px;
}

.history-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.history-title {
  max-width: none;
  font-size: clamp(2.4rem, 4vw, 4rem);
  color: #0f172a;
}

.history-controls {
  display: flex;
  align-items: end;
  gap: 12px;
}

.history-controls input {
  width: 110px;
}

.history-list {
  display: grid;
  gap: 16px;
}

.history-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(248, 250, 252, 0.98);
  box-shadow: var(--shadow-soft);
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.history-card h2 {
  margin: 12px 0 6px;
  color: #0f172a;
  font-size: 1.45rem;
}

.history-card p {
  margin: 0;
  color: #475569;
  line-height: 1.65;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.history-meta span {
  display: inline-flex;
  align-items: center;
  height: fit-content;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
}

.history-description {
  margin-top: 16px !important;
  color: #0f172a !important;
  font-weight: 700;
}

.history-result {
  margin-top: 8px !important;
}

.history-details {
  margin-top: 16px;
  color: #334155;
}

.history-details summary {
  cursor: pointer;
  font-weight: 800;
  color: #1d4ed8;
}

.history-json {
  max-height: 420px;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: #0f172a;
  color: #dbeafe;
  font-size: 0.82rem;
  line-height: 1.55;
}

/* RESPONSIVE */

@media (max-width: 980px) {
  .intro-grid,
  .support-layout,
  .support-page-grid,
  .tool-panel {
    grid-template-columns: 1fr !important;
  }

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

  .clarification-options {
    grid-template-columns: 1fr;
  }

  .tool-heading {
    position: static;
  }

  h1 {
    max-width: 12ch;
  }

  .code-options {
    display: flex;
  }
}

@media (max-width: 640px) {
  .layout {
    width: min(100% - 20px, 1280px);
    padding-top: 12px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 2000;
    padding: 0;
  }

  .topbar-panel {
    position: relative;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 10px 12px;
    border-radius: 20px;
  }

  .support-layout {
    gap: 22px;
    margin-top: 28px;
  }

  .support-panel {
    padding: 24px;
  }

  .brandmark {
    flex: 1;
  }

  .brandmark-logo {
    width: 42px;
    height: 42px;
  }

  .brandmark-copy {
    display: none;
  }

  .mobile-menu-button {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    gap: 4px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: rgba(219, 234, 254, 0.7);
    box-shadow: none;
  }

  .mobile-menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #1d4ed8;
  }

  .topnav,
  .topbar-actions {
    display: none;
  }

  body.mobile-menu-open {
    overflow: hidden !important;
  }

  body.mobile-menu-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1998;
    pointer-events: auto;
  }

  body.mobile-menu-open .topnav,
  body.mobile-menu-open .topbar-actions {
    display: flex;
  }

  body.mobile-menu-open .topbar-panel {
    flex-wrap: wrap;
  }

  /* Menú móvil integrado bajo la cabecera */
  .topnav {
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    flex: 0 0 100%;
    padding: 12px 0 0;
    margin-top: 2px;
    border-radius: 20px;
  }

  .topnav-link {
    text-align: left;
    border-radius: 14px;
  }

  .topbar-actions {
    order: 4;
    width: 100%;
    flex: 0 0 100%;
    padding-top: 8px;
  }

  .language-picker {
    width: 100%;
    justify-content: space-between;
    border-radius: 14px;
  }

  .form,
  .result,
  .card,
  .hero-aside {
    border-radius: 24px;
  }

  .form,
  .result,
  .card {
    padding: 22px;
  }

  body[data-page="support"] .panel {
    margin-top: 24px;
  }

  body[data-page="support"] .support-page-grid {
    gap: 18px;
  }

  body[data-page="support"] .tool-panel {
    gap: 18px;
  }

  body[data-page="support"] .tool-heading {
    margin-bottom: 0;
    text-align: left;
    justify-items: start;
  }

  body[data-page="support"] .tool-title {
    max-width: none;
    font-size: 1.8rem;
    line-height: 1.05;
  }

  body[data-page="support"] #about-result,
  body[data-page="support"] #support-result {
    justify-items: start;
    text-align: left;
    gap: 14px;
  }

  body[data-page="support"] .support-button {
    width: 100%;
  }

  .contact-card {
    margin-top: 18px;
    padding: 18px;
    border-radius: 18px;
  }

  .result-card-grid {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 180px;
  }

  h1 {
    font-size: 2.8rem;
  }
}
