:root {
  --win-bg: #008080;
  --panel: #c0c0c0;
  --border-light: #ffffff;
  --border-dark: #404040;
  --accent: #000080;
  --title-text: #ffffff;
  --title-bar: #000080;
}

* {
  box-sizing: border-box;
  image-rendering: pixelated;
}

body {
  margin: 0;
  background: var(--win-bg);
  font-family: 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
  overscroll-behavior: none;
}

html {
  overscroll-behavior: none;
}

.desktop {
  min-height: 100vh;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

main {
  flex: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}

.grid>*,
.dashboard-layout>* {
  min-width: 0;
}

.dashboard-layout {
  display: grid;
  gap: 20px;
}

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

@media (max-width: 980px) {
  .grid.two-col {
    grid-template-columns: 1fr;
  }

  /* Collapse Advertiser wizard columns gracefully before they overflow */
  .wizard-step .stack-mobile,
  #wizardStep1 .stack-mobile,
  #wizardStep2 .stack-mobile,
  #wizardStep3 .stack-mobile {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
  }
}

@media (max-width: 600px) {
  .field-row {
    flex-wrap: wrap !important;
  }

  .field-row>span {
    flex: 0 0 100% !important;
    margin-bottom: 4px;
  }

  .upload-controls {
    flex-wrap: wrap;
    gap: 6px !important;
  }
}

.window {
  background: var(--panel);
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-right: 2px solid var(--border-dark);
  border-bottom: 2px solid var(--border-dark);
}

