@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap");

:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e7ecf3;
  --primary: #1769e0;
  --primary-dark: #0f56c4;
  --primary-soft: #edf5ff;
  --ok: #0f8a4b;
  --bad: #c73535;
  --danger: #b42318;
  --danger-soft: #fff1f0;
}

/* Final unified page polish overrides */
body {
  background: #ffffff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 16px 28px;
  background: #1769e0;
  box-shadow: 0 1px 0 rgba(15, 35, 72, .08);
}

.topbar h1 {
  font-size: 22px;
}

.top-actions {
  gap: 10px;
}

.nav-tabs {
  background: rgba(255, 255, 255, .16);
  border-radius: 7px;
}

.tab-button {
  min-height: 36px;
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 14px;
}

.layout {
  max-width: 1320px;
  gap: 18px;
  padding: 22px 28px 42px;
}

.panel {
  gap: 14px;
  padding: 18px;
  border-color: #dfe7f1;
  border-radius: 8px;
  box-shadow: none;
}

.panel h2 {
  color: #0f172a;
  font-size: 16px;
}

.hint {
  margin-top: 6px;
  color: #5f6f86;
  font-size: 14px;
}

.status-card,
.draft-item,
.list-item,
.search-result-item,
.empty-state,
pre {
  background: #ffffff;
  border-color: #dfe7f1;
  box-shadow: none;
}

label {
  gap: 6px;
  color: #344054;
  font-size: 13px;
}

input,
textarea,
select {
  min-height: 40px;
  border-color: #d7e0ec;
  border-radius: 6px;
  padding: 9px 11px;
  background: #ffffff;
  font-size: 14px;
}

textarea {
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #1769e0;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, .10);
}

button,
.button-link {
  min-height: 38px;
  border-radius: 6px;
  padding: 9px 14px;
  box-shadow: none;
}

button:hover,
.button-link:hover {
  box-shadow: none;
  transform: none;
}

button.secondary {
  border-color: #c9d8ec;
  background: #ffffff;
}

button.secondary:hover {
  background: #f5f9ff;
}

button.danger {
  background: #fff5f5;
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.status-card {
  padding: 12px 14px;
  border-radius: 7px;
}

.form-row,
.equal-row,
.three-cols {
  gap: 14px;
}

.save-panel,
.list-tools {
  align-items: center;
}

.list-tools {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 400px);
}

.list-tools .hint {
  max-width: 760px;
}

#apiPage {
  max-width: 1180px;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
}

#apiPage .google-ads-card {
  align-self: stretch;
}

#apiPage .save-panel {
  grid-column: 1 / -1;
}

.launch-layout {
  max-width: 1320px;
  grid-template-columns: minmax(620px, 1.35fr) minmax(360px, .85fr);
}

.launch-form-panel,
.ai-brief-panel,
.traffic-form-panel {
  padding: 20px;
}

.sheet-target-panel,
.draft-panel {
  padding: 16px;
}

.ai-ads-layout {
  max-width: 1120px;
}

.ai-result-grid {
  gap: 12px;
}

.traffic-layout {
  max-width: 1320px;
  grid-template-columns: minmax(360px, .8fr) minmax(620px, 1.2fr);
}

.table-wrap {
  border-color: #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  background: #f5f8fc;
  color: #25364d;
  font-size: 12px;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom-color: #e8eef6;
}

.data-table tbody tr:hover {
  background: #f9fbfe;
}

.empty-cell {
  background: #ffffff;
}

.config-message {
  font-size: 13px;
}

.pass-badge,
.fail-badge {
  border-radius: 6px;
}

.cashback-page {
  background: #ffffff;
}

.cashback-page .merchant-crawl-panel {
  box-shadow: none;
  border-color: #dfe7f1;
}

.cashback-page .list-tools h2 {
  font-size: 22px;
}

.cashback-page #crawlMerchantDomains {
  background: #1769e0;
}

.cashback-page #crawlMerchantDomains:hover {
  background: #0f56c4;
}

.auth-overlay {
  overflow: hidden;
  background: #ffffff;
  isolation: isolate;
}

.auth-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, #ffffff 0%, rgba(255, 255, 255, .82) 48%, rgba(255, 255, 255, .12) 100%);
  pointer-events: none;
}

.auth-video-wrap {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 0;
  width: 80%;
  height: 80%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  pointer-events: none;
}

.auth-video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.auth-card {
  position: relative;
  z-index: 2;
  align-self: flex-end;
  margin-bottom: 28px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-copy h1 {
  font-weight: 300;
  letter-spacing: -.03em;
}

.auth-panel {
  background: #ffffff;
}

@media (min-width: 768px) {
  .auth-video-wrap {
    width: 100%;
    height: 100%;
  }

  .auth-card {
    margin-bottom: 42px;
  }
}

@media (max-width: 860px) {
  .topbar {
    position: static;
    padding: 18px;
  }

  .layout {
    padding: 16px;
  }

  .panel {
    padding: 16px;
  }

  .list-tools,
  .save-panel {
    gap: 12px;
  }
}

/* Final product-design override: keep this block last. */
body {
  background:
    radial-gradient(circle at 82% 0%, rgba(0, 0, 0, .045), transparent 28rem),
    linear-gradient(180deg, #fff 0%, #fbfbfc 48%, #fff 100%);
  color: #050505;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 18px 32px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(0, 0, 0, .1);
  box-shadow: none;
  color: #050505;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #050505;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.03em;
  white-space: nowrap;
}

.topbar h1::before {
  content: "";
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  background:
    linear-gradient(145deg, #000 0 45%, transparent 46%),
    linear-gradient(35deg, transparent 0 26%, #000 27% 72%, transparent 73%);
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 5px 38px;
  color: rgba(0, 0, 0, .38);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.top-actions {
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  background: #f4f4f6;
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 999px;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(0, 0, 0, .62);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tab-button.active,
.tab-button.active:hover {
  background: #050505;
  color: #fff;
}

.tab-button:hover {
  background: rgba(0, 0, 0, .05);
  color: #050505;
}

.layout {
  width: min(100% - 48px, 1360px);
  margin: 0 auto;
  padding: 26px 0 52px;
  gap: 18px;
}

.panel,
.auth-card,
.status-card,
.draft-item,
.list-item,
.search-result-item,
.empty-state,
pre {
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 10px;
  box-shadow: none;
}

.panel {
  padding: 20px;
  gap: 15px;
}

.panel h2,
.output-header h2 {
  color: #050505;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.hint,
.field-hint,
.config-message {
  color: rgba(0, 0, 0, .58);
  font-size: 13px;
  line-height: 1.55;
}

label {
  color: rgba(0, 0, 0, .68);
  font-size: 12px;
  font-weight: 600;
}

input,
textarea,
select {
  min-height: 40px;
  width: 100%;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 8px;
  background: #fff;
  color: #050505;
  font: 400 14px/1.45 "Inter", system-ui, sans-serif;
  box-shadow: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(0, 0, 0, .38);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .08);
}

button,
.button-link {
  min-height: 38px;
  border: 1px solid #050505;
  border-radius: 999px;
  background: #050505;
  color: #fff;
  font: 500 13px/1 "Inter", system-ui, sans-serif;
  box-shadow: none;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

button.secondary,
.topbar .secondary {
  border-color: rgba(0, 0, 0, .18);
  background: #fff;
  color: #050505;
}

button.secondary:hover,
.topbar .secondary:hover {
  background: #f4f4f6;
}

button.danger {
  border-color: rgba(177, 18, 38, .28);
  background: #fff;
  color: #b11226;
}

button.danger:hover {
  background: #fff4f5;
}

.count-badge,
.pass-badge,
.fail-badge {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.pass-badge {
  background: rgba(0, 122, 77, .08);
  color: #007a4d;
}

.fail-badge {
  background: rgba(177, 18, 38, .08);
  color: #b11226;
}

#apiPage {
  max-width: 1180px;
  grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr);
  align-items: start;
}

#apiPage .status-panel,
#apiPage .save-panel {
  grid-column: 1 / -1;
}

#apiPage .semrush-card,
#apiPage .gemini-card {
  grid-column: 1;
}

#apiPage .google-ads-card {
  grid-column: 2;
  grid-row: 2 / span 2;
  align-self: stretch;
}

.list-entry-row {
  width: min(100% - 48px, 1360px);
  margin: 0 auto;
  grid-template-columns: minmax(420px, .8fr) minmax(440px, 1.2fr);
  gap: 18px;
}

.launch-layout {
  max-width: 1360px;
  grid-template-columns: minmax(620px, 1.2fr) minmax(380px, .8fr);
}

.launch-layout .list-tools,
.ai-ads-layout .list-tools,
.traffic-layout .list-tools,
.merchant-layout .list-tools {
  grid-column: 1 / -1;
}

.ai-ads-layout {
  max-width: 1280px;
  grid-template-columns: minmax(560px, 1fr) minmax(420px, .95fr);
  align-items: start;
}

.ai-brief-panel {
  grid-column: 1;
}

.ai-result-panel,
.ai-draft-panel {
  grid-column: 2;
}

.traffic-layout {
  max-width: 1360px;
  grid-template-columns: minmax(360px, .76fr) minmax(640px, 1.24fr);
  align-items: start;
}

.merchant-layout {
  max-width: 1280px;
}

.cashback-page {
  background: transparent;
}

.cashback-page .list-tools h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -.045em;
}

.cashback-page #crawlMerchantDomains {
  border-color: #b11226;
  background: #b11226;
}

.cashback-page #crawlMerchantDomains:hover {
  background: #8f0f1f;
}

