*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ig-orange: #f77737;
  --ig-pink: #e1306c;
  --ig-purple: #833ab4;
  --ig-blue: #405de6;
  --accent: #e1306c;
  --bg-card: rgba(255,255,255,0.97);
  --bg-right: #1a0a2e;
  --text-main: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --input-bg: #fafafa;
}

.app {
  display: flex;
  width: 100%;
  max-width: 980px;
  border-radius: 24px;
  overflow: visible;
  box-shadow: 0 20px 60px rgba(131,58,180,0.25), 0 2px 0 rgba(255,255,255,0.15) inset;
  min-height: 600px;
  flex-shrink: 0;
}

.left {
  background: var(--bg-card);
  flex: 1.1;
  padding: 32px 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: visible;
  border-radius: 24px 0 0 24px;
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--ig-purple), var(--ig-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.25;
}

.sub { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 4px; line-height: 1.5; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  text-transform: uppercase;
  opacity: 0.85;
}

input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: var(--input-bg);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type="number"]::placeholder { color: #b3b6c2; }
input[type="number"]:hover { border-color: #d8dae0; }
input[type="number"]:focus { border-color: var(--ig-pink); background: #fff; box-shadow: 0 0 0 3px rgba(225,48,108,0.10); }

.help { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }

.custom-select-wrapper { position: relative; }

.custom-select-trigger {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: var(--input-bg);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
}
.custom-select-trigger:hover { border-color: #d8dae0; }
.custom-select-trigger:focus,
.custom-select-trigger.open { border-color: var(--ig-pink); background: #fff; box-shadow: 0 0 0 3px rgba(225,48,108,0.10); }

.chevron { display: flex; align-items: center; transition: transform 0.2s; }
.custom-select-trigger.open .chevron { transform: rotate(180deg); }

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 500;
  overflow: hidden;
  display: none;
}
.custom-select-dropdown.open { display: block; }

.custom-select-option {
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.custom-select-option:hover { background: #fdf2f8; }
.custom-select-option.selected { background: #fdf2f8; font-weight: 600; }
.option-check { width: 14px; height: 14px; opacity: 0; flex-shrink: 0; }
.custom-select-option.selected .option-check { opacity: 1; }

.checkbox-row { display: flex; flex-direction: column; gap: 5px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
input[type="checkbox"] { display: none; }
.custom-checkbox {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
input[type="checkbox"]:checked + .custom-checkbox { background: var(--ig-pink); border-color: var(--ig-pink); }
.checkmark-icon { display: flex; align-items: center; }
.checkbox-text { font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.checkbox-help { font-size: 11.5px; color: var(--text-muted); padding-left: 30px; }

.info {
  background: linear-gradient(135deg, #fdf2f8, #f5f3ff);
  border-radius: 14px;
  padding: 14px 18px;
  border: 1px solid #f3e8ff;
}
.info h4 { font-family: 'Syne', sans-serif; font-size: 13.5px; font-weight: 700; color: var(--ig-purple); margin-bottom: 5px; }
.info p.help { color: #4b5563; font-size: 12.5px; line-height: 1.6; margin-top: 0; }

.right {
  background: var(--bg-right);
  width: 340px;
  flex-shrink: 0;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-radius: 0 24px 24px 0;
}
.right::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225,48,108,0.3), transparent 70%);
  pointer-events: none;
}
.right::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(131,58,180,0.25), transparent 70%);
  pointer-events: none;
}

.range-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 10px; }
.range { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; color: #fff; line-height: 1.15; margin-bottom: 14px; word-break: break-word; position: relative; z-index: 1; }

.breakdown-section {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  overflow-y: auto;
}
.platform-compare {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.platform-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.platform-compare-item {
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.platform-compare-icon { display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.platform-compare-name { font-size: 9.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 4px; }
.platform-compare-rate { font-size: 13px; font-weight: 700; color: #fff; }
.platform-compare-active { border: 1px solid rgba(225,48,108,0.5); background: rgba(225,48,108,0.1); }
.breakdown-title { font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.35); margin-bottom: 8px; }
.breakdown-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 12.5px; color: rgba(255,255,255,0.75); }
.breakdown-item:last-child { border-bottom: none; }
.breakdown-item .lbl { font-weight: 400; }
.breakdown-item .val { font-weight: 600; color: #fff; }
.breakdown-item.total-row { margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.15); border-bottom: none; font-size: 13.5px; }
.breakdown-item.total-row .lbl { color: rgba(255,255,255,0.9); font-weight: 600; }
.breakdown-item.total-row .val { color: var(--ig-orange); font-size: 15px; }
#breakdown-placeholder { display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; color: rgba(255,255,255,0.4); font-size: 12.5px; line-height: 1.6; padding: 14px 6px 8px; }
#breakdown-placeholder svg { opacity:0.55; }

/* ── INCOME PROJECTION ── */
.projection-section {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.projection-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 6px;
}
.projection-row:last-child { border-bottom: none; }
.projection-deals { font-size: 11.5px; color: rgba(255,255,255,0.5); flex: 1; }
.projection-monthly { font-size: 12.5px; font-weight: 700; color: #fff; white-space: nowrap; }
.projection-annual { font-size: 12px; font-weight: 700; color: var(--ig-orange); white-space: nowrap; }
.projection-popular { font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 4px; background: rgba(225,48,108,0.25); color: #f9a8d4; margin-left: 4px; letter-spacing: 0.04em; vertical-align: middle; }

/* ── BOOKMARK TOAST ── */
.bookmark-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1a0a2e;
  border: 1px solid rgba(225,48,108,0.4);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  max-width: calc(100vw - 32px);
  width: max-content;
}
.bookmark-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.bookmark-toast-icon { font-size: 20px; flex-shrink: 0; }
.bookmark-toast-text { font-family: 'DM Sans', sans-serif; }
.bookmark-toast-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.bookmark-toast-sub { font-size: 11px; color: rgba(255,255,255,0.5); }
.bookmark-toast-close {
  background: none; border: none; color: rgba(255,255,255,0.4);
  font-size: 18px; cursor: pointer; padding: 0 0 0 8px;
  line-height: 1; flex-shrink: 0;
}
.bookmark-toast-close:hover { color: #fff; }

footer {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
footer a { color: rgba(255,255,255,0.35); text-decoration: none; }
footer a:hover { color: rgba(255,255,255,0.6); }

.sticky-bar { display: none; }

.subniche-wrapper {
  overflow: visible;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  margin-top: 0;
  grid-column: 1 / -1;
  pointer-events: none;
}
.subniche-wrapper.visible { max-height: 300px; opacity: 1; pointer-events: all; }
.subniche-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e1306c, #f77737);
  color: #fff;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.04em;
}

/* ── KEYWORD TRUST BANNER ── */
.trust-banner {
  width: 100%;
  max-width: 980px;
  text-align: center;
  padding: 10px 16px;
  margin: 14px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.05em;
  font-family: 'DM Sans', sans-serif;
}

/* ── MAIN GRID ── */
.main-grid {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
}

/* ── AD SLOTS ──
   Placeholders only — swap the inner content for a real
   <ins class="adsbygoogle"> unit once AdSense is approved.
   Sizes are reserved up front so nothing shifts when ads load. */
.ad-banner {
  width: 100%;
  max-width: 980px;
  min-height: 100px;
  margin: 24px 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 14px;
  color: rgba(255,255,255,0.3);
  font-family: 'DM Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
@media (max-width: 768px) {
  .ad-banner { min-height: 90px; margin: 16px 0; border-radius: 0; }
}

.ad-rail {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  min-height: 600px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 12px;
  color: rgba(255,255,255,0.3);
  font-family: 'DM Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 10;
}
.ad-rail-left { left: 24px; }
.ad-rail-right { right: 24px; }
@media (min-width: 1360px) {
  .ad-rail { display: flex; }
}
/* Placeholders hidden until real ad units replace them — remove this rule when ready to go live with ads */
.ad-banner, .ad-rail { display: none !important; }

/* ── PLATFORM TABS ── */
.content-type-tabs { display:flex; gap:8px; margin-bottom:0; margin-top:0; }
.ct-tab { flex:1; padding:10px 6px; border:1.5px solid var(--border); border-radius:12px; background:#fff; color:var(--text-muted); font-family:'DM Sans',sans-serif; font-size:12.5px; font-weight:700; cursor:pointer; transition:all 0.18s; text-align:center; letter-spacing:0.01em; }
.ct-tab:hover { border-color:#f6a8c4; background:#fdf2f8; color:#e1306c; }
.ct-tab.active { background:linear-gradient(135deg,#e1306c,#f77737); border-color:transparent; color:#fff; box-shadow:0 4px 16px rgba(225,48,108,0.30); }

/* ── BRAND SIZE TABS ── */
.brand-size-tabs { display:flex; gap:8px; margin-top:8px; }
.bs-tab { flex:1; padding:9px 6px; border:1.5px solid var(--border); border-radius:12px; background:#fff; color:var(--text-muted); font-family:'DM Sans',sans-serif; font-size:11.5px; font-weight:700; cursor:pointer; transition:all 0.18s; text-align:center; }
.bs-tab:hover { border-color:#f6a8c4; background:#fdf2f8; color:#e1306c; }
.bs-tab.active { background:linear-gradient(135deg,#e1306c,#f77737); border-color:transparent; color:#fff; box-shadow:0 4px 16px rgba(225,48,108,0.25); }
.bs-tab .bs-sub { display:none; }

/* ── ADVANCED OPTIONS TOGGLE ── */
.advanced-toggle { display:flex; align-items:center; justify-content:center; gap:6px; cursor:pointer; padding:10px 4px; border:none; border-top:1px solid var(--border); margin-top:2px; color:var(--text-muted); font-size:12px; font-weight:600; font-family:'DM Sans',sans-serif; transition:color 0.18s; user-select:none; background:none; }
.advanced-toggle:hover { color:#e1306c; }
.advanced-toggle .adv-chevron { transition:transform 0.2s; opacity:0.6; }
.advanced-toggle.open .adv-chevron { transform:rotate(180deg); }
#advanced-options { display:none; }
#advanced-options.open { display:contents; }


/* ── FAQ SECTION ── */
.faq-section {
  width: 100%;
  max-width: 980px;
  margin: 28px 0 48px;
  font-family: 'DM Sans', sans-serif;
}
.faq-section h2 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  color: #fff;
  margin-bottom: 6px;
  -webkit-text-fill-color: #fff;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}
.faq-section .faq-sub { color: rgba(255,255,255,0.5); font-size: 13px; margin-bottom: 20px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  overflow: hidden;
  transition: background 0.2s;
}
.faq-item:hover { background: rgba(255,255,255,0.10); }
.faq-btn {
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  text-align: left;
  font-weight: 700;
  font-size: 14.5px;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.4;
}
.faq-icon {
  font-size: 22px;
  font-weight: 300;
  flex-shrink: 0;
  color: #f5f3ff;
  transition: transform 0.3s;
  line-height: 1;
  width: 24px;
  text-align: center;
}
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.faq-answer p { font-size: 13.5px; color: rgba(255,255,255,0.65); line-height: 1.75; padding: 0 20px 18px; }
.faq-answer p a { color: #f9a8d4; }

@media (min-width: 769px) {
  #mobile-breakdown { display: none !important; }
}

@media (max-width: 768px) {
  input[type="number"], .custom-select-trigger, select { font-size: 12px !important; }
  .app { flex-direction: column; border-radius: 0; box-shadow: none; min-height: unset; flex-shrink: 0; }
  .right { display: none; }
  .left { padding: 20px 18px 24px; border-radius: 0; }
  .grid { grid-template-columns: 1fr; }
  .sticky-bar {
    display: flex;
    position: fixed;
    top: 0; left: 60px; right: 0;
    z-index: 999;
    background: #1a0a2e;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 10px 18px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
  }
  .sticky-bar .sb-label { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.4); white-space: nowrap; }
  .sticky-bar .sb-rate { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; color: #fff; flex: 1; text-align: center; }
  .sticky-bar .sb-btn { background: linear-gradient(90deg, #e1306c, #f77737); color: #fff; border: none; border-radius: 8px; padding: 8px 14px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
  .tool-row { padding-top: 64px; }
  .trust-banner { margin: 0; padding: 12px 16px; font-size: 11px; }
  .faq-section { margin: 0; padding: 24px 16px 48px; }
  .faq-btn { font-size: 13.5px; padding: 14px 16px; }
  .faq-answer p { padding: 0 16px 16px; font-size: 13px; }
}