.title-bar {
  background: linear-gradient(90deg, #001a9a 0%, #000080 100%);
  color: var(--title-text);
  padding: 4px 8px;
  min-height: 28px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title-bar button {
  width: 18px;
  height: 18px;
  padding: 0;
  line-height: 1;
  font-size: 11px;
  font-weight: bold;
  border-top: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
  background: var(--panel);
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.title-actions button {
  width: 18px;
  height: 18px;
  margin-left: 3px;
  font-size: 11px;
  font-weight: bold;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.help-icon {
  width: 18px;
  height: 18px;
  padding: 0;
  line-height: 1;
  font-weight: bold;
  background: #dcdcdc;
  color: #000;
}

.window-body {
  padding: 13px;
  font-size: 14px;
}

.title-window .hero h1 {
  margin: 0 0 6px;
  font-size: 34px;
  line-height: 1.1;
}

.title-window .hero p {
  margin: 0;
  font-size: 16px;
}

.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
}

.hero-box {
  background: var(--panel);
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-right: 2px solid var(--border-dark);
  border-bottom: 2px solid var(--border-dark);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (max-width: 600px) {
  .hero-split {
    grid-template-columns: 1fr;
  }
}

.global-topbar {
  min-height: 42px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
}

.global-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.btn,
button,
input,
summary {
  font-family: inherit;
  font-size: 13px;
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-right: 2px solid var(--border-dark);
  border-bottom: 2px solid var(--border-dark);
  background: var(--panel);
  color: #000;
  padding: 6px 8px;
}

select {
  font-family: inherit;
  font-size: 13px;
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-right: 2px solid var(--border-dark);
  border-bottom: 2px solid var(--border-dark);
  background: var(--panel);
  color: #000;
  padding: 6px 24px 6px 8px;
  /* Extra padding on right for arrow */

  /* Kill mobile roundness */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0 !important;

  /* Classic Win95 Arrow */
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  /* Positioned nicely near border edge */
  background-size: 8px auto;
}

.btn.primary {
  font-weight: 700 !important;
}

/* Global Standard for actionable buttons */
.btn {
  padding: 4px 14px !important;
  font-size: 13px !important;
  min-height: 26px !important;
  box-sizing: border-box !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Specific override for massive Hero CTA buttons */
.btn.hero-btn {
  padding: 10px 20px !important;
  font-size: 14px !important;
  min-height: 36px !important;
}

/* Specific override for micro-interaction utility buttons */
.btn.btn-sm {
  padding: 2px 6px !important;
  font-size: 11px !important;
  min-height: 18px !important;
}

.btn:not(:disabled):active,
button:not(:disabled):active {
  border-top: 2px solid var(--border-dark);
  border-left: 2px solid var(--border-dark);
  border-right: 2px solid var(--border-light);
  border-bottom: 2px solid var(--border-light);
}

.global-menu button:active {
  background: var(--btn-active);
  color: var(--title-text);
  border: 1px inset #888;
}

.menu-profile-header {
  padding: 8px 15px;
  background: #e0e0e0;
  border-bottom: 1px solid #a0a0a0;
  font-size: 11px;
  color: #333;
  margin-bottom: 2px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.menu-profile-header strong {
  font-size: 13px;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.menu-admin-link {
  color: #800000 !important;
  font-weight: bold;
}

.menu-admin-link:hover {
  background: #800000 !important;
  color: #fff !important;
}

.topbar-cta {
  background: var(--accent);
  color: var(--title-text);
  font-weight: bold;
  min-height: 28px;
  padding: 4px 8px;
}

.field-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
  font-size: 14px;
}

.field-row>span {
  flex: 0 0 160px;
  font-weight: bold;
}

.field-row input,
.field-row select {
  flex: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.wizard-offset {
  margin-left: 188px;
}

.embed-box {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

code {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  padding: 2px 5px;
  font-family: monospace;
  font-size: 13px;
}

.ad-slot {
  background: #efefef;
  border: 2px dashed #777;
  min-height: 110px;
  margin: 10px 0 0;
  padding: 12px;
  position: relative;
}

.ad-slot.popup-mode {
  background: rgba(0, 0, 0, 0.35);
  border-style: solid;
}

.miniapp-frame {
  margin: 0 auto;
  background: #fff;
  border: 1px solid #909090;
  overflow: hidden;
}



.frame-base {
  width: min(320px, 100%);
  aspect-ratio: 360 / 640;
}

.miniapp-header {
  background: #f3f3f3;
  border-bottom: 1px solid #d0d0d0;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: bold;
}

.miniapp-content {
  padding: 8px;
  display: grid;
  gap: 7px;
}

.line {
  height: 9px;
  background: #ececec;
  border-radius: 2px;
}

.line.w70 {
  width: 70%;
}

.line.w60 {
  width: 60%;
}

.card {
  height: 54px;
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
}

.preview-ad {
  background: #dbe7ff;
  border: 1px dashed #4d72c6;
  color: #1f3f8a;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  padding: 8px;
  margin: 6px;
}

.creative-thumb {
  width: 100%;
  max-height: 72px;
  object-fit: cover;
  border: 1px solid #91a8dc;
  margin-bottom: 6px;
}

.hunt-theme {
  background: #090909;
  color: #fff;
  padding: 10px;
}

.hunt-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hunt-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ff6f7d;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: bold;
}

.hunt-connect {
  background: #1f1f1f;
  color: #fff;
  border: 1px solid #333;
  padding: 4px 10px;
  border-radius: 10px;
}

.hunt-theme h3 {
  margin: 10px 0 2px;
  font-size: 22px;
}

.hunt-theme p {
  margin: 0 0 10px;
  font-size: 11px;
  color: #d2d2d2;
}

.hunt-theme p span {
  color: #ff6f7d;
}

.hunt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 8px;
}

.hunt-actions button {
  background: #1d1d1d;
  color: #ff8791;
  border: 1px solid #ff8791;
  border-radius: 12px;
  font-size: 10px;
  padding: 6px 8px;
}

.hunt-actions .glow {
  background: #ff6f7d;
  color: #fff;
  border-color: #ff6f7d;
  box-shadow: 0 0 10px rgba(255, 111, 125, 0.45);
}

.hunt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.hunt-card {
  height: 54px;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 10px;
}

.ad-slot.preview-animate .miniapp-frame,
.ad-slot.preview-animate .popup-card {
  animation: previewFade .18s ease;
}

@keyframes previewFade {
  from {
    opacity: 0.45;
    transform: translateY(6px) scale(0.99);
  }

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

.popup-card {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(280px, calc(100% - 24px));
  max-width: calc(100% - 24px);
  height: 140px;
  background: #fff;
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-right: 2px solid var(--border-dark);
  border-bottom: 2px solid var(--border-dark);
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: bold;
  z-index: 3;
  box-sizing: border-box;
}

.kpi {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.kpi strong {
  font-size: 15px;
}

.status {
  min-height: 18px;
  font-size: 13px;
}

.sim-box {
  margin-top: 10px;
  border: 1px solid #808080;
  background: #fff;
  padding: 10px;
}

.history-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.history-toolbar label {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.history-table-wrap {
  overflow: auto;
  border-top: 2px solid var(--border-dark);
  border-left: 2px solid var(--border-dark);
  border-right: 2px solid var(--border-light);
  border-bottom: 2px solid var(--border-light);
  background: #ffffff;
  margin-top: 8px;
}

.history-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  color: #000;
}

.history-table th {
  background: #c0c0c0;
  border-top: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
  padding: 4px 8px;
  text-align: left;
  white-space: nowrap;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 2;
}

.history-table td {
  border-right: 1px solid #a0a0a0;
  border-bottom: 1px solid #a0a0a0;
  padding: 4px 8px;
  text-align: left;
  white-space: nowrap;
}

.history-table tr:nth-child(even) {
  background: #fafafa;
}

/* Ensure no weird right-border on last columns */
.history-table td:last-child {
  border-right: none;
}

.history-action {
  padding: 3px 6px;
  font-size: 11px;
}

.status-active {
  color: #0a6b2e;
  font-weight: bold;
}

.status-paused {
  color: #8a5a00;
  font-weight: bold;
}

.status-scheduled {
  color: #5a3c85;
  font-weight: bold;
}

.status-completed {
  color: #555;
  font-weight: bold;
}

#textFields,
#rewardFields {
  display: none;
}

.creative-preview {
  display: none;
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  margin: 4px 0 10px;
  border: 1px solid #888;
  background: #fff;
}

.help-dialog {
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-right: 2px solid var(--border-dark);
  border-bottom: 2px solid var(--border-dark);
  background: var(--panel);
  padding: 12px;
  max-width: 420px;
}

.help-dialog::backdrop {
  background: rgba(0, 0, 0, 0.28);
}

.taskbar {
  background: var(--panel);
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-right: 2px solid var(--border-dark);
  border-bottom: 2px solid var(--border-dark);
  min-height: 44px;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.start {
  font-weight: bold;
  min-height: 28px;
}

.start-menu {
  position: absolute;
  left: 6px;
  bottom: 38px;
  width: 170px;
  background: var(--panel);
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-right: 2px solid var(--border-dark);
  border-bottom: 2px solid var(--border-dark);
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 9999;
}

.start-menu button {
  text-align: left;
  border: 1px solid #6d6d6d;
  background: #d3d3d3;
  padding: 5px 8px;
  cursor: pointer;
  font-family: inherit;
}

.start-menu button:hover {
  background: #e2e2e2;
}

.start-menu[hidden] {
  display: none !important;
}

/* Dashboard Ad Formats Label */
.ad-formats-label {
  flex: 0 0 130px;
}

@media (max-width: 768px) {
  .ad-formats-label {
    flex: none;
    margin-bottom: 5px;
  }
}

/* Global Navigation Menu */
.global-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  width: 170px;
  background: var(--panel);
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-right: 2px solid var(--border-dark);
  border-bottom: 2px solid var(--border-dark);
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 99999;
}

.global-menu button {
  text-align: left;
  border: 1px solid #6d6d6d;
  background: #d3d3d3;
  padding: 5px 8px;
  cursor: pointer;
  font-family: inherit;
}

.global-menu button:hover {
  background: #e2e2e2;
}

.global-menu[hidden] {
  display: none !important;
}

/* Custom styling for embedded script box to look like code, not an input field */
.embed-box code {
  background: #e8e8e8 !important;
  border: 1px solid #ccc !important;
  padding: 12px 65px 12px 12px !important;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.05) !important;
  border-radius: 2px;
  color: #000080 !important;
  display: block;
  word-break: break-all;
}

/* --- Global Pagination Button Sizing (Start Button Parity) --- */
#btnPrevCampaigns,
#btnNextCampaigns,
#btnPrevPublishers,
#btnNextPublishers,
#btnPrevMyCampaigns,
#btnNextMyCampaigns,
#btnPrevPubApps,
#btnNextPubApps {
  min-height: 26px !important;
  height: 26px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
  font-weight: bold !important;
  box-sizing: border-box !important;
  width: auto !important;
  flex: 0 0 auto !important;
}

/* =========================================================================
   MOBILE RESPONSIVENESS OVERRIDES (max-width: 768px)
   ========================================================================= */
@media (max-width: 768px) {

  /* 1. Global Spacing & Layout */
  .desktop {
    padding: 8px !important;
    /* Restore breathing room from physical screen edges */
    gap: 12px !important;
  }

  /* 2. Grid Overrides & Container Padding */
  .grid,
  .grid.two-col,
  .dashboard-layout {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .window-body {
    padding: 10px !important;
    font-size: 14px !important;
  }

  body {
    font-size: 14px !important;
  }

  /* 3. Global Top Navigation */
  .global-topbar-inner {
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  /* Universal Modal / Popup Clamping */
  div[style*="position:fixed"][style*="z-index"]>.window,
  div[style*="position: fixed"][style*="z-index"]>.window,
  dialog.window {
    width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    border-width: 2px !important;
    margin: 0 auto;
    position: relative;
    top: 5vh;
  }

  /* Kill body scrolling for open modals organically if needed, but ensure horizontal is dead */
  body {
    max-width: 100vw;
    overflow-x: hidden !important;
  }

  .global-topbar-inner>div {
    justify-content: flex-start !important;
    width: auto !important;
  }

  .topbar-cta {
    flex: none !important;
    width: auto !important;
    min-height: 38px !important;
    font-size: 14px !important;
    padding: 6px 12px !important;
  }

  /* 4. Form Field Rows (Stacked instead of inline) */
  .field-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }

  .field-row > span,
  .field-row label,
  .ad-formats-label {
    flex: none !important;
    width: 100% !important;
    font-weight: bold !important;
    margin-bottom: 2px !important;
  }
  
  .wizard-offset {
    margin-left: 0 !important;
  }

  .field-row input:not([type="checkbox"]):not([type="radio"]),
  .field-row select,
  .field-row button:not([aria-label*="help"]):not([id*="HelpBtn"]):not(#btnApplyPromo),
  .faux-file-input {
    width: 100% !important;
    height: 42px !important;
    /* Touch-friendly height */
    font-size: 16px !important;
    box-sizing: border-box !important;
    /* Prevents iOS auto-zoom on focus */
  }

  button[aria-label*="help"],
  button[id*="HelpBtn"] {
    width: 18px !important;
    height: 18px !important;
    font-size: 11px !important;
    padding: 0 !important;
  }

  /* Fix applying promo inline */
  #btnApplyPromo {
    height: 42px !important;
    font-size: 16px !important;
  }

  /* 5. Utility class for stacking things that are side-by-side on desktop */
  .stack-mobile {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    align-items: stretch !important;
  }

  /* Ensure all primary/standard buttons inside windows are touch-friendly without breaking flex layouts */
  .window-body .btn:not(.btn-sm):not([aria-label*="help"]):not([id*="HelpBtn"]):not([id*="HelpTop"]) {
    min-height: 38px !important;
    font-size: 14px !important;
    padding: 8px 12px !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }


  /* 6. Fix for New Image Upload Rows */
  #imageFields .format-upload-row .field-row>div {
    display: flex !important;
    flex-wrap: wrap !important;
    /* Allow elegant stacking instead of catastrophic overlapping on narrow screens */
    width: 100% !important;
    align-items: center !important;
    gap: 8px !important;
  }

  #imageFields .format-upload-row input[type="file"] {
    flex: 1 !important;
    /* Allow the input to take available space */
    width: auto !important;
    margin-bottom: 0px !important;
  }

  /* 7. Fix Checkboxes Overlapping Text */
  #adSizeCheckboxes label {
    align-items: flex-start !important;
    line-height: 1.4 !important;
    display: flex !important;
  }

  #adSizeCheckboxes label input[type="checkbox"] {
    margin-right: 8px !important;
  }

  .field-row input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    flex: none !important;
    margin-top: 2px !important;
  }

  /* Remove flex: 1 from stacked children to prevent stretching bugs */
  .stack-mobile>div {
    flex: none !important;
    width: 100% !important;
  }

  /* 8. Fix Wizard Navigation Header */
  .wizard-nav {
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 13px !important;
    justify-content: flex-start !important;
  }

  .wizard-nav>span {
    line-height: 1.2 !important;
  }

  /* 9. Tables (Admin, Invoices, Campaigns, History) */
  .history-table-wrap,
  .invoice-table-wrap {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .admin-table,
  .campaign-table,
  .history-table {
    display: table !important;
    white-space: nowrap !important;
    min-width: 600px !important;
  }

  .invoice-table {
    display: table !important;
    white-space: normal !important;
    min-width: 100% !important;
    width: 100% !important;
    word-break: break-word;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #999;
  }

  .invoice-table td {
    border: 1px solid #ccc;
    padding: 6px 10px !important;
  }

  /* 7. Footer / Taskbar */
  .taskbar {
    justify-content: flex-start !important;
    padding: 6px !important;
    height: auto !important;
    min-height: 44px !important;
  }

  .taskbar>div {
    gap: 8px !important;
  }

  .taskbar button.start {
    height: 32px !important;
  }

  .title-window .hero h1 {
    font-size: 24px !important;
    margin-bottom: 4px !important;
  }

  .title-window .hero p {
    font-size: 13px !important;
  }

  /* Wrap readiness status properly */
  #creativeReady {
    display: block;
    margin-top: 5px;
  }

  #clock {
    display: none !important;
    /* Hide clock on mobile to save space */
  }

  /* 8. Code Embeds */
  code {
    word-break: break-all !important;
    white-space: pre-wrap !important;
    /* Guarantee wrap */
    font-size: 11px !important;
  }

  /* Hero section embed box specific fixes for mobile */
  .embed-box {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .embed-box button {
    width: 100% !important;
    height: 42px !important;
  }

  /* 9. Publisher Guide Layout Fixes */
  .window-body>div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .window-body>div>img[alt="Config"] {
    margin: 0 auto 10px auto !important;
    display: block !important;
  }

  /* 10. Publisher Dashboard Snapshot Grid */
  .grid.two-col[style*="gap: 30px;"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
  }

  /* Reduce padding on the snapshot container for very narrow screens */
  .window-body[style*="padding: 20px;"] {
    padding: 10px !important;
  }

  /* 11. Custom Wizard Flex Stack Fixes moved to 980px breakpoint */

  /* Step 3: Invoice Table Scaling */
  .invoice-table td {
    font-size: 13px !important;
    padding: 6px 4px !important;
    text-align: center !important;
  }

  .invoice-table td[id] {
    text-align: center !important;
  }

  .invoice-table td[style*="font-size:18px;"] {
    font-size: 15px !important;
    padding: 8px 0 !important;
  }

  #wizardStep3 h2 {
    font-size: 16px !important;
  }

  .wizard-step .stack-mobile>div {
    flex: none !important;
    width: 100% !important;
  }

  /* 12. Wizard Actions Mobile Sizing */
  div.window-body .wizard-actions,
  .window-body>div[style*="display: flex"].wizard-actions,
  .window-body>div>div[style*="display: flex"].wizard-actions {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    align-items: stretch !important;
  }

  .window-body .wizard-actions .btn {
    flex: 1 !important;
    width: 100% !important;
    /* Forces buttons to split the container perfectly on mobile */
    min-height: 42px !important;
    font-size: 15px !important;
    padding: 8px 4px !important;
  }



  #launchCampaign {
    height: 42px !important;
    align-self: center !important;
  }

  /* 11. Earnings Snapshot Mobile 2x2 Grid */
  .mobile-metrics-wrapper {
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
  }

  .mobile-metrics-wrapper>div:nth-child(2),
  .mobile-metrics-wrapper>div:nth-child(4) {
    border-right: none !important;
    padding-right: 0 !important;
  }

  .mobile-metrics-wrapper>div:nth-child(1),
  .mobile-metrics-wrapper>div:nth-child(2) {
    border-bottom: 1px dotted #ccc !important;
    padding-bottom: 15px !important;
  }

  /* 13. Horizontal KPI Boxes for Estimator/Metrics */
  .kpi-row-mobile {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    width: 100% !important;
  }

  .kpi-row-mobile .metric-box {
    padding: 8px 4px !important;
    flex: 1 !important;
    box-sizing: border-box;
  }

  .kpi-row-mobile .metric-box h3 {
    font-size: 13px !important;
    letter-spacing: normal !important;
  }

  .kpi-row-mobile .metric-box>div:nth-of-type(1) {
    font-size: 13px !important;
    letter-spacing: normal !important;
  }

  .kpi-row-mobile .metric-box>div:nth-of-type(2) {
    font-size: 18px !important;
    margin: 4px 0 !important;
  }

  .kpi-row-mobile .metric-box>div:nth-of-type(3) {
    font-size: 11px !important;
    letter-spacing: normal !important;
  }
}