.merchant-hidden-controls {
  display: none;
}

.table-wrap {
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 10px;
  background: #fff;
}

.data-table th {
  background: #f1f2f4;
  color: rgba(0, 0, 0, .72);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom-color: rgba(0, 0, 0, .07);
}

.data-table tbody tr:hover {
  background: #fafafa;
}

.auth-overlay {
  background: #fff;
}

.auth-overlay::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 58%;
  z-index: 1;
  background: linear-gradient(to top, #fff 0%, rgba(255, 255, 255, .86) 54%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.auth-video-wrap {
  position: absolute;
  inset: 10%;
  z-index: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.auth-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: min(100%, 980px);
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 390px);
  gap: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.auth-copy {
  min-height: 420px;
  justify-content: flex-end;
  padding: 24px;
}

.auth-copy .eyebrow {
  margin-left: 0;
}

.auth-copy h1 {
  color: #050505;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  font-weight: 300;
  letter-spacing: -.05em;
  line-height: .98;
}

.auth-tabs {
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f4f4f6;
}

.auth-tabs button {
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, .58);
}

.auth-tabs button.active {
  background: #050505;
  color: #fff;
}

@media (max-width: 980px) {
  .topbar,
  #apiPage,
  .launch-layout,
  .ai-ads-layout,
  .traffic-layout,
  .list-entry-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 16px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    overflow: hidden;
  }

  .nav-tabs {
    flex: 1 1 auto;
  }

  .layout,
  .list-entry-row {
    width: min(100% - 28px, 1360px);
  }

  #apiPage .semrush-card,
  #apiPage .gemini-card,
  #apiPage .google-ads-card,
  #apiPage .status-panel,
  #apiPage .save-panel,
  .ai-brief-panel,
  .ai-result-panel,
  .ai-draft-panel {
    grid-column: 1;
    grid-row: auto;
  }

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

@media (max-width: 640px) {
  .topbar h1 {
    white-space: normal;
  }

  .eyebrow {
    margin-left: 0;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  button,
  .button-link {
    width: 100%;
  }
}

/* Product-design pass: white operations console */
:root {
  --ink: #050505;
  --ink-soft: rgba(0, 0, 0, .58);
  --ink-faint: rgba(0, 0, 0, .38);
  --paper: #ffffff;
  --paper-soft: #f4f4f6;
  --paper-warm: #fafafa;
  --line-soft: rgba(0, 0, 0, .1);
  --line-strong: rgba(0, 0, 0, .18);
  --focus: rgba(0, 0, 0, .08);
  --success: #007a4d;
  --danger: #b11226;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% 8%, rgba(0, 0, 0, .045), transparent 26rem),
    linear-gradient(180deg, #ffffff 0%, #fbfbfc 48%, #ffffff 100%);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 18px 32px;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: none;
  color: var(--ink);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.05;
  white-space: nowrap;
}

.topbar h1::before {
  content: "";
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  background:
    linear-gradient(145deg, #000 0 45%, transparent 46%),
    linear-gradient(35deg, transparent 0 26%, #000 27% 72%, transparent 73%);
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 5px 38px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  background: var(--paper-soft);
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 999px;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(0, 0, 0, .6);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tab-button:hover {
  background: rgba(0, 0, 0, .05);
  color: var(--ink);
}

.tab-button.active {
  background: var(--ink);
  color: #fff;
}

.layout {
  width: min(100% - 48px, 1360px);
  margin: 0 auto;
  padding: 26px 0 52px;
  gap: 18px;
}

.panel,
.auth-card,
.status-card,
.draft-item,
.list-item,
.search-result-item,
.empty-state,
pre {
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: none;
}

.panel {
  padding: 20px;
  gap: 15px;
}

.panel h2,
.output-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.hint,
.field-hint,
.config-message {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

label {
  color: rgba(0, 0, 0, .68);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}

input,
textarea,
select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 400 14px/1.45 "Inter", system-ui, sans-serif;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(0, 0, 0, .34);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(0, 0, 0, .38);
  box-shadow: 0 0 0 4px var(--focus);
}

button,
.button-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: 500 13px/1 "Inter", system-ui, sans-serif;
  text-decoration: none;
  box-shadow: none;
  transition: transform .14s ease, background .14s ease, border-color .14s ease, color .14s ease;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

button.secondary,
.topbar .secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}

button.secondary:hover,
.topbar .secondary:hover {
  background: var(--paper-soft);
}

button.danger {
  border-color: rgba(177, 18, 38, .28);
  background: #fff;
  color: var(--danger);
}

button.danger:hover {
  background: #fff4f5;
}

button:disabled,
.button-link:disabled {
  cursor: not-allowed;
  opacity: .45;
  transform: none;
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.status-card {
  padding: 14px;
}

.status-card strong,
.list-title {
  color: var(--ink);
  font-weight: 600;
}

.pass-badge,
.fail-badge,
.count-badge {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.pass-badge {
  background: rgba(0, 122, 77, .08);
  color: var(--success);
}

.fail-badge {
  background: rgba(177, 18, 38, .08);
  color: var(--danger);
}

.count-badge {
  border: 1px solid var(--line-soft);
  background: var(--paper-soft);
  color: rgba(0, 0, 0, .62);
}

#apiPage {
  max-width: 1180px;
  grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr);
  align-items: start;
}

#apiPage .status-panel,
#apiPage .save-panel {
  grid-column: 1 / -1;
}

#apiPage .semrush-card,
#apiPage .gemini-card {
  grid-column: 1;
}

#apiPage .google-ads-card {
  grid-column: 2;
  grid-row: 2 / span 2;
  align-self: stretch;
}

.list-entry-row {
  width: min(100% - 48px, 1360px);
  margin: 0 auto;
  grid-template-columns: minmax(420px, .8fr) minmax(440px, 1.2fr);
  gap: 18px;
}

.list-tools,
.save-panel {
  align-items: center;
}

.launch-layout {
  max-width: 1360px;
  grid-template-columns: minmax(620px, 1.2fr) minmax(380px, .8fr);
}

.launch-layout .list-tools,
.ai-ads-layout .list-tools,
.traffic-layout .list-tools,
.merchant-layout .list-tools {
  grid-column: 1 / -1;
}

.sheet-target-panel,
.draft-panel {
  padding: 18px;
}

.draft-actions,
.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-ads-layout {
  max-width: 1280px;
  grid-template-columns: minmax(560px, 1fr) minmax(420px, .95fr);
  align-items: start;
}

.ai-brief-panel {
  grid-column: 1;
}

.ai-result-panel,
.ai-draft-panel {
  grid-column: 2;
}

.traffic-layout {
  max-width: 1360px;
  grid-template-columns: minmax(360px, .76fr) minmax(640px, 1.24fr);
  align-items: start;
}

.merchant-layout {
  max-width: 1280px;
}

.cashback-page {
  background: transparent;
}

.cashback-page .list-tools h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -.045em;
}

