:root {
  --bg:        #0a0c0a;
  --bg2:       #0f120f;
  --surface:   #141a14;
  --surface2:  #1a221a;
  --border:    #222e22;
  --border2:   #2a382a;
  --green:     #6abf69;
  --green-dim: rgba(106,191,105,0.10);
  --green-glow:rgba(106,191,105,0.18);
  --gold:      #c9a84c;
  --red:       #e05555;
  --text:      #e8ede8;
  --text-2:    #8fa08f;
  --text-3:    #7a8c7a;
  --syne: 'Outfit', sans-serif;
  --dm:   'Outfit', sans-serif;
  --mono: 'DM Mono', monospace;
  --radius: 10px;
  --radius-sm: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--dm);
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--dm); }

/* NAV */
nav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(10,12,10,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex; align-items: center;
  padding: 0 2rem; gap: 2rem;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Bebas Neue', var(--syne); font-size: 1.6rem; font-weight: 400;
  letter-spacing: 0.05em; color: var(--text); flex-shrink: 0;
}
.logo-icon { width: 32px; height: 32px; border-radius: 0; background: none; box-shadow: none; display: block; object-fit: contain; flex-shrink: 0; }
.logo span { color: var(--green); }
.logo-tld {
  font-size: 0.7rem; color: var(--text-2); font-family: var(--mono);
  border: 1px solid var(--border); padding: 2px 7px; border-radius: 100px; letter-spacing: 0.04em;
}
.nav-links { display: flex; align-items: center; gap: 0.25rem; list-style: none; flex: 1; }
.nav-links a {
  font-size: 0.82rem; font-weight: 500; color: var(--text-2);
  padding: 6px 12px; border-radius: var(--radius-sm); transition: all 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--green); background: var(--green-dim); }
.btn-primary {
  background: var(--green); border: none; color: #0a0c0a;
  font-size: 0.82rem; font-weight: 700; padding: 8px 18px;
  border-radius: var(--radius-sm); transition: all 0.15s; letter-spacing: 0.01em;
}
.btn-primary:hover { background: #7dd67c; transform: translateY(-1px); box-shadow: 0 4px 20px var(--green-glow); }

/* PAGE HERO */
.portal-hero {
  padding: 4rem 2rem 3rem;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}
.portal-hero::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%; transform: translateX(-50%);
  /* Constrained to the viewport so this decorative glow cannot
     cause horizontal overflow; it previously relied on
     body{overflow-x:hidden} to clip it. */
  width: min(600px, 100vw); height: 400px;
  background: radial-gradient(ellipse at center, rgba(106,191,105,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.portal-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-dim); border: 1px solid rgba(106,191,105,0.25);
  border-radius: 100px; padding: 5px 14px;
  font-size: 0.72rem; font-weight: 500; color: var(--green);
  letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 1.5rem;
}
.portal-hero h1 {
  font-family: var(--syne); font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.02em;
  margin-bottom: 1rem; color: var(--text);
}
.portal-hero h1 span { color: var(--green); }
.portal-hero p {
  font-size: 1rem; color: var(--text-2); font-weight: 300;
  line-height: 1.6; max-width: 520px; margin: 0 auto;
}

/* BENEFITS BAR */
.benefits-bar {
  max-width: 900px; margin: 0 auto 3rem; padding: 0 2rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.benefit-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}

/* Matches .why-icon on the advertise page. Inline SVG rather than emoji:
   emoji render as a different typeface on every platform and carry colour
   that cannot be themed. These inherit currentColor. The card lays out with
   flex `gap`, so the icon takes a smaller margin than its advertise-page
   counterpart to land on the same spacing. */
.benefit-icon { margin-bottom: 0.4rem; color: var(--green); }
.icn { width: 26px; height: 26px; display: block; }
.benefit-title {
  font-family: var(--syne); font-size: 0.95rem; font-weight: 700; color: var(--text);
}
.benefit-desc { font-size: 0.78rem; color: var(--text-2); line-height: 1.6; }

/* MAIN LAYOUT */
.portal-layout {
  max-width: 1000px; margin: 0 auto; padding: 0 2rem 4rem;
  display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start;
}

/* FORM */
.portal-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.form-section-header {
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.form-step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--green-dim); border: 1px solid rgba(106,191,105,0.3);
  color: var(--green); font-family: var(--mono); font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.form-step-title {
  font-family: var(--syne); font-size: 0.88rem; font-weight: 700; color: var(--text);
}
.form-step-sub { font-size: 0.72rem; color: var(--text-2); margin-left: auto; font-family: var(--mono); }

.form-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: span 2; }

