:root{
  /* Light */
  --bg:#ffffff;
  --panel:#ffffff;
  --text:#0b1220;
  --muted:#5e6a85;
  --line:#e7eaf2;

  /* Dark */
  --bg-dark:#0f1115;
  --panel-dark:#0b0e14;
  --text-dark:#e7e9ee;
  --muted-dark:#a9b0be;
  --line-dark:#242b3b;

  --accent:#5b9cff;
  --accent-2:#2cd3ff;
  --success:#22c55e;
}

*{ box-sizing:border-box; }
html, body { height: 100%; }
body{
  margin:0;
  min-height:100vh;
  display:grid;
  grid-template-rows: auto 1fr auto; /* header | main | footer */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  font-weight: 450;
}

body[data-theme="light"]{ background:var(--bg); color:var(--text); }
body[data-theme="dark"] { background:var(--bg-dark); color:var(--text-dark); }

header.app-header, main, footer.site-footer { width:100%; }

.container{ max-width:1100px; margin:0 auto; padding:0 16px; }

.app-header{ padding:20px 0 8px; }
.hdr{ display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.hdr-left h1{ margin:0 0 6px; font-size:22px; }
.hdr-left p{ margin:0; color:var(--muted); }
.theme-toggle{ display:flex; align-items:center; gap:8px; cursor:pointer; font-size:13px; }
.theme-toggle input{ width:36px; height:20px; appearance:none; background:#cfd6ea; border-radius:999px; position:relative; outline:none; transition:.2s; }
.theme-toggle input:checked{ background:#2b3145; }
.theme-toggle input::after{ content:""; position:absolute; top:3px; left:3px; width:14px; height:14px; border-radius:50%; background:#fff; transition:.2s; }
.theme-toggle input:checked::after{ transform:translateX(16px); }
.toggle-label{ user-select:none; color:var(--muted); }

/* Tabs */
.tabs{ display:inline-flex; gap:6px; margin-top:12px; }
.tab{
  border:1px solid var(--line); background:#f6f8fd; color:#1b2234;
  padding:6px 12px; border-radius:10px; cursor:pointer; font-size:13px;
}
.tab.active{ background:#eaf0ff; border-color:#cddafd; color:#0f1a3a; }

/* Panels */
.panel{
  border:1px solid var(--line); border-radius:14px; padding:16px; background:var(--panel);
  margin-top:16px;
}
body[data-theme="dark"] .panel{ background:var(--panel-dark); border-color:var(--line-dark); }
.panel-title{ margin:0 0 10px; font-size:16px; }
.muted{ color:var(--muted); font-size:13px; }

.hidden{ display:none; }
.mt-12{ margin-top:12px; }
.mt-16{ margin-top:16px; }

/* Grid + compact fields */
.grid{ display:grid; gap:12px; margin-top:12px; }
.grid.two{ grid-template-columns:1fr 1fr; }
.grid.one{ grid-template-columns:1fr; }
@media (max-width:900px){ .grid.two{ grid-template-columns:1fr; } }

label{ display:flex; flex-direction:column; gap:6px; font-size:13px; color:var(--muted); }
input[type="url"], input[type="number"], select{
  border:1px solid var(--line); border-radius:10px; padding:6px 8px; min-width:230px; background:#fff; color:#0b1220; font-size:13px;
}
body[data-theme="dark"] input[type="url"],
body[data-theme="dark"] input[type="number"],
body[data-theme="dark"] select{
  background:var(--panel-dark); color:var(--text-dark); border-color:var(--line-dark);
}
.compact-input{ padding:6px 8px; font-size:13px; min-width:220px; }

/* Buttons */
.btn{
  appearance:none; border:1px solid var(--line); background:#f6f8fd; color:#0a1020;
  border-radius:12px; padding:8px 12px; cursor:pointer; font-weight:600; font-size:14px;
}
.btn:hover{ background:#eef3ff; }
.btn:disabled{ opacity:.6; cursor:not-allowed; }
.btn.primary{
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  border:none; color:#fff;
}
.btn.success{ background:var(--success); border:none; color:#fff; }
.btn.success:hover{ filter:brightness(1.05); }

/* Hold-to-start button with progress ring */
.btn.hold{
  position:relative;
  padding-left:14px; padding-right:14px;
  overflow:hidden;
}
/* Filled gradient that grows left→right as you hold */
/* Filled gradient grows L→R with a soft, blended front edge */
/* Takeover fill: soft leading edge, solid #6480ff */
.btn.hold::after{
  content:"";
  position:absolute; inset:0;
  border-radius:12px;
  background: linear-gradient(90deg, #6480ff, #6480ff);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 80ms linear;
  opacity: .95;
  pointer-events: none;           /* <<< add this */

  mask-image:
    linear-gradient(to right, black calc(100% - 18px), rgba(0,0,0,0) 100%),
    linear-gradient(black, black);
  mask-composite: intersect;
  -webkit-mask-image:
    linear-gradient(to right, black calc(100% - 18px), rgba(0,0,0,0) 100%),
    linear-gradient(black, black);
  -webkit-mask-composite: source-in;
}

/* Moving highlight riding the takeover edge */
.btn.hold::before{
  content:"";
  position:absolute; inset:0;
  border-radius:12px;
  pointer-events: none;           /* <<< add this */
  background:
    radial-gradient(60% 140% at calc(var(--p,0)*100%) 50%,
      rgba(255,255,255,.30) 0%,
      rgba(255,255,255,.14) 35%,
      rgba(255,255,255,0) 65%);
  mix-blend-mode: screen;
}

/* Once we start, keep the filled state and freeze visuals */
.btn.hold.running::after{
  transform: scaleX(1);                /* locked full fill */
  transition: none;                    /* no unwind */
}
.btn.hold.running::before{
  opacity: 0.25;                       /* subtle highlight while running */
}

.btn.hold .label{ position:relative; z-index:1; }

/* When the button is fully taken over, kill the feather/mask so no blue edge shows */
.btn.hold.full::after{
  -webkit-mask: none;
  mask: none;
}

/* Processing/completed cosmetics (optional tweaks) */
.btn.hold.processing{ cursor: default; }
.btn.hold.completed{
  cursor: default;
  filter: saturate(.95);
  opacity: .92;
}


/* Start row + spinner */
.start-row{ display:flex; align-items:center; gap:10px; }
.spinner{
  width:14px; height:14px; border-radius:50%;
  border:2px solid currentColor; border-top-color:transparent;
  display:inline-block; animation:spin .8s linear infinite; vertical-align:middle;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
.loading{ font-size:13px; color:var(--muted); }

/* Dropzone */
.dropzone{
  border:2px dashed var(--line); border-radius:14px; padding:18px; text-align:center;
  background:#f7f9ff;
}
.dropzone:hover{ border-color:#cddafd; }
.dropzone.dragover{ outline:2px solid var(--accent); outline-offset:2px; }
body[data-theme="dark"] .dropzone{ background:var(--panel-dark); border-color:var(--line-dark); }
.drop-inner strong{ display:block; margin-bottom:4px; }
.dz-note{ margin:0 8px; color:var(--muted); font-size:13px; }
.dz-subnote{ margin-top:6px; color:var(--muted); font-size:12px; }
.dropzone .btn{
  background:#ffffff; color:#0b1220; border:1px solid #cddafd; border-radius:10px;
  padding:10px 14px; font-size:14px; line-height:1; min-width:96px; font-weight:600;
}
.dropzone .btn:hover{ background:#f7f9ff; }
.dropzone .btn:focus-visible{ outline:2px solid #3b82f6; outline-offset:2px; }
body[data-theme="dark"] .dropzone .btn{ background:#ffffff; color:#0b1220; border-color:#9db9ff; }
@media (max-width: 480px){
  .dropzone .btn{ font-size:16px; padding:12px 16px; min-width:110px; }
  .drop-inner strong{ font-size:15px; }
  .dz-note, .dz-subnote{ font-size:12px; }
}

/* Chips / stats */
.stats-row{ display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
.chip{
  background:#eef3ff; border:1px solid var(--line); color:#1b2234;
  padding:6px 10px; border-radius:999px; font-size:12px;
}
.chip.soft{ background:#f8fafc; }
body[data-theme="dark"] .chip{ background:#111627; color:#dbe6ff; border-color:#2b3347; }

/* Progress */
.status{ font-size:13px; color:var(--muted); margin-bottom:6px; }
progress{ width:100%; height:10px; accent-color:var(--accent) }

/* Table */
.table-wrap{ overflow:auto; border-radius:12px; }
.table-header{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.table-header .lh{ display:flex; align-items:center; gap:10px; }
.inline-label{ display:flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); }

table{ width:100%; border-collapse:collapse; }
th, td{ border-bottom:1px solid var(--line); padding:10px; font-size:13px; vertical-align:top; }
body[data-theme="dark"] th, body[data-theme="dark"] td{ border-bottom-color:var(--line-dark); }
th{ background:#f6f8fd; color:#28324a; text-align:left; }
body[data-theme="dark"] th{ background:var(--panel-dark); color:#cbd2e1; }
td:nth-child(3){ text-align:right; } /* hits */
a{ color:var(--accent); text-decoration:none }
a:hover{ text-decoration:underline }

/* Footer */
.site-footer{ background:transparent; }
.footer-wrap{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 0; color:var(--muted); font-size:13px;
}
.footer-wrap a{ color:var(--accent); }
.footer-wrap a:hover{ text-decoration:underline; }

.impact{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end; /* keeps them aligned with the right column */
}

.btn.hold[data-state="holding"] .label{ filter: brightness(1.05); }

/* Keep the impact chips on the same row/baseline as Min hits */
.grid.two.compact > .impact{
  display:flex;
  align-items:center;   /* vertical-centers against the input */
  gap:10px;
  margin-top: 4px;      /* tiny nudge to visually align; adjust 0–6px if your fonts shift */
  justify-content:flex-end;
  flex-wrap:wrap;
}

.run-demo {
  margin-left: auto;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  align-self: center;
  text-decoration: none;
  user-select: none;
}

.run-demo:hover {
  text-decoration: underline;
}

.pageid-scraper-logo {
  max-height:52px;
  margin-bottom:10px;
}