.cashback-page .merchant-crawl-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  border-color: var(--line-soft);
  box-shadow: none;
}

.cashback-page #crawlMerchantDomains {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.cashback-page #crawlMerchantDomains:hover {
  background: #8f0f1f;
}

.merchant-hidden-controls {
  display: none;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f2f4;
  color: rgba(0, 0, 0, .72);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, .07);
}

.data-table tbody tr:hover {
  background: #fafafa;
}

.empty-cell {
  background: #fff;
  color: var(--ink-faint);
  text-align: center;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
  background: #fff;
}

.auth-overlay.hidden {
  display: none;
}

.auth-overlay::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 58%;
  z-index: 1;
  background: linear-gradient(to top, #fff 0%, rgba(255, 255, 255, .86) 54%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.auth-video-wrap {
  position: absolute;
  inset: 10%;
  z-index: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: .95;
}

.auth-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.9) contrast(1.04);
}

.auth-card {
  position: relative;
  z-index: 2;
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 390px);
  gap: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.auth-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 420px;
  padding: 24px;
}

.auth-copy .eyebrow {
  margin-left: 0;
}

.auth-copy h1 {
  max-width: 620px;
  margin: 0 0 16px;
  color: var(--ink);
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  font-weight: 300;
  letter-spacing: -.05em;
  line-height: .98;
}

.auth-copy p {
  max-width: 520px;
  color: rgba(0, 0, 0, .62);
  line-height: 1.65;
}

.auth-panel {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper-soft);
}

.auth-tabs button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, .58);
}

.auth-tabs button.active {
  background: var(--ink);
  color: #fff;
}

.auth-status {
  min-height: 22px;
  color: var(--ink-soft);
  font-size: 13px;
}

.auth-status.bad {
  color: var(--danger);
}

.auth-status.good {
  color: var(--success);
}

.license-box {
  border-color: var(--line-soft);
  background: var(--paper-warm);
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 16px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    overflow: hidden;
  }

  .nav-tabs {
    flex: 1 1 auto;
  }

  .layout,
  .list-entry-row {
    width: min(100% - 28px, 1360px);
  }

  #apiPage,
  .launch-layout,
  .ai-ads-layout,
  .traffic-layout,
  .list-entry-row {
    grid-template-columns: 1fr;
  }

  #apiPage .semrush-card,
  #apiPage .gemini-card,
  #apiPage .google-ads-card,
  #apiPage .status-panel,
  #apiPage .save-panel,
  .ai-brief-panel,
  .ai-result-panel,
  .ai-draft-panel {
    grid-column: 1;
    grid-row: auto;
  }

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

  .auth-copy {
    min-height: 260px;
    padding: 8px;
  }

  .auth-video-wrap {
    inset: 10%;
  }
}

@media (max-width: 640px) {
  .topbar h1 {
    white-space: normal;
  }

  .eyebrow {
    margin-left: 0;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .auth-logout,
  #refreshHealth {
    flex: 1 1 140px;
  }

  .panel {
    padding: 16px;
  }

  button,
  .button-link {
    width: 100%;
  }

  .draft-actions button,
  .ai-actions button {
    flex: 1 1 100%;
  }
}

/* Frontend-design system: minimal hero-inspired dashboard skin */
:root {
  --ink: #050505;
  --ink-soft: rgba(0, 0, 0, .58);
  --surface: #ffffff;
  --surface-soft: #f4f4f6;
  --stroke: rgba(0, 0, 0, .12);
  --stroke-strong: rgba(0, 0, 0, .22);
  --focus-ring: rgba(0, 0, 0, .08);
}