.form-label {
  font-family: var(--mono); font-size: 0.65rem; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.form-label span { color: var(--red); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--dm); font-size: 0.88rem;
  padding: 10px 14px; border-radius: var(--radius-sm);
  outline: none; width: 100%; transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none; -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green); box-shadow: 0 0 0 3px rgba(106,191,105,0.12);
}
.form-input::placeholder { color: var(--text-3); }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: '';
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--text-2); pointer-events: none;
}

.form-hint {
  font-size: 0.68rem; color: var(--text-2); margin-top: 2px;
  font-family: var(--mono); line-height: 1.4;
}

.form-divider {
  height: 1px; background: var(--border); margin: 0.25rem 0;
}

/* Feed format tabs */
.feed-tabs {
  display: flex; gap: 0.5rem;
}
.feed-tab {
  flex: 1; background: var(--bg2); border: 1px solid var(--border);
  color: var(--text-2); font-family: var(--mono); font-size: 0.72rem;
  padding: 8px; border-radius: var(--radius-sm); cursor: pointer;
  text-align: center; transition: all 0.15s; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.feed-tab:hover { border-color: var(--border2); color: var(--text); }
.feed-tab.active { background: var(--green-dim); border-color: rgba(106,191,105,0.4); color: var(--green); }

/* Checkbox */
.form-check {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px;
  accent-color: var(--green); cursor: pointer;
}
.form-check-label { font-size: 0.78rem; color: var(--text-2); line-height: 1.5; }
.form-check-label a { color: var(--green); }

/* Submit */
.form-submit {
  background: var(--green); border: none; color: #0a0c0a;
  font-family: var(--syne); font-size: 1rem; font-weight: 800;
  padding: 14px; border-radius: var(--radius-sm); width: 100%;
  cursor: pointer; transition: all 0.15s; letter-spacing: 0.01em;
}
.form-submit:hover {
  background: #7dd67c; transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--green-glow);
}
.form-submit:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none;
}

/* Success state */
.success-state {
  display: none; padding: 3rem 1.5rem; text-align: center;
}
.success-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green-dim); border: 1px solid rgba(106,191,105,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin: 0 auto 1rem;
}
.success-title {
  font-family: var(--syne); font-size: 1.4rem; font-weight: 800;
  color: var(--text); margin-bottom: 0.5rem;
}
.success-sub { font-size: 0.85rem; color: var(--text-2); line-height: 1.6; max-width: 360px; margin: 0 auto 1.5rem; }
.success-details {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem; text-align: left;
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-2);
  max-width: 360px; margin: 0 auto; line-height: 2;
}
.success-details strong { color: var(--green); }

/* SIDEBAR */
.portal-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.sidebar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.sidebar-head {
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
  font-family: var(--syne); font-size: 0.82rem; font-weight: 700; color: var(--text);
}

/* Feed schema reference */
.schema-table { width: 100%; border-collapse: collapse; }
.schema-table th {
  background: var(--bg); font-family: var(--mono); font-size: 0.6rem;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-2);
  padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border);
}
.schema-table td {
  padding: 0.5rem 0.75rem; font-family: var(--mono); font-size: 0.7rem;
  border-bottom: 1px solid rgba(34,46,34,0.5); vertical-align: top;
}
.schema-table tr:last-child td { border-bottom: none; }
.schema-field { color: var(--green); }
.schema-type { color: var(--text-2); }
.schema-req { color: var(--red); font-size: 0.6rem; }
.schema-opt { color: var(--text-3); font-size: 0.6rem; }

