/* ── CooperLightBT Font ── */
@font-face {
  font-family: 'CooperLightBT';
  src: url('/assets/CooperLightBT.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Page Transition ──────────────────────────────────────────────────────── */
/* Set background immediately (before external CSS resolves vars)             */
html {
  background: #181818;
}

/* Body fades only when transitions.js is actively navigating away.        */
/* Default: fully visible, so a missing/blocked transitions.js never       */
/* leaves the page invisible (and back-button restore is a non-issue).    */
body {
  opacity: 1;
  transition: opacity 0.18s ease;
}

/* transitions.js sets html.is-leaving right before it triggers a nav      */
/* (replacing the previous `.page-ready` toggle).                          */
html.is-leaving body {
  opacity: 0;
}


:root {
  /* Two-color palette — everything else is opacity on top of these */
  --bg: #181818;
  --fg: #f5f5f5;

  /* Surfaces (subtle elevations using fg/bg blends) */
  --surface-1: #1e1e1e;
  /* slight elevation */
  --surface-2: #242424;
  /* more elevation */
  --surface-3: #2c2c2c;
  /* most elevation */

  /* Foreground tints */
  --fg-90: rgba(245, 245, 245, 0.90);
  --fg-70: rgba(245, 245, 245, 0.70);
  --fg-55: rgba(245, 245, 245, 0.55);
  --fg-40: rgba(245, 245, 245, 0.40);
  --fg-25: rgba(245, 245, 245, 0.25);

  /* Borders */
  --border: rgba(245, 245, 245, 0.08);
  --border-strong: rgba(245, 245, 245, 0.14);
  --border-hover: rgba(245, 245, 245, 0.22);

  /* Geometry */
  --radius: 14px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Header ── */
.header {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(24, 24, 24, 0.85);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
  letter-spacing: -0.02em;
}

/* Page-name suffix on subpages: "MetaSnap | SEO" */
.logo-sub {
  margin-left: 6px;
  font-weight: 500;
  color: var(--fg-40);
  letter-spacing: 0;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--fg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  color: var(--bg);
}

/* Inline brand SVG sitting next to the "MetaSnap" wordmark.
   Sized via em so it tracks the logo's font-size and visually matches
   the cap-height of the text. */
.logo-svg {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  color: var(--fg);
  display: inline-block;
  vertical-align: middle;
}

/* Slightly tighter spacing between icon and wordmark than the default
   .logo gap so they read as one unit. */
.logo {
  gap: 8px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Mobile menu toggle (hidden on desktop) ── */
.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--fg);
  cursor: pointer;
  transition: opacity 0.2s, color 0.2s;
  padding: 0;
}

.menu-toggle:hover {
  color: var(--fg);
  opacity: 0.7;
}

.menu-toggle svg {
  stroke: currentColor;
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/* Mobile drawer */
.mobile-menu {
  position: fixed;
  top: 60px;
  /* below header */
  left: 0;
  right: 0;
  bottom: 0;
  /* Allow vertical scrolling when there are many links */
  max-height: calc(100vh - 60px);
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  z-index: 49;
  background: rgba(24, 24, 24, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-110%);
  visibility: hidden;
  /* Prevent menu links from being visible above header during top rubber-banding */
  transition: transform 0.28s var(--ease), visibility 0.28s var(--ease);
  pointer-events: none;
}

.mobile-menu.open {
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.mobile-menu-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 24px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu .nav-link {
  padding: 14px 16px;
  font-size: 0.96rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.mobile-menu .nav-link:hover,
.mobile-menu .nav-link[aria-current="page"] {
  background: var(--surface-2);
  color: var(--fg);
}

.mobile-menu .nav-link svg,
.mobile-menu .nav-link i {
  width: 18px;
  height: 18px;
  font-size: 16px;
}

.mobile-menu .nav-badge {
  align-self: flex-start;
  margin-top: 8px;
}

/* Backdrop */
.mobile-menu-backdrop {
  position: fixed;
  inset: 60px 0 0 0;
  z-index: 48;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.mobile-menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Lock body scroll when menu open */
body.menu-open {
  overflow: hidden;
}

.nav-badge {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--fg-70);
  letter-spacing: 0.02em;
}

.nav-link {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-55);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--fg);
  background: var(--surface-2);
}

/* re-icon sizing inside nav links */
.nav-link re-icon {
  font-size: 16px;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
  color: inherit;
}

.nav-link re-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Active page — light highlight */
.nav-link[aria-current="page"] {
  color: var(--bg);
  background: var(--fg);
  font-weight: 600;
}

.nav-link[aria-current="page"]:hover {
  color: var(--bg);
  background: rgba(245, 245, 245, 0.9);
}

/* ── All Tools Dropdown ── */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* The trigger shares .nav-link styles but is a <button> */
.nav-dropdown-trigger {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-55);
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-dropdown-trigger:hover {
  color: var(--fg);
  background: var(--surface-2);
}

.nav-dropdown.active-tool .nav-dropdown-trigger {
  color: var(--bg);
  background: var(--fg);
  font-weight: 600;
}

.nav-dropdown-chevron {
  font-size: 10px;
  margin-left: 2px;
  transition: transform 0.2s var(--ease);
  color: inherit;
  opacity: 0.6;
}

.nav-dropdown.open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

/* Dropdown Panel — surface-2, clean border, no blur */
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 400px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
  z-index: 100;
}

/* Small caret */
.nav-dropdown-panel::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: var(--surface-2);
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
}

.nav-dropdown.open .nav-dropdown-panel {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Each item inside the dropdown */
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--fg-70);
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-item:hover,
.nav-dropdown-item[aria-current="page"] {
  background: var(--surface-3);
  color: var(--fg);
}

.ndi-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(245, 245, 245, 0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--fg-55);
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-item:hover .ndi-icon,
.nav-dropdown-item[aria-current="page"] .ndi-icon {
  background: rgba(245, 245, 245, 0.1);
  color: var(--fg);
}

.ndi-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.ndi-name {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.ndi-desc {
  font-size: 0.71rem;
  color: var(--fg-40);
}

/* Mobile section label for "Tools" group */
.mobile-menu-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-40);
  padding: 12px 16px 6px;
}