body {
  background: #ffffff;
  color: var(--ink);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  border-bottom: 1px solid var(--stroke);
  box-shadow: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar > div:first-child {
  min-width: 230px;
}

.topbar h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.topbar h1::before {
  content: "";
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  background-image: url("data:image/svg+xml,%3Csvg width='34' height='34' viewBox='0 0 34 34' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='8' y='6' width='8' height='23' rx='4' transform='rotate(-35 12 17.5)' fill='black'/%3E%3Crect x='18' y='5' width='8' height='25' rx='4' transform='rotate(-35 22 17.5)' fill='black'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.eyebrow {
  margin: 0 0 4px 38px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 999px;
}

.tab-button {
  min-height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: transparent;
  color: rgba(0, 0, 0, .62);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.tab-button:hover {
  background: #ffffff;
  color: #000000;
}

.tab-button.active {
  background: #000000;
  color: #ffffff;
}

.topbar .secondary {
  min-height: 34px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-size: 12px;
  font-weight: 500;
}

.topbar .secondary:hover {
  border-color: var(--stroke-strong);
  background: #ffffff;
}

.layout {
  width: min(1360px, 100%);
  max-width: 1360px;
  gap: 18px;
  padding: 24px 28px 48px;
}

.page.active {
  animation: pageIn .36s cubic-bezier(.16, 1, .3, 1);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel {
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
}

.panel h2 {
  color: #000000;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.hint,
.field-hint,
.list-meta,
.list-item p,
.search-result-item span,
.search-result-item p {
  color: var(--ink-soft);
}

.status-card,
.draft-item,
.list-item,
.search-result-item,
.empty-state,
pre {
  border-color: var(--stroke);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
}

.status-card {
  padding: 14px;
}

.status-card strong,
.list-title,
.search-result-item strong {
  color: #000000;
  font-weight: 600;
}

label {
  color: rgba(0, 0, 0, .68);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.01em;
}

input,
textarea,
select {
  min-height: 40px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  font-size: 14px;
}

input::placeholder,
textarea::placeholder {
  color: rgba(0, 0, 0, .38);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(0, 0, 0, .42);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

button,
.button-link {
  min-height: 38px;
  border-radius: 999px;
  background: #000000;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

button:hover,
.button-link:hover {
  background: #000000;
  box-shadow: none;
  transform: none;
}

button.secondary,
.button-link.secondary {
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: #000000;
}

button.secondary:hover,
.button-link.secondary:hover {
  border-color: var(--stroke-strong);
  background: #ffffff;
}

button.danger {
  border: 1px solid rgba(180, 35, 24, .22);
  background: #fff7f7;
  color: #b42318;
}

button.small {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 12px;
}

.config-message {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.ok {
  color: #087443;
}

.bad {
  color: #b42318;
}

.table-wrap {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: #ffffff;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  background: #f4f4f6;
  color: rgba(0, 0, 0, .74);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  border-bottom-color: rgba(0, 0, 0, .08);
}

.data-table tbody tr:hover {
  background: rgba(0, 0, 0, .025);
}

.pass-badge,
.fail-badge,
.count-badge {
  border-radius: 999px;
  font-weight: 600;
}

.count-badge {
  background: #f4f4f6;
  color: #000000;
}

#apiPage {
  max-width: 1180px;
}

.launch-layout,
.traffic-layout {
  max-width: 1360px;
}

.ai-ads-layout {
  max-width: 1120px;
}

.cashback-page {
  background: #ffffff;
}

.cashback-page .list-tools h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.cashback-page .merchant-crawl-panel {
  border-color: var(--stroke);
  box-shadow: none;
}

.cashback-page #crawlMerchantDomains {
  background: #000000;
  color: #ffffff;
}

.cashback-page #crawlMerchantDomains:hover {
  background: #000000;
}

.auth-overlay {
  background: #ffffff;
}

.auth-overlay::after {
  background: linear-gradient(to top, #ffffff 0%, rgba(255, 255, 255, .86) 50%, rgba(255, 255, 255, .18) 100%);
}

.auth-card {
  border-color: var(--stroke);
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
  box-shadow: none;
}

.auth-tabs {
  border-radius: 999px;
  background: #f4f4f6;
}

.auth-tabs button {
  border-radius: 999px;
  color: rgba(0, 0, 0, .64);
}

.auth-tabs button.active {
  background: #000000;
  color: #ffffff;
  box-shadow: none;
}

#authSubmit {
  background: #000000;
}

@media (max-width: 860px) {
  .topbar {
    position: static;
    align-items: stretch;
    padding: 16px;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .eyebrow {
    margin-left: 38px;
  }

  .top-actions,
  .nav-tabs {
    width: 100%;
  }

  .nav-tabs {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .tab-button {
    flex: 0 0 auto;
  }

  .layout {
    padding: 16px;
  }
}

/* Unified white workspace polish */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --line: #dfe7f1;
  --muted: #5f6f86;
  --text: #111827;
  --primary: #1769e0;
  --primary-dark: #0f56c4;
  --primary-soft: #eef5ff;
}

body {
  background: #ffffff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 16px 28px;
  background: #1769e0;
  box-shadow: 0 1px 0 rgba(15, 35, 72, .08);
}

.topbar h1 {
  font-size: 22px;
}

.eyebrow {
  margin-bottom: 4px;
  font-size: 12px;
}

.top-actions {
  gap: 10px;
}

.nav-tabs {
  background: rgba(255, 255, 255, .16);
  border-radius: 7px;
}

.tab-button {
  min-height: 36px;
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 14px;
}

.layout {
  max-width: 1320px;
  gap: 18px;
  padding: 22px 28px 42px;
}

.panel {
  gap: 14px;
  padding: 18px;
  border-color: #dfe7f1;
  border-radius: 8px;
  box-shadow: none;
}

.panel h2 {
  color: #0f172a;
  font-size: 16px;
}

.hint {
  margin-top: 6px;
  color: #5f6f86;
  font-size: 14px;
}

.status-card,
.draft-item,
.search-result-item,
.empty-state,
pre {
  background: #ffffff;
  border-color: #dfe7f1;
  box-shadow: none;
}

label {
  gap: 6px;
  color: #344054;
  font-size: 13px;
}

input,
textarea,
select {
  min-height: 40px;
  border-color: #d7e0ec;
  border-radius: 6px;
  padding: 9px 11px;
  background: #ffffff;
  font-size: 14px;
}

textarea {
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #1769e0;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, .10);
}

button,
.button-link {
  min-height: 38px;
  border-radius: 6px;
  padding: 9px 14px;
  box-shadow: none;
}

button:hover,
.button-link:hover {
  box-shadow: none;
  transform: none;
}

button.secondary {
  border-color: #c9d8ec;
  background: #ffffff;
}

button.secondary:hover {
  background: #f5f9ff;
}

button.danger {
  background: #fff5f5;
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.status-card {
  padding: 12px 14px;
  border-radius: 7px;
}

.form-row,
.equal-row,
.three-cols {
  gap: 14px;
}

.save-panel,
.list-tools {
  align-items: center;
}

.list-tools {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 400px);
}

.list-tools .hint {
  max-width: 760px;
}

#apiPage {
  max-width: 1180px;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
}

#apiPage .google-ads-card {
  align-self: stretch;
}

#apiPage .save-panel {
  grid-column: 1 / -1;
}

.launch-layout {
  max-width: 1320px;
  grid-template-columns: minmax(620px, 1.35fr) minmax(360px, .85fr);
}

.launch-form-panel,
.ai-brief-panel,
.traffic-form-panel {
  padding: 20px;
}

.sheet-target-panel,
.draft-panel {
  padding: 16px;
}

.ai-ads-layout {
  max-width: 1120px;
}

.ai-result-grid {
  gap: 12px;
}

.traffic-layout {
  max-width: 1320px;
  grid-template-columns: minmax(360px, .8fr) minmax(620px, 1.2fr);
}

.table-wrap {
  border-color: #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  background: #f5f8fc;
  color: #25364d;
  font-size: 12px;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom-color: #e8eef6;
}

.data-table tbody tr:hover {
  background: #f9fbfe;
}

.empty-cell {
  background: #ffffff;
}

.config-message {
  font-size: 13px;
}

.pass-badge,
.fail-badge {
  border-radius: 6px;
}

.cashback-page {
  background: #ffffff;
}

.cashback-page .merchant-crawl-panel {
  box-shadow: none;
  border-color: #dfe7f1;
}

.cashback-page .list-tools h2 {
  font-size: 22px;
}

.cashback-page #crawlMerchantDomains {
  background: #1769e0;
}

.cashback-page #crawlMerchantDomains:hover {
  background: #0f56c4;
}

@media (max-width: 860px) {
  .topbar {
    position: static;
    padding: 18px;
  }

  .layout {
    padding: 16px;
  }

  .panel {
    padding: 16px;
  }

  .list-tools,
  .save-panel {
    gap: 12px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

body.auth-locked {
  overflow: hidden;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #ffffff;
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  width: min(820px, 100%);
  display: grid;
  grid-template-columns: minmax(0, .9fr) 360px;
  gap: 22px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(16, 24, 40, .08);
}

.auth-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 6px;
}

.auth-copy h1 {
  color: #101828;
}

.auth-copy p:not(.eyebrow) {
  margin: 12px 0 0;
  max-width: 390px;
  color: #475467;
  line-height: 1.65;
}

.auth-eyebrow {
  color: var(--primary);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 18px;
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  background: #ffffff;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: #f3f7fc;
  border-radius: 8px;
}

.auth-tabs button {
  background: transparent;
  color: var(--primary-dark);
}

.auth-tabs button.active {
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(16, 24, 40, .08);
}

.auth-panel label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.auth-panel input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
}

.auth-panel input:focus {
  outline: 2px solid rgba(23, 105, 224, .18);
  border-color: var(--primary);
}

#authSubmit {
  height: 42px;
  background: var(--primary);
  color: #ffffff;
}