/* Ad tiers */
.ad-tier {
  padding: 1rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.ad-tier:last-child { border-bottom: none; }
.ad-tier-name { font-weight: 600; font-size: 0.85rem; color: var(--text); }
.ad-tier-desc { font-size: 0.72rem; color: var(--text-2); margin-top: 2px; }
.ad-tier-price {
  font-family: var(--syne); font-size: 1rem; font-weight: 700;
  color: var(--green); white-space: nowrap; flex-shrink: 0;
}
.ad-tier-price small { font-size: 0.6rem; color: var(--text-2); display: block; text-align: right; font-family: var(--mono); }

/* FAQ */
.faq-item {
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background 0.12s;
}
.faq-item:last-child { border-bottom: none; }
.faq-item:hover { background: var(--surface2); }
.faq-q {
  font-size: 0.82rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.faq-chevron { color: var(--text-2); font-size: 0.7rem; transition: transform 0.2s; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a {
  font-size: 0.75rem; color: var(--text-2); line-height: 1.6;
  margin-top: 0.5rem; display: none;
}
.faq-item.open .faq-a { display: block; }

/* Contact card */
.contact-card {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(106,191,105,0.06) 100%);
  border: 1px solid rgba(106,191,105,0.2); border-radius: var(--radius);
  padding: 1.25rem; text-align: center;
}
.contact-title { font-family: var(--syne); font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.contact-sub { font-size: 0.75rem; color: var(--text-2); margin-bottom: 1rem; line-height: 1.5; }
.contact-btn {
  background: none; border: 1px solid var(--green); color: var(--green);
  font-family: var(--syne); font-size: 0.82rem; font-weight: 700;
  padding: 9px 20px; border-radius: var(--radius-sm); width: 100%;
  cursor: pointer; transition: all 0.12s;
}
.contact-btn:hover { background: var(--green-dim); }

/* Sample CSV */
.code-block {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.85rem;
  font-family: var(--mono); font-size: 0.65rem; color: var(--text-2);
  line-height: 1.8; overflow-x: auto; white-space: pre;
}
.code-block .hl { color: var(--green); }

/* Progress steps */
.steps {
  display: flex; flex-direction: column; gap: 0;
}
.step-item {
  display: flex; gap: 1rem; padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border); align-items: flex-start;
}
.step-item:last-child { border-bottom: none; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--green-dim); border: 1px solid rgba(106,191,105,0.3);
  color: var(--green); font-family: var(--mono); font-size: 0.65rem;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.step-text { font-size: 0.78rem; color: var(--text-2); line-height: 1.5; }
.step-text strong { color: var(--text); display: block; margin-bottom: 2px; }

/* FOOTER */
footer {
  border-top: 1px solid var(--border); padding: 2rem;
  text-align: center; font-family: var(--mono);
  font-size: 0.65rem; color: var(--text-3); letter-spacing: 0.05em;
}
footer a { color: var(--text-2); }
footer a:hover { color: var(--green); }
.footer-links { display: flex; gap: 2rem; justify-content: center; margin-bottom: 1rem; flex-wrap: wrap; }

@media (max-width: 900px) {
  .portal-layout { grid-template-columns: 1fr; }
  .benefits-bar { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-group.full { grid-column: span 1; }
  nav .nav-links { display: none; }
}

@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Converted from inline style="" attributes for CSP style-src */
.hidden { display: none; }
.manual-feed-note { font-size: 0.78rem; color: var(--text-2); padding: 0.85rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); line-height: 1.6; }
.text-green { color: var(--green); }
.text-gold { color: var(--gold); }
.submit-hint { text-align: center; font-family: var(--mono); font-size: 0.65rem; color: var(--text-3); margin-top: 0.25rem; }
.pad-085 { padding: 0.85rem; }
.mt-05 { margin-top: 0.5rem; }


/* ============================================================
   ACCESSIBILITY (WCAG 2.1 AA)
   ============================================================ */

/* 2.4.7 Focus Visible — the palette previously styled :focus on form
   inputs only, leaving buttons, links and the role="button" elements with
   no visible keyboard indicator at all. */
:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
  border-radius: 3px;
}

/* 2.4.1 Bypass Blocks — lets keyboard/screen-reader users skip the nav. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--green);
  color: #0a0c0a;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 0 0 6px 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* role="button" elements should look interactive */
[role="button"] { cursor: pointer; }

/* 2.3.3 / prefers-reduced-motion — honour the OS setting. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   MOBILE NAV
   The nav links were display:none below the breakpoint with no
   replacement, and .nav-right overflowed narrow viewports (clipped by
   body{overflow-x:hidden}, so the buttons were unreachable rather than
   merely off-screen).
   ============================================================ */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  min-width: 44px;
  min-height: 44px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: sticky;
  top: 64px;
  z-index: 199;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}