/* Mobile dropdown items inherit nav-link mobile styles */
.mobile-menu .nav-dropdown-item {
  padding: 12px 16px;
  font-size: 0.96rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--fg-70);
}

.mobile-menu .nav-dropdown-item:hover,
.mobile-menu .nav-dropdown-item[aria-current="page"] {
  background: var(--surface-2);
  color: var(--fg);
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 88px 24px 56px;
  max-width: 820px;
  margin: 0 auto;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-70);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero-chip-dot {
  width: 6px;
  height: 6px;
  background: var(--fg);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.hero h1 {
  font-family: 'CooperLightBT', 'Plus Jakarta Sans', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--fg);
  margin-bottom: 4px;
}

.hero-gradient {
  color: var(--fg-55);
  font-style: italic;
  font-weight: 600;
}

.hero-sub {
  margin-top: 18px;
  color: var(--fg-55);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Platform Pills ── */
.platform-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--fg-55);
  cursor: default;
  transition: all 0.2s var(--ease);
}

.pill:hover {
  border-color: var(--border-hover);
  color: var(--fg);
}

/* ── Search Bar ── */
.search-bar {
  display: flex;
  align-items: center;
  margin-top: 36px;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
  position: relative;
}

.search-bar:focus-within {
  border-color: var(--fg-40);
  box-shadow: 0 0 0 4px rgba(245, 245, 245, 0.05);
}

.search-icon {
  padding: 0 0 0 22px;
  color: var(--fg-55);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  padding: 16px 16px 16px 14px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-size: 1rem;
  font-family: inherit;
}

.search-bar input::placeholder {
  color: var(--fg-25);
}

.search-bar button {
  padding: 12px 26px;
  margin: 6px;
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  white-space: nowrap;
}

.search-bar button:hover {
  background: rgba(245, 245, 245, 0.9);
}

.search-bar button:active {
  transform: scale(0.98);
}

.search-bar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Sample URL Chips ── */
.samples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--fg-40);
}

.samples-label {
  font-weight: 500;
  align-self: center;
  margin-right: 4px;
}