.license-box {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.license-box.visible {
  display: flex;
}

.auth-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-status.ok {
  color: var(--ok);
}

.auth-status.bad {
  color: var(--bad);
}

.auth-logout {
  display: none;
}

body.auth-ready .auth-logout {
  display: inline-flex;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 36px;
  background: linear-gradient(135deg, #1769e0 0%, #0f56c4 100%);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(23, 105, 224, .16);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, .14);
  border-radius: 8px;
}

.tab-button {
  background: transparent;
  color: rgba(255, 255, 255, .82);
  padding: 9px 12px;
}

.tab-button:hover,
.tab-button.active {
  background: #ffffff;
  color: var(--primary-dark);
}

.eyebrow {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
  line-height: 1.3;
}

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 28px 44px;
}

.page {
  display: none;
}

.page.active {
  display: grid;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 35, 72, .04);
}

.status-panel,
.output-panel,
.list-tools,
.save-panel {
  grid-column: 1 / -1;
}

#apiPage .status-panel,
#apiPage .save-panel {
  grid-column: 1 / -1;
}

.api-card {
  align-self: start;
}

#apiPage {
  align-items: start;
}

#apiPage .semrush-card {
  grid-column: 1;
  grid-row: 2;
}

#apiPage .google-ads-card {
  grid-column: 2;
  grid-row: 2 / span 2;
}

#apiPage .gemini-card {
  grid-column: 1;
  grid-row: 3;
}

#apiPage .save-panel {
  grid-row: 4;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.status-card {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.status-card strong {
  display: block;
  margin-bottom: 6px;
}

.status-card span {
  color: var(--muted);
  font-size: 14px;
}

.ok {
  color: var(--ok);
}

.bad {
  color: var(--bad);
}

.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  font-weight: 400;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 224, .12);
}

textarea {
  resize: vertical;
}

button {
  width: fit-content;
  border: 0;
  border-radius: 7px;
  padding: 10px 15px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.button-link {
  width: fit-content;
  border-radius: 7px;
  padding: 10px 15px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.button-link:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 16px rgba(23, 105, 224, .18);
  transform: translateY(-1px);
}

button:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 16px rgba(23, 105, 224, .18);
  transform: translateY(-1px);
}

button.secondary {
  border: 1px solid rgba(23, 105, 224, .18);
  background: #ffffff;
  color: var(--primary-dark);
}

button.secondary:hover {
  background: var(--primary-soft);
}

button.danger {
  border: 1px solid #f3b5b0;
  background: var(--danger-soft);
  color: var(--danger);
}

button.danger:hover {
  background: #ffe3e0;
}

button.small {
  padding: 8px 10px;
  font-size: 13px;
}

.toolbar,
.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

pre {
  min-height: 260px;
  max-height: 520px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: #263244;
  white-space: pre-wrap;
  word-break: break-word;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.save-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.config-message {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.config-message.ok {
  color: var(--ok);
}

.config-message.bad {
  color: var(--bad);
}

.list-tools {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 420px);
  align-items: end;
}

.add-list-panel {
  align-self: start;
}

.list-entry-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr);
  gap: 16px;
  align-items: start;
}

.launch-form-panel {
  grid-column: 1 / -1;
}

.launch-layout {
  grid-template-columns: minmax(620px, 1.45fr) minmax(360px, .9fr);
  align-items: start;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.launch-layout .list-tools {
  grid-column: 1 / -1;
}

.launch-layout .launch-form-panel {
  grid-column: 1;
  grid-row: 2 / span 2;
}

.sheet-target-panel {
  grid-column: 2;
  grid-row: 2;
  gap: 11px;
  max-width: none;
  padding: 16px;
}

.sheet-target-panel label {
  gap: 5px;
  font-size: 13px;
}

.sheet-target-panel input {
  padding: 8px 10px;
}

.sheet-target-panel .hint {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.5;
}

.sheet-target-panel .button-link,
.sheet-target-panel button {
  padding: 9px 13px;
}

.launch-layout .draft-panel {
  grid-column: 2;
  grid-row: 3;
}

.draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.draft-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.draft-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.ai-ads-layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  max-width: 980px;
}

.ai-ads-layout .list-tools {
  grid-column: 1 / -1;
}

.ai-brief-panel {
  grid-column: 1;
}

.ai-result-panel {
  grid-column: 1;
}

.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.ai-result-grid textarea {
  min-height: 220px;
}

.traffic-layout {
  grid-template-columns: minmax(340px, .75fr) minmax(620px, 1.25fr);
  align-items: start;
  max-width: 1320px;
}

.traffic-layout .list-tools,
.merchant-layout .list-tools {
  grid-column: 1 / -1;
}

.merchant-layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  max-width: 1120px;
}

.merchant-crawl-panel {
  grid-column: 1 / -1;
}

.cashback-page {
  display: block;
  max-width: none;
  padding: 22px 0 38px;
  background: #f6f8fb;
}

.cashback-page.active {
  display: block;
}

.cashback-page .list-tools,
.cashback-page .merchant-crawl-panel {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
}

.cashback-page .list-tools {
  min-height: auto;
  margin-bottom: 14px;
  padding: 0 2px;
  border: 0;
  box-shadow: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cashback-page .list-tools h2 {
  font-size: 24px;
  line-height: 1.2;
  color: #101828;
}

.cashback-page .list-tools .hint {
  display: block;
  margin-top: 6px;
  color: #667085;
  font-size: 13px;
}

.cashback-status-pill {
  display: none;
}

.cashback-page .merchant-crawl-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "form form"
    "message actions"
    "table table";
  gap: 16px 18px;
  padding: 18px 16px 20px;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(16, 24, 40, .05);
}