.mobile-nav.open { max-height: 70vh; overflow-y: auto; }

.mobile-nav-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;          /* comfortable touch target */
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.mobile-nav-link:hover { background: var(--surface2); }
.mobile-nav-link.active { color: var(--green); background: var(--green-dim); }
.mobile-nav-action { color: var(--green); }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .mobile-nav { display: flex; }
  /* The desktop action buttons are represented inside the panel instead. */
  nav .nav-right { display: none; }
  nav { padding: 0 1rem; gap: 0.75rem; }
}


/* ============================================================
   SMALL PHONES (<=480px)
   The smallest breakpoint on most pages was 600-800px, so on a 375-430px
   handset two-column grids stayed two-column and content was cramped.
   ============================================================ */
@media (max-width: 480px) {
  nav { padding: 0 0.75rem; gap: 0.5rem; }
  .logo { font-size: 1.15rem; }
  .logo-tld { display: none; }
}

/* Comfortable touch targets on touch devices (WCAG 2.5.5 / 2.5.8).
   Buttons were ~30px tall from padding alone. Scoped to coarse pointers
   so the desktop layout is untouched. */
@media (pointer: coarse) {
  button, .btn-ghost, .btn-primary, .cat-tab, .filter-chip, .quick-chip,
  .feed-tab, .chart-tab, .save-btn, .danger-btn, .submit-btn, .placement-btn {
    min-height: 44px;
  }
  input, select, textarea, .form-input, .form-select, .field-select {
    min-height: 44px;
    font-size: 16px;   /* iOS zooms the page for anything under 16px */
  }
}

@media (max-width: 480px) {
  .benefits-bar { grid-template-columns: 1fr; padding-left: 1rem; padding-right: 1rem; }
  .portal-layout { padding-left: 1rem; padding-right: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .feed-tabs { flex-wrap: wrap; }
  .feed-tab { flex: 1 1 45%; }
}


/* Long unbreakable strings (product URLs, feed URLs, emails) must not push
   the layout wider than the viewport. Previously body{overflow-x:hidden}
   would have quietly clipped them; that mask has been removed now that the
   decorative glows are viewport-constrained. */
body { overflow-wrap: break-word; }
td, .card-product, .card-retailer, .search-item-detail,
.retailer-detail-meta, .deal-desc, .session-device { overflow-wrap: anywhere; }
table { max-width: 100%; }
img, canvas, svg { max-width: 100%; height: auto; }


/* ============================================================
   FOOTER
   Appended last so it overrides whatever this sheet defined earlier --
   every page used to carry its own footer, and they had drifted into
   five different layouts with four different disclaimers.
============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem 2rem;
  text-align: left;
  font-family: var(--dm, var(--syne));
  font-size: 1rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto 2.5rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-logo-size { font-size: 1.15rem; }
.footer-brand-desc {
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-top: 0.75rem;
  max-width: 220px;
}
.footer-col-title {
  font-family: var(--syne);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}
.footer-links-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding: 0; }
.footer-links-list a { font-size: 0.78rem; color: var(--text-2); transition: color 0.12s; }
.footer-links-list a:hover { color: var(--green); }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.footer-copy { font-size: 0.72rem; color: var(--text-3); font-family: var(--mono); flex-shrink: 0; }
.footer-disclaimer { font-size: 0.68rem; color: var(--text-3); max-width: 500px; line-height: 1.5; text-align: left; }
.footer-disclaimer strong { color: var(--text-2); }
.footer-disclaimer a { color: var(--text-2); text-decoration: underline; }

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 560px) {
  footer { padding: 2rem 1rem 1.5rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}