.sample-chip {
  padding: 5px 11px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.76rem;
  color: var(--fg-55);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.sample-chip:hover {
  color: var(--fg);
  border-color: var(--border-hover);
  background: var(--surface-1);
}

/* ── Spinner ── */
.spinner {
  width: 16px;
  height: 16px;
  animation: spin 0.7s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* ── Error ── */
.error-msg {
  margin-top: 18px;
  color: var(--fg);
  font-size: 0.88rem;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.3s var(--ease);
  min-width: 240px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.toast .toast-icon {
  color: var(--bg);
}

.toast.error {
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border-hover);
}

.toast.error .toast-icon {
  color: var(--fg);
}

.toast.fade-out {
  animation: toastOut 0.25s var(--ease) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ── Results Layout ── */
.results {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px 100px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  animation: fadeUp 0.5s var(--ease);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Editor Panel ── */
.editor-panel {
  position: sticky;
  top: 88px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.panel-header h2,
.panel-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
}

.panel-badge {
  padding: 3px 10px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--fg-70);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.panel-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--fg);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.panel-body {
  padding: 18px;
}

.field {
  margin-bottom: 14px;
  position: relative;
}

.field:last-of-type {
  margin-bottom: 0;
}

.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-55);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field-status {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--fg-25);
}

.field-status.good {
  color: var(--fg);
}

.field-status.warn {
  color: var(--fg-55);
}

.field-status.bad {
  color: var(--fg-25);
  text-decoration: underline;
  text-decoration-style: dotted;
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--fg-40);
  background: var(--surface-1);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--fg-25);
}

.char-count {
  position: absolute;
  right: 12px;
  bottom: 9px;
  font-size: 0.7rem;
  color: var(--fg-25);
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  padding: 0 4px;
}

/* Field with action */
.field-with-action {
  display: flex;
  gap: 8px;
  align-items: center;
}

.field-with-action input {
  flex: 1;
}

.field-action-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-55);
  cursor: pointer;
  transition: all 0.2s;
}

.field-action-btn:hover {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

/* ── SEO Score ── */
.seo-score-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: var(--surface-1);
}

.seo-ring {
  position: relative;
  width: 70px;
  height: 70px;
  flex-shrink: 0;
}

.seo-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.seo-ring-bg {
  stroke: var(--surface-3);
}

.seo-ring-fg {
  stroke: var(--fg);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease), stroke 0.3s, opacity 0.3s;
}

.seo-ring.good .seo-ring-fg {
  opacity: 1;
}

.seo-ring.warn .seo-ring-fg {
  opacity: 0.6;
}

.seo-ring.bad .seo-ring-fg {
  opacity: 0.3;
}

.seo-score-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.seo-summary {
  flex: 1;
  min-width: 0;
}

.seo-summary-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 3px;
}

.seo-summary-sub {
  font-size: 0.78rem;
  color: var(--fg-55);
  line-height: 1.5;
}

.seo-checks {
  border-top: 1px solid var(--border);
  padding: 12px 18px;
}

/* Header link to full audit page */
.audit-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-70);
  text-decoration: none;
  transition: all 0.2s;
}

.audit-link:hover {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

/* Grade badge — moved inline next to summary */
.seo-grade-inline {
  margin-top: 6px;
}

/* CTA at the bottom of the SEO panel */
.seo-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.seo-cta-text {
  flex: 1;
  font-size: 0.78rem;
  color: var(--fg-70);
  line-height: 1.4;
}

.seo-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}

.seo-cta-btn:hover {
  background: rgba(245, 245, 245, 0.9);
  transform: translateX(2px);
}

.seo-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 0.82rem;
  color: var(--fg-70);
}

.seo-check-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
}