.cashback-page .merchant-crawl-panel h2 {
  display: none;
}

.cashback-page .form-row {
  grid-area: form;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}

.cashback-page .form-row > label {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.cashback-page input[type="url"] {
  width: 100%;
  height: 44px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid #c9d2d9;
  border-radius: 6px;
  font-size: 15px;
  color: #182026;
  background: #ffffff;
}

.cashback-page input[type="url"]:focus {
  outline: 2px solid rgba(39, 110, 241, .26);
  border-color: #276ef1;
}

.cashback-page .merchant-hidden-controls {
  display: none;
}

.cashback-page .ai-actions {
  grid-area: actions;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.cashback-page button {
  height: 42px;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.cashback-page #crawlMerchantDomains {
  background: #b41324;
  color: #ffffff;
}

.cashback-page #crawlMerchantDomains:hover {
  background: #8f0f1d;
}

.cashback-page .secondary {
  background: #ffffff;
  color: #182026;
  border: 1px solid #c9d2d9;
}

.cashback-page .secondary:hover {
  border-color: #9aa9b3;
}

.cashback-page button:disabled {
  opacity: .56;
  cursor: not-allowed;
}

.cashback-page #merchantMessage {
  grid-area: message;
  align-self: center;
  margin: 0;
  min-height: 22px;
  color: #63717c;
  font-size: 14px;
  line-height: 1.55;
}

.cashback-page #merchantMessage.ok {
  color: #13795b;
}

.cashback-page #merchantMessage.bad {
  color: #b42318;
}

.cashback-page .table-wrap {
  grid-area: table;
  margin-top: 0;
  max-height: calc(100vh - 335px);
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  overflow: auto;
  background: #ffffff;
}

.cashback-page .data-table {
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
}

.cashback-page .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  color: #34424e;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  border-bottom: 1px solid #d9e0e5;
  padding: 11px 12px;
}

.cashback-page .data-table tbody td {
  border-bottom: 1px solid #edf1f3;
  padding: 11px 12px;
  font-size: 14px;
  line-height: 1.35;
  vertical-align: top;
}

.cashback-page .data-table tbody tr:hover {
  background: #fbfcfd;
}

.cashback-page .data-table td:first-child {
  font-weight: 700;
  width: 260px;
}

.cashback-page .data-table td:nth-child(2) {
  font-weight: 700;
  color: #13795b;
  width: 160px;
}

.cashback-page .data-table td:nth-child(3) {
  color: #34424e;
  width: 190px;
}

.cashback-page .data-table a {
  color: #165dbe;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.cashback-page .data-table a:hover {
  text-decoration: underline;
}

.cashback-page .empty-cell {
  padding: 34px 16px;
  text-align: center;
  color: #63717c;
}

.traffic-form-panel {
  grid-column: 1;
}

.traffic-result-panel {
  grid-column: 2;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-table {
  max-height: 360px;
}

.stacked-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f7fbff;
  color: #42526e;
  font-weight: 800;
}

.empty-cell {
  height: 160px;
  color: var(--muted) !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.pass-badge,
.fail-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.pass-badge {
  background: #eaf8f0;
  color: var(--ok);
}

.fail-badge {
  background: var(--danger-soft);
  color: var(--danger);
}

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


.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.field-hint.bad {
  color: var(--bad);
  font-weight: 700;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.search-result-item strong {
  display: block;
  color: var(--text);
  line-height: 1.4;
}

.search-result-item span,
.search-result-item p {
  display: block;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.empty-state.compact {
  min-height: 64px;
}

.list-panel {
  min-height: 420px;
}

#listsPage {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#listsPage .list-tools,
#listsPage .list-entry-row {
  grid-column: 1 / -1;
}

.count-badge {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.list-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.list-title {
  color: var(--text);
  font-weight: 800;
  line-height: 1.4;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.note-editor {
  margin-top: 10px;
  font-size: 13px;
}

.note-editor textarea {
  padding: 8px 10px;
  font-size: 13px;
}

.item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--muted);
}

@media (max-width: 860px) {
  .auth-card {
    grid-template-columns: 1fr;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .08);
  }

  .auth-copy {
    padding: 4px 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .status-grid,
  .form-row,
  .list-tools,
  .save-panel,
  #apiPage,
  .launch-layout,
  .ai-ads-layout,
  .traffic-layout,
  .merchant-layout {
    grid-template-columns: 1fr;
  }

  .launch-layout .launch-form-panel,
  .sheet-target-panel,
  .launch-layout .draft-panel,
  .ai-brief-panel,
  .ai-result-panel,
  .merchant-crawl-panel,
  .traffic-form-panel,
  .traffic-result-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .cashback-page {
    padding: 16px 0 28px;
  }

  .cashback-page .list-tools,
  .cashback-page .merchant-crawl-panel {
    width: min(100% - 24px, 1180px);
  }

  .cashback-page .merchant-crawl-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "form"
      "message"
      "actions"
      "table";
  }

  .cashback-page .ai-actions {
    justify-content: stretch;
  }

  .cashback-page .ai-actions button {
    flex: 1 1 160px;
  }

  #apiPage .semrush-card,
  #apiPage .google-ads-card,
  #apiPage .gemini-card,
  #apiPage .save-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .top-actions,
  .nav-tabs {
    width: 100%;
  }

  .tab-button {
    flex: 1;
  }

  .list-item,
  .item-actions {
    flex-direction: column;
  }

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

  .list-entry-row {
    grid-template-columns: 1fr;
  }
}

/* Final unified page polish overrides */
body {
  background: #ffffff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 16px 28px;
  background: #1769e0;
  box-shadow: 0 1px 0 rgba(15, 35, 72, .08);
}

.topbar h1 {
  font-size: 22px;
}

.top-actions {
  gap: 10px;
}

.nav-tabs {
  background: rgba(255, 255, 255, .16);
  border-radius: 7px;
}

.tab-button {
  min-height: 36px;
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 14px;
}

.layout {
  max-width: 1320px;
  gap: 18px;
  padding: 22px 28px 42px;
}

.panel {
  gap: 14px;
  padding: 18px;
  border-color: #dfe7f1;
  border-radius: 8px;
  box-shadow: none;
}

.panel h2 {
  color: #0f172a;
  font-size: 16px;
}

.hint {
  margin-top: 6px;
  color: #5f6f86;
  font-size: 14px;
}

.status-card,
.draft-item,
.list-item,
.search-result-item,
.empty-state,
pre {
  background: #ffffff;
  border-color: #dfe7f1;
  box-shadow: none;
}

label {
  gap: 6px;
  color: #344054;
  font-size: 13px;
}

input,
textarea,
select {
  min-height: 40px;
  border-color: #d7e0ec;
  border-radius: 6px;
  padding: 9px 11px;
  background: #ffffff;
  font-size: 14px;
}

textarea {
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #1769e0;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, .10);
}

button,
.button-link {
  min-height: 38px;
  border-radius: 6px;
  padding: 9px 14px;
  box-shadow: none;
}

button:hover,
.button-link:hover {
  box-shadow: none;
  transform: none;
}

button.secondary {
  border-color: #c9d8ec;
  background: #ffffff;
}

button.secondary:hover {
  background: #f5f9ff;
}

button.danger {
  background: #fff5f5;
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.status-card {
  padding: 12px 14px;
  border-radius: 7px;
}

.form-row,
.equal-row,
.three-cols {
  gap: 14px;
}

.save-panel,
.list-tools {
  align-items: center;
}

.list-tools {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 400px);
}

.list-tools .hint {
  max-width: 760px;
}

#apiPage {
  max-width: 1180px;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
}