/* =======================================
   11. Cropper.js Customizations
   ======================================= */
/* Circular Crop Box for Icons */
.cropper-circular .cropper-view-box,
.cropper-circular .cropper-face {
  border-radius: 50%;
}

/* Fix Live Preview Overflow Bugs */
.img-preview {
  overflow: hidden;
  text-align: center;
}

.img-preview>img {
  max-width: 100%;
}

/* Landing Page Marquee */
.app-store-marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 5px 0;
}

.app-store-marquee {
  display: flex;
  gap: 12px;
  animation: scroll-left 35s linear infinite;
  white-space: nowrap;
  padding: 0 10px;
}

.app-store-marquee:hover {
  animation-play-state: paused;
}

.app-store-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: 160px;
  min-width: 160px;
  height: 60px;
  background: #fdfdfd;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  flex: 0 0 auto;
  padding: 8px 12px;
  text-align: left;
  gap: 12px;
  cursor: default;
}

.app-store-card img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.app-store-card .app-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-store-card strong {
  font-size: 13px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.app-store-card small {
  font-size: 10px;
  color: #64748b;
}

@keyframes blink-bg {

  0%,
  100% {
    background-color: #dfdfdf;
    color: #000;
  }

  50% {
    background-color: #800000;
    color: #fff;
  }
}

.blink-step {
  animation: blink-bg 1.5s infinite;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0%);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* Step Indicator Responsive Alignment */
.step-indicator-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  font-weight: bold;
  font-size: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.step-indicator-container .btn {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .step-indicator-container {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    white-space: nowrap;
    gap: 2px !important;
    font-size: 9px;
    padding-bottom: 2px;
  }

  .step-indicator-container::-webkit-scrollbar {
    height: 3px;
  }

  .step-indicator-container::-webkit-scrollbar-thumb {
    background: #888;
  }

  .window-body .step-indicator-container .btn,
  .step-indicator-container .btn {
    padding: 4px 8px !important;
    font-size: 12px !important;
    letter-spacing: normal !important;
    width: auto !important;
    height: 28px !important;
    white-space: nowrap !important;
    line-height: inherit !important;
  }

  /* =======================================
   14. Windows 95 Table Gridlines
   ======================================= */
  .admin-table td,
  .history-table td,
  .invoice-table td {
    border: 1px solid #888 !important;
  }

  .admin-table th,
  .history-table th,
  .invoice-table th {
    border: 1px solid #888;
    border-top-color: #dfdfdf;
    border-left-color: #dfdfdf;
    border-bottom-color: #000;
    border-right-color: #000;
  }
}

/* --- Preview Window Styles (Desktop vs Mobile) --- */
.preview-website {
  width: 100%;
  height: 100%;
  min-height: 360px;
}

.preview-miniapp {
  width: 100%;
  max-width: 340px;
  /* Lock to simulated phone size on Desktop */
  height: 100%;
  min-height: 500px;
  margin: 0 auto;
  border: 4px solid #222;
  border-radius: 12px;
  border-bottom-width: 10px;
  box-sizing: border-box;
}

/* On mobile, remove the max-width restriction for Mini-App so it scales fluidly */
@media (max-width: 768px) {
  .preview-miniapp {
    max-width: none;
    border-width: 2px;
    border-bottom-width: 4px;
    border-radius: 8px;
  }
}

@keyframes btn-blink {
  0% {
    background-color: var(--button-face);
    color: #000;
  }

  50% {
    background-color: #000080;
    color: #fff;
  }

  100% {
    background-color: var(--button-face);
    color: #000;
  }
}

.btn-blink {
  animation: btn-blink 1.2s infinite;
}

/* Force 34px height for primary action buttons on PC (matches Claim button) */
@media (min-width: 769px) {
  .pc-action-btn {
    height: 34px !important;
  }
}

/* =======================================
   15. Global Mobile Button Stacking
   ======================================= */
@media (max-width: 600px) {

  .wizard-actions .btn:not(.btn-sm),
  .stack-mobile .btn:not(.btn-sm),
  .publisher-btn-mobile .btn:not(.btn-sm) {
    width: 100% !important;
    min-height: 36px !important;
    padding: 6px 14px !important;
    font-size: 14px !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  .stack-mobile {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}