.seo-check.pass .seo-check-icon {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.seo-check.warn .seo-check-icon {
  background: transparent;
  color: var(--fg);
  border-color: var(--fg-55);
}

.seo-check.fail .seo-check-icon {
  background: transparent;
  color: var(--fg-40);
  border-color: var(--fg-25);
}

.seo-check.fail {
  color: var(--fg-40);
}

.seo-check-text {
  flex: 1;
}

.seo-check-detail {
  font-size: 0.74rem;
  color: var(--fg-40);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* ── Code Output ── */
.code-output {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.code-header h3 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  color: var(--fg-70);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.copy-btn:hover {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

.code-output pre {
  padding: 16px;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.75;
  max-height: 280px;
  overflow-y: auto;
}

.code-output code {
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  color: var(--fg-70);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Preview Panel — Masonry (CSS columns) ── */
.preview-panel {
  column-count: 2;
  column-gap: 22px;
  align-content: start;
}

.preview-panel .preview-card {
  break-inside: avoid;
  margin-bottom: 22px;
  display: block;
  width: 100%;
}

/* ── Preview Card ── */
.preview-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.25s var(--ease);
}

.preview-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.preview-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  background: var(--surface-2);
}

.preview-tag {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  color: var(--fg-40);
  border: 1px solid var(--border-strong);
}

/* Platform Icons — brand-tinted badges */
.platform-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--fg);
  font-size: 13px;
}

.platform-icon i {
  line-height: 1;
  display: inline-flex;
}

/* Brand-identity colors on the platform icon badges */

.brand-google {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  color: #4285f4;
}

.brand-facebook {
  background: #1877f2;
  border-color: #1877f2;
  color: #ffffff;
}

.brand-x {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}

.brand-linkedin {
  background: #0a66c2;
  border-color: #0a66c2;
  color: #ffffff;
}

.brand-pinterest {
  background: #e60023;
  border-color: #e60023;
  color: #ffffff;
}

.brand-whatsapp {
  background: #25d366;
  border-color: #25d366;
  color: #ffffff;
}

.brand-slack {
  background: #4a154b;
  border-color: #4a154b;
  color: #ffffff;
}

.platform-icon svg {
  color: inherit;
}

/* Pill brand icons */
.pill i {
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
}

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-1) 0%, var(--surface-3) 50%, var(--surface-1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
  color: transparent !important;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ── Shared: Social Favicon ── */
.social-favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

.favicon-placeholder {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: #d0d5e8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #9098b8;
}

/* ── Shared: Image Placeholder ── */
.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #9aa0ba;
  font-size: 0.8rem;
  font-weight: 500;
  background: #e8eaf2;
}

/* ──────────────────────────────────────────────
   PLATFORM PREVIEW CARDS BELOW
   These keep brand-accurate styling because they
   simulate how the link actually appears on each
   platform — that's the tool's purpose.
   ────────────────────────────────────────────── */

/* ── Google Preview ── */
.google-preview {
  padding: 22px;
  background: #fff;
}

.gp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.gp-favicon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f1f3f4;
  object-fit: contain;
}

.gp-favicon-placeholder {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f1f3f4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa5b4;
  flex-shrink: 0;
}

.gp-site {
  display: block;
  font-size: 0.82rem;
  color: #202124;
  font-weight: 500;
  font-family: Arial, sans-serif;
}

.gp-url {
  display: block;
  font-size: 0.75rem;
  color: #4d5156;
  font-family: Arial, sans-serif;
}

.gp-title {
  display: block;
  font-size: 1.18rem;
  color: #1a0dab;
  text-decoration: none;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 4px;
  font-family: Arial, sans-serif;
}

.gp-title:hover {
  text-decoration: underline;
}

.gp-desc {
  font-size: 0.85rem;
  color: #4d5156;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

/* ── Facebook Preview ── */
.fb-preview {
  background: #f0f2f5;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.fb-image-wrap {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  background: #e4e6eb;
  overflow: hidden;
  position: relative;
}

.fb-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fb-body {
  padding: 11px 14px 14px;
  background: #fff;
  border-top: 1px solid #dddfe2;
}

.fb-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.fb-domain {
  font-size: 0.72rem;
  color: #606770;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: Helvetica, Arial, sans-serif;
}

.fb-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: #1d2129;
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: Helvetica, Arial, sans-serif;
}

.fb-desc {
  font-size: 0.82rem;
  color: #606770;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: Helvetica, Arial, sans-serif;
}