#apiPage .google-ads-card {
  align-self: stretch;
}

#apiPage .save-panel {
  grid-column: 1 / -1;
}

.launch-layout {
  max-width: 1320px;
  grid-template-columns: minmax(620px, 1.35fr) minmax(360px, .85fr);
}

.launch-form-panel,
.ai-brief-panel,
.traffic-form-panel {
  padding: 20px;
}

.sheet-target-panel,
.draft-panel {
  padding: 16px;
}

.ai-ads-layout {
  max-width: 1120px;
}

.ai-result-grid {
  gap: 12px;
}

.traffic-layout {
  max-width: 1320px;
  grid-template-columns: minmax(360px, .8fr) minmax(620px, 1.2fr);
}

.table-wrap {
  border-color: #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  background: #f5f8fc;
  color: #25364d;
  font-size: 12px;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom-color: #e8eef6;
}

.data-table tbody tr:hover {
  background: #f9fbfe;
}

.empty-cell {
  background: #ffffff;
}

.config-message {
  font-size: 13px;
}

.pass-badge,
.fail-badge {
  border-radius: 6px;
}

.cashback-page {
  background: #ffffff;
}

.cashback-page .merchant-crawl-panel {
  box-shadow: none;
  border-color: #dfe7f1;
}

.cashback-page .list-tools h2 {
  font-size: 22px;
}

.cashback-page #crawlMerchantDomains {
  background: #1769e0;
}

.cashback-page #crawlMerchantDomains:hover {
  background: #0f56c4;
}

@media (max-width: 860px) {
  .topbar {
    position: static;
    padding: 18px;
  }

  .layout {
    padding: 16px;
  }

  .panel {
    padding: 16px;
  }

  .list-tools,
  .save-panel {
    gap: 12px;
  }
}

/* Final product-design override: keep this block last. */
body {
  background:
    radial-gradient(circle at 82% 0%, rgba(0, 0, 0, .045), transparent 28rem),
    linear-gradient(180deg, #fff 0%, #fbfbfc 48%, #fff 100%);
  color: #050505;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 18px 32px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(0, 0, 0, .1);
  box-shadow: none;
  color: #050505;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #050505;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.03em;
  white-space: nowrap;
}

.topbar h1::before {
  content: "";
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  background:
    linear-gradient(145deg, #000 0 45%, transparent 46%),
    linear-gradient(35deg, transparent 0 26%, #000 27% 72%, transparent 73%);
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 5px 38px;
  color: rgba(0, 0, 0, .38);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.top-actions {
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  background: #f4f4f6;
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 999px;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(0, 0, 0, .62);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tab-button.active,
.tab-button.active:hover {
  background: #050505;
  color: #fff;
}

.tab-button:hover {
  background: rgba(0, 0, 0, .05);
  color: #050505;
}

.layout {
  width: min(100% - 48px, 1360px);
  margin: 0 auto;
  padding: 26px 0 52px;
  gap: 18px;
}

.panel,
.auth-card,
.status-card,
.draft-item,
.list-item,
.search-result-item,
.empty-state,
pre {
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 10px;
  box-shadow: none;
}

.panel {
  padding: 20px;
  gap: 15px;
}

.panel h2,
.output-header h2 {
  color: #050505;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.hint,
.field-hint,
.config-message {
  color: rgba(0, 0, 0, .58);
  font-size: 13px;
  line-height: 1.55;
}

label {
  color: rgba(0, 0, 0, .68);
  font-size: 12px;
  font-weight: 600;
}

input,
textarea,
select {
  min-height: 40px;
  width: 100%;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 8px;
  background: #fff;
  color: #050505;
  font: 400 14px/1.45 "Inter", system-ui, sans-serif;
  box-shadow: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(0, 0, 0, .38);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .08);
}

button,
.button-link {
  min-height: 38px;
  border: 1px solid #050505;
  border-radius: 999px;
  background: #050505;
  color: #fff;
  font: 500 13px/1 "Inter", system-ui, sans-serif;
  box-shadow: none;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

button.secondary,
.topbar .secondary {
  border-color: rgba(0, 0, 0, .18);
  background: #fff;
  color: #050505;
}

button.secondary:hover,
.topbar .secondary:hover {
  background: #f4f4f6;
}

button.danger {
  border-color: rgba(177, 18, 38, .28);
  background: #fff;
  color: #b11226;
}

button.danger:hover {
  background: #fff4f5;
}

.count-badge,
.pass-badge,
.fail-badge {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.pass-badge {
  background: rgba(0, 122, 77, .08);
  color: #007a4d;
}

.fail-badge {
  background: rgba(177, 18, 38, .08);
  color: #b11226;
}

#apiPage {
  max-width: 1180px;
  grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr);
  align-items: start;
}

#apiPage .status-panel,
#apiPage .save-panel {
  grid-column: 1 / -1;
}

#apiPage .semrush-card,
#apiPage .gemini-card {
  grid-column: 1;
}

#apiPage .google-ads-card {
  grid-column: 2;
  grid-row: 2 / span 2;
  align-self: stretch;
}

.list-entry-row {
  width: min(100% - 48px, 1360px);
  margin: 0 auto;
  grid-template-columns: minmax(420px, .8fr) minmax(440px, 1.2fr);
  gap: 18px;
}

.launch-layout {
  max-width: 1360px;
  grid-template-columns: minmax(620px, 1.2fr) minmax(380px, .8fr);
}

.launch-layout .list-tools,
.ai-ads-layout .list-tools,
.traffic-layout .list-tools,
.merchant-layout .list-tools {
  grid-column: 1 / -1;
}

.ai-ads-layout {
  max-width: 1280px;
  grid-template-columns: minmax(560px, 1fr) minmax(420px, .95fr);
  align-items: start;
}

.ai-brief-panel {
  grid-column: 1;
}

.ai-result-panel,
.ai-draft-panel {
  grid-column: 2;
}

.traffic-layout {
  max-width: 1360px;
  grid-template-columns: minmax(360px, .76fr) minmax(640px, 1.24fr);
  align-items: start;
}

.merchant-layout {
  max-width: 1280px;
}

.cashback-page {
  background: transparent;
}

.cashback-page .list-tools h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -.045em;
}

.cashback-page #crawlMerchantDomains {
  border-color: #b11226;
  background: #b11226;
}

.cashback-page #crawlMerchantDomains:hover {
  background: #8f0f1f;
}

.merchant-hidden-controls {
  display: none;
}

.table-wrap {
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 10px;
  background: #fff;
}

.data-table th {
  background: #f1f2f4;
  color: rgba(0, 0, 0, .72);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom-color: rgba(0, 0, 0, .07);
}

.data-table tbody tr:hover {
  background: #fafafa;
}

.auth-overlay {
  background: #fff;
}

.auth-overlay::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 58%;
  z-index: 1;
  background: linear-gradient(to top, #fff 0%, rgba(255, 255, 255, .86) 54%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.auth-video-wrap {
  position: absolute;
  inset: 10%;
  z-index: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.auth-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: min(100%, 980px);
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 390px);
  gap: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.auth-copy {
  min-height: 420px;
  justify-content: flex-end;
  padding: 24px;
}

.auth-copy .eyebrow {
  margin-left: 0;
}

.auth-copy h1 {
  color: #050505;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  font-weight: 300;
  letter-spacing: -.05em;
  line-height: .98;
}

.auth-tabs {
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f4f4f6;
}

.auth-tabs button {
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, .58);
}

.auth-tabs button.active {
  background: #050505;
  color: #fff;
}

@media (max-width: 980px) {
  .topbar,
  #apiPage,
  .launch-layout,
  .ai-ads-layout,
  .traffic-layout,
  .list-entry-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 16px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    overflow: hidden;
  }

  .nav-tabs {
    flex: 1 1 auto;
  }

  .layout,
  .list-entry-row {
    width: min(100% - 28px, 1360px);
  }

  #apiPage .semrush-card,
  #apiPage .gemini-card,
  #apiPage .google-ads-card,
  #apiPage .status-panel,
  #apiPage .save-panel,
  .ai-brief-panel,
  .ai-result-panel,
  .ai-draft-panel {
    grid-column: 1;
    grid-row: auto;
  }

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

@media (max-width: 640px) {
  .topbar h1 {
    white-space: normal;
  }

  .eyebrow {
    margin-left: 0;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  button,
  .button-link {
    width: 100%;
  }
}

/* Login redesign: clean white product gateway, no video background. */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 0, 0, .035) 1px, transparent 1px),
    radial-gradient(circle at 15% 18%, rgba(0, 0, 0, .06), transparent 24rem),
    #ffffff;
  background-size: 44px 44px, 44px 44px, auto, auto;
}

.auth-overlay.hidden {
  display: none;
}

.auth-overlay::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 18px;
  pointer-events: none;
}

.auth-overlay::after,
.auth-video-wrap {
  display: none !important;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.auth-copy {
  position: relative;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  background:
    radial-gradient(circle at 16% 20%, rgba(0, 0, 0, .07), transparent 11rem),
    linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-right: 1px solid rgba(0, 0, 0, .08);
}

.auth-copy::before {
  content: "";
  width: 42px;
  height: 42px;
  display: block;
  background:
    linear-gradient(145deg, #000 0 45%, transparent 46%),
    linear-gradient(35deg, transparent 0 26%, #000 27% 72%, transparent 73%);
  border-radius: 12px;
}

.auth-copy::after {
  content: "API Config\A Lists\A Launch Drafts\A AI Ads";
  white-space: pre;
  align-self: flex-start;
  margin-top: 28px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 12px;
  background: #fff;
  color: rgba(0, 0, 0, .52);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: .02em;
}

.auth-copy .auth-eyebrow {
  margin: auto 0 14px;
  color: rgba(0, 0, 0, .42);
  font-size: 11px;
  letter-spacing: .14em;
}

.auth-copy h1 {
  max-width: 520px;
  margin: 0;
  color: #050505;
  font-size: clamp(2.4rem, 5vw, 4.9rem);
  font-weight: 300;
  letter-spacing: -.06em;
  line-height: .96;
}

.auth-copy p:not(.eyebrow) {
  max-width: 440px;
  margin: 18px 0 0;
  color: rgba(0, 0, 0, .58);
  font-size: 14px;
  line-height: 1.75;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
  justify-content: center;
  padding: 34px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 999px;
  background: #f4f4f6;
}

.auth-tabs button {
  min-height: 34px;
  width: auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(0, 0, 0, .56);
  font-size: 13px;
  font-weight: 500;
}

.auth-tabs button.active {
  background: #050505;
  color: #ffffff;
  box-shadow: none;
}

.auth-status {
  min-height: 22px;
  color: rgba(0, 0, 0, .58);
  font-size: 13px;
  line-height: 1.5;
}

.auth-status.bad {
  color: #b11226;
}

.auth-status.good {
  color: #007a4d;
}

.auth-panel label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: rgba(0, 0, 0, .68);
  font-size: 12px;
  font-weight: 600;
}

.auth-panel input {
  height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 9px;
  background: #fff;
  color: #050505;
}

.auth-panel input:focus {
  outline: none;
  border-color: rgba(0, 0, 0, .42);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .08);
}

#authSubmit {
  min-height: 42px;
  margin-top: 2px;
  background: #050505;
  color: #ffffff;
}

.license-box {
  display: none;
  flex-direction: column;
  gap: 11px;
  margin-top: 2px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 12px;
  background: #fafafa;
}

.license-box.visible {
  display: flex;
}

@media (max-width: 860px) {
  .auth-overlay {
    padding: 18px;
  }

  .auth-overlay::before {
    inset: 10px;
    border-radius: 14px;
  }

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

  .auth-copy {
    min-height: auto;
    padding: 28px;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
  }

  .auth-copy::after {
    display: none;
  }

  .auth-copy .auth-eyebrow {
    margin-top: 36px;
  }

  .auth-panel {
    padding: 24px;
  }
}

/* Login hero interaction: lifted window, justice fist badge, 0.2s image loop. */
.auth-overlay {
  place-items: start center;
  align-items: start !important;
  justify-items: center !important;
  padding-top: clamp(150px, 20vh, 210px) !important;
}

.auth-card {
  align-self: start !important;
  justify-self: center !important;
  margin: 0 auto !important;
  transform: none;
}

.auth-copy {
  overflow: hidden;
}

.auth-copy::before {
  display: none;
}

.auth-fist-logo {
  width: 70px;
  height: 70px;
  min-height: 70px;
  padding: 0;
  align-self: flex-start;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(0, 0, 0, .72);
  border-radius: 14px;
  background: #050505;
  cursor: pointer;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .2);
}

.auth-fist-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.auth-fist-logo:hover {
  transform: translateY(-2px) scale(1.03);
}

.auth-gallery {
  position: absolute;
  right: 30px;
  bottom: 30px;
  width: min(330px, calc(100% - 60px));
  height: 210px;
  display: none;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 16px;
  background: #050505;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

.auth-gallery.active {
  display: block;
}

.auth-gallery img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.auth-gallery-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(0, 0, 0, .58);
  color: rgba(255, 255, 255, .9);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 860px) {
  .auth-overlay {
    padding-top: 18px;
  }

  .auth-card {
    transform: translateY(-12px);
  }

  .auth-fist-logo {
    width: 58px;
    height: 58px;
    min-height: 58px;
    border-radius: 14px;
  }

  .auth-gallery {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 190px;
    margin-top: 18px;
  }
}

/* Keep the cashback scraper isolated to its own tab. */
.page:not(.active) {
  display: none !important;
}

#merchantPage:not(.active),
.cashback-page:not(.active) {
  display: none !important;
}

#merchantPage.active {
  display: block !important;
}