/* ── Twitter/X Preview ── */
.tw-preview {
  background: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.tw-image-wrap {
  width: 100%;
  aspect-ratio: 2 / 1;
  background: #e4e6eb;
  overflow: hidden;
  position: relative;
}

.tw-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tw-body {
  padding: 11px 14px 14px;
}

.tw-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.tw-domain {
  font-size: 0.75rem;
  color: #536471;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tw-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f1419;
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tw-desc {
  font-size: 0.82rem;
  color: #536471;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── LinkedIn Preview ── */
.li-preview {
  background: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.li-image-wrap {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  background: #e4e6eb;
  overflow: hidden;
  position: relative;
}

.li-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.li-body {
  padding: 12px 14px 14px;
  background: #f3f2ef;
  border-top: 1px solid #e0e0e0;
}

.li-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.9);
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.li-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.li-domain {
  font-size: 0.72rem;
  color: rgba(0, 0, 0, 0.6);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Pinterest Preview ── */
.pt-preview {
  background: #f0eeeb;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 18px;
  display: flex;
  justify-content: center;
}

.pt-card {
  width: 190px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.pt-image-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #e8e8e8;
  overflow: hidden;
  position: relative;
}

.pt-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pt-placeholder {
  background: #e8e8e8;
}

.pt-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.2s;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 10px;
}

.pt-image-wrap:hover .pt-overlay {
  background: rgba(0, 0, 0, 0.15);
}

.pt-save-btn {
  padding: 6px 12px;
  background: #e60023;
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.pt-image-wrap:hover .pt-save-btn {
  opacity: 1;
}

.pt-body {
  padding: 11px 12px 12px;
}

.pt-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #111;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.pt-source {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pt-domain {
  font-size: 0.7rem;
  color: #767676;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── WhatsApp Preview ── */
.wa-preview {
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.wa-chat-bg {
  background: #e5ddd5;
  background-image:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c5bdb5' fill-opacity='0.3'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  padding: 16px 12px 20px;
  display: flex;
  justify-content: flex-end;
}

.wa-bubble {
  max-width: 85%;
  background: #dcf8c6;
  border-radius: 8px 0 8px 8px;
  padding: 6px 8px 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wa-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  right: -8px;
  border: 8px solid transparent;
  border-top-color: #dcf8c6;
  border-right: 0;
}

.wa-link-card {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}

.wa-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #e8e8e8;
  overflow: hidden;
  position: relative;
}

.wa-placeholder {
  background: #e8e8e8;
  flex-direction: row;
}

.wa-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wa-body {
  padding: 8px 10px 10px;
}

.wa-site {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}

.wa-domain {
  font-size: 0.7rem;
  color: #25d366;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.wa-favicon {
  width: 14px;
  height: 14px;
}

.wa-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #111;
  line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wa-desc {
  font-size: 0.75rem;
  color: #555;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wa-url-text {
  display: block;
  font-size: 0.72rem;
  color: #128c7e;
  margin-bottom: 2px;
  word-break: break-all;
}

.wa-time {
  font-size: 0.65rem;
  color: #999;
  text-align: right;
}

/* ── Slack Preview ── */
.sl-preview {
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.sl-chat-bg {
  background: #1a1d21;
  padding: 16px 14px;
  font-family: Slack-Lato, appleLogo, sans-serif;
}

.sl-message {
  display: flex;
  gap: 10px;
}

.sl-avatar {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sl-content {
  flex: 1;
  min-width: 0;
}

.sl-sender {
  font-size: 0.88rem;
  font-weight: 700;
  color: #e8e8e8;
  margin-bottom: 3px;
}

.sl-time {
  font-size: 0.72rem;
  font-weight: 400;
  color: #696969;
  margin-left: 8px;
}

.sl-link-text {
  font-size: 0.82rem;
  color: #1d9bd1;
  word-break: break-all;
  margin-bottom: 6px;
}

.sl-unfurl {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
}

.sl-accent-bar {
  width: 4px;
  background: #888;
  flex-shrink: 0;
  border-radius: 3px 0 0 3px;
}

.sl-unfurl-inner {
  flex: 1;
  background: #222529;
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  border: 1px solid #333;
  border-left: none;
  min-width: 0;
}

.sl-unfurl-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.sl-favicon-img {
  border-radius: 3px;
}

.sl-fav-ph {
  background: #444;
  color: #888;
}

.sl-site {
  font-size: 0.72rem;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sl-title {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: #1d9bd1;
  text-decoration: none;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sl-title:hover {
  text-decoration: underline;
}

.sl-desc {
  font-size: 0.78rem;
  color: #aaa;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.sl-image-wrap {
  width: 100%;
  max-height: 130px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.sl-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sl-img-placeholder {
  height: 80px;
  position: relative;
  border-radius: 6px;
  background: #333;
  color: #666;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .preview-panel {
    column-count: 1;
  }
}

@media (max-width: 900px) {
  .results {
    grid-template-columns: 1fr;
    padding: 0 20px 60px;
  }

  .editor-panel {
    position: static;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .header-inner {
    padding: 12px 20px;
  }

  /* Hide desktop nav, show hamburger */
  .header-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 580px) {
  .hero {
    padding: 56px 20px 36px;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .hero-sub {
    font-size: 0.95rem;
  }

  .platform-pills {
    gap: 6px;
  }

  .search-bar {
    flex-direction: column;
    border-radius: var(--radius);
    padding: 8px;
  }

  .search-bar input {
    padding: 12px;
    width: 100%;
  }

  .search-bar button {
    border-radius: 8px;
    margin: 0;
    width: 100%;
    justify-content: center;
  }

  .search-icon {
    display: none;
  }

  .toast-container {
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: 0;
  }
}