/* ===== Fonts: served from frontend/fonts (variable fonts: one file per family covers every weight) =====
   font-display: block = never paint a stand-in font first; the files are preloaded in each page's <head>. */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: block;
  src: url('../fonts/nunito-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 400 800;
  font-display: block;
  src: url('../fonts/baloo2-latin.woff2') format('woff2');
}

/* ===== Design tokens — PLAN.md Section 5 ke colors ===== */
:root {
  --bg: #FBF7F0;         /* page background: warm cream */
  --ink: #2D2A3E;        /* main text */
  --muted: #6E6884;      /* halka text (descriptions) */
  --card: #FFFFFF;       /* cards ka white */
  --line: #EDE6DA;       /* borders */
  --brand: #6A5AE0;      /* violet accent */
  --brand-soft: #EFE9FB; /* violet ka pastel */

  /* Sidebar palette (deep navy-violet). Change these five to restyle the whole sidebar. */
  --side-bg: #26214A;
  --side-ink: #EDEAF7;
  --side-muted: #B9B3D6;
  --side-line: rgba(255, 255, 255, 0.12);
  --side-hover: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  background:
    radial-gradient(900px 550px at 85% -10%, #E4D9FA 0%, transparent 60%),
    radial-gradient(800px 500px at -10% 25%, #FDDCD4 0%, transparent 55%),
    radial-gradient(750px 480px at 50% 115%, #CDEFE9 0%, transparent 55%),
    radial-gradient(650px 420px at 110% 70%, #FAEBBC 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}


/* ===== Header bar ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 40px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }

.nav { display: flex; gap: 8px; margin: 0 auto; }   /* centred between brand and avatar */

.nav-link {
  padding: 8px 18px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}
.nav-link:hover { background: #F1EBE1; }
.nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 800; }

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 20px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FDE8E4;
  color: #E8604C;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

/* ===== Top bar profile menu ===== */
.avatar-menu { position: relative; }   /* dropdown is positioned against this box */

/* The top-bar avatar is a <button>: drop the browser's button look, keep the circle, add a soft ring */
button.avatar {
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px transparent;
  transition: box-shadow .15s ease, transform .15s ease;
}
button.avatar:hover { transform: scale(1.06); box-shadow: 0 0 0 2px #fff, 0 0 0 4px #F8C9BF; }
button.avatar[aria-expanded="true"],
button.avatar:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand); }

.avatar-dropdown {
  position: absolute;
  top: calc(100% + 14px);   /* just below the avatar */
  right: 0;                 /* right edges aligned, so it never runs off-screen */
  width: 272px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 10px rgba(45, 42, 62, .06), 0 20px 48px rgba(45, 42, 62, .16);
  z-index: 110;             /* above the sidebar (100) and the mobile header (90) */
  transform-origin: top right;
  animation: dropdown-in .16s ease-out;
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
/* Small arrow pointing up at the avatar */
.avatar-dropdown::before {
  content: '';
  position: absolute;
  top: -7px;
  right: 13px;
  width: 12px;
  height: 12px;
  background: #EFE9FB;      /* same as the header's right end */
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-top-left-radius: 3px;
  transform: rotate(45deg);
}

/* Header: big avatar + name + email on a warm pastel gradient */
.dropdown-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  border-radius: 17px 17px 0 0;
  background: linear-gradient(90deg, #FDE8E4 0%, #EFE9FB 100%);
  border-bottom: 1px solid var(--line);
}
.avatar-lg { width: 44px; height: 44px; font-size: 16px; flex-shrink: 0; box-shadow: 0 0 0 3px #fff; }
.dropdown-who { min-width: 0; }   /* lets a long email shrink and show an ellipsis */
.dropdown-name { font-weight: 800; font-size: 15px; }
.dropdown-mail {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Menu rows: icon tile + label + chevron */
.dropdown-list { padding: 6px; }
.dropdown-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.dropdown-link::after {   /* chevron on the right */
  content: '\203A';
  margin-left: auto;
  color: #A79FB8;
  font-size: 20px;
  line-height: 1;
}
.dropdown-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s ease, color .12s ease;
}
.dropdown-link:hover { background: var(--brand-soft); color: var(--brand); }
.dropdown-link:hover .dropdown-icon, .dropdown-link:hover::after { background: #fff; color: var(--brand); }
.dropdown-logout:hover { background: #FDE8E4; color: #E8604C; }
.dropdown-logout:hover .dropdown-icon, .dropdown-logout:hover::after { color: #E8604C; }

/* ===== Page container ===== */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px;
}

/* ===== Welcome headline ===== */
.hero h1 {
  margin: 0 0 6px 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 34px;
}

.hero p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

/* ===== Search + filters row ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  width: 300px;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--ink);
  width: 100%;
}

.search-box input::placeholder { color: #A79FB8; }

.filters { display: flex; gap: 8px; }

.filter-pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 13px;
  border: 1.5px solid var(--line);
  cursor: pointer;
}

.filter-pill:hover { border-color: var(--brand); }

.filter-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}
/* ===== Tool cards grid ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(45, 42, 62, 0.12);
}

.tool-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--tool-bg);
  color: var(--tool-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-name {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 17px;
}

.tool-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  flex-grow: 1;
}

.tool-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #A79FB8;
}
/* Card poora clickable — link ko card ke upar phaila do, text gayab */
.tool-card { position: relative; }

.tool-foot a {
  position: absolute;
  inset: 0;
  font-size: 0;
  color: transparent;
  border-radius: 18px;
}
.tool-foot a:focus-visible { outline: 3px solid var(--brand); }

.tool-foot a:hover { text-decoration: underline; }
/* ===== Dashboard: dark scene + tool grid ===== */
body.dash-dark {
  color: #FFFFFF;
  background:
    radial-gradient(760px 440px at 50% 60%, color-mix(in srgb, var(--brand) 38%, transparent) 0%, transparent 70%),
    radial-gradient(900px 600px at 50% 120%, rgba(255, 255, 255, 0.06) 0%, transparent 60%),
    linear-gradient(180deg, #221E3A 0%, #17142A 55%, #0F0D1C 100%);
  background-attachment: fixed;
}
/* white surfaces keep dark text: the sidebar and the profile card */
body.dash-dark .avatar-dropdown { color: var(--ink); }
/* top bar becomes glass on the dark scene */
body.dash-dark .topbar, body.tool-band .topbar { background: transparent; border-bottom-color: transparent; }
body.dash-dark .topbar .brand-name, body.tool-band .topbar .brand-name { color: #FFFFFF; }
body.dash-dark .nav, body.tool-band .nav { padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); }
body.dash-dark .nav-link, body.tool-band .nav-link { color: rgba(255, 255, 255, 0.75); }
body.dash-dark .nav-link:hover, body.tool-band .nav-link:hover { background: rgba(255, 255, 255, 0.10); color: #FFFFFF; }
body.dash-dark .nav-link.active, body.tool-band .nav-link.active { background: rgba(255, 255, 255, 0.18); color: #FFFFFF; }
body.dash-dark .side-open, body.tool-band .side-open { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); color: #FFFFFF; }
body.dash-dark .mobile-top, body.tool-band .mobile-top { background: rgba(23, 20, 42, 0.85); border-bottom-color: rgba(255, 255, 255, 0.10); color: #FFFFFF; }
body.dash-dark .mobile-top .menu-btn, body.tool-band .mobile-top .menu-btn { color: #FFFFFF; border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); }
body.dash-dark .mobile-top .brand-name, body.tool-band .mobile-top .brand-name { color: #FFFFFF; }

.dash { padding-top: 6px; }
/* the card grid, with the toolbar above it */
.dash .toolbar { margin-top: 14px; }
.dash .toolbar .search-box { width: 300px; }
.grid-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-title { margin: 0; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 26px; color: #FFFFFF; }
.btn-small { padding: 8px 14px; font-size: 13px; }
body.dash-dark .btn-ghost { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); color: #FFFFFF; }
body.dash-dark .filter-pill { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.8); }
body.dash-dark .filter-pill.active { background: #FFFFFF; color: var(--brand); border-color: #FFFFFF; }
body.dash-dark .dash .toolbar .search-box { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.16); }
body.dash-dark .dash .toolbar .search-box input { color: #FFFFFF; }

/* ===== Dark scene for content pages (Settings, History): cards become dark glass, text goes light ===== */
body.dash-dark .hero h1 { color: #FFFFFF; }
body.dash-dark .hero p { color: rgba(255, 255, 255, 0.62); }
body.dash-dark .step-card, body.dash-dark .hist-card, body.dash-dark .settings-nav {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  backdrop-filter: blur(6px);
}
body.dash-dark .card-title, body.dash-dark .step-title, body.dash-dark .who-name, body.dash-dark .hist-name, body.dash-dark .hist-items { color: #FFFFFF; }
body.dash-dark .card-sub, body.dash-dark .field-note, body.dash-dark .opt-hint, body.dash-dark .who-mail, body.dash-dark .hist-when,
body.dash-dark .hist-count, body.dash-dark .hist-empty, body.dash-dark .empty-row td { color: rgba(255, 255, 255, 0.62); }
body.dash-dark .hist-header span, body.dash-dark .hist-muted { color: rgba(255, 255, 255, 0.45); }
body.dash-dark .field-label, body.dash-dark .opt-label { color: #FFFFFF; }
body.dash-dark .who, body.dash-dark .opt-row, body.dash-dark .hist-row, body.dash-dark .hist-foot { border-color: rgba(255, 255, 255, 0.10); }
body.dash-dark .avatar-xl { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14); }

/* inputs */
body.dash-dark .text-field { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.14); color: #FFFFFF; }
body.dash-dark .text-field::placeholder { color: rgba(255, 255, 255, 0.38); }
body.dash-dark .text-field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(106, 90, 224, 0.35); }
body.dash-dark .text-field[readonly] { color: rgba(255, 255, 255, 0.75); }
body.dash-dark .sub-box { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.18); }
body.dash-dark .knob { background: rgba(255, 255, 255, 0.22); }
body.dash-dark .switch input:checked + .knob { background: #3FA65B; }

/* settings side navigation */
body.dash-dark .settings-tab { color: rgba(255, 255, 255, 0.7); }
body.dash-dark .settings-tab:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
body.dash-dark .settings-tab.active { background: rgba(106, 90, 224, 0.35); color: #FFFFFF; }

/* history controls: segmented view switch, search, selects, pager, row buttons */
body.dash-dark .seg { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); }
body.dash-dark .seg-btn { color: rgba(255, 255, 255, 0.7); }
body.dash-dark .seg-btn.active { background: var(--brand); color: #FFFFFF; }
body.dash-dark .search-box { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.14); }
body.dash-dark .search-box input { color: #FFFFFF; }
body.dash-dark .search-box input::placeholder { color: rgba(255, 255, 255, 0.38); }
body.dash-dark .select-pill, body.dash-dark .pager-btn, body.dash-dark .icon-btn {
  background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.8);
}
body.dash-dark .icon-btn:hover, body.dash-dark .pager-btn:hover:not(:disabled) { border-color: #FFFFFF; color: #FFFFFF; }
body.dash-dark .icon-btn.danger { color: #FFB4A8; }
body.dash-dark .pager-btn:disabled { color: rgba(255, 255, 255, 0.3); }
body.dash-dark .hist-progress { background: rgba(255, 255, 255, 0.12); }
body.dash-dark .hist-note { color: #FFB4A8; }
body.dash-dark .hist-row:not(.hist-header):hover { background: rgba(255, 255, 255, 0.04); }

/* ===== Tool + results pages: the tool colour paints one band (top bar + hero) and a pastel tint below it ===== */
body.tool-band {
  --band-h: 340px;   /* tool-page.js / results-page.js set the real value: the bottom edge of the hero */
  background:
    radial-gradient(circle at 12% 100%, rgba(255, 255, 255, 0.10) 0 90px, transparent 91px) 0 0 / 100% var(--band-h) no-repeat,
    radial-gradient(circle at 78% 0%, transparent 0 110px, rgba(255, 255, 255, 0.16) 111px 122px, transparent 123px) 0 0 / 100% var(--band-h) no-repeat,
    linear-gradient(165deg, rgba(255, 255, 255, 0.12) 0%, rgba(22, 14, 42, 0.40) 100%) 0 0 / 100% var(--band-h) no-repeat,
    linear-gradient(var(--tool-color, var(--brand)), var(--tool-color, var(--brand))) 0 0 / 100% var(--band-h) no-repeat,
    radial-gradient(900px 550px at 85% 20%, color-mix(in srgb, var(--tool-color, var(--brand)) 30%, white) 0%, transparent 60%),
    radial-gradient(800px 500px at -10% 60%, color-mix(in srgb, var(--tool-color, var(--brand)) 22%, white) 0%, transparent 55%),
    radial-gradient(750px 480px at 50% 115%, color-mix(in srgb, var(--tool-color, var(--brand)) 18%, white) 0%, transparent 55%),
    color-mix(in srgb, var(--tool-color, var(--brand)) 9%, white);
  background-attachment: scroll;   /* the band belongs to the page, so it scrolls with it */
}
/* the hero is no longer a card: its content sits straight on the band */
body.tool-band .tool-hero { background: none; box-shadow: none; border: 0; overflow: visible; padding-top: 8px; }
body.tool-band .side-open { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.35); color: #FFFFFF; }
body.tool-band .mobile-top { background: rgba(0, 0, 0, 0.18); }

/* ===== Login / signup on the dark scene: the card becomes dark glass ===== */
body.auth-body.dash-dark { background-attachment: fixed; }
body.dash-dark .auth-card { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); backdrop-filter: blur(8px); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35); }
body.dash-dark .auth-logo .brand-name, body.dash-dark .auth-title { color: #FFFFFF; }
body.dash-dark .auth-sub, body.dash-dark .auth-note, body.dash-dark .auth-divider { color: rgba(255, 255, 255, 0.62); }
body.dash-dark .auth-divider::before, body.dash-dark .auth-divider::after { background: rgba(255, 255, 255, 0.14); }
body.dash-dark .auth-note a, body.dash-dark .auth-card a { color: #C9C0FF; }
body.dash-dark .error-msg { color: #FFB4A8; }
body.dash-dark .auth-notice { background: rgba(106, 90, 224, 0.28); color: #FFFFFF; }
body.dash-dark .auth-card .btn-ghost { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); color: #FFFFFF; }

/* ===== Confirm dialog (log out) ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 13, 28, 0.62); backdrop-filter: blur(4px);
}
.modal {
  width: 100%; max-width: 380px; padding: 24px;
  background: rgba(38, 33, 74, 0.97); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 18px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45); color: #FFFFFF;
  animation: modal-in .18s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-title { margin: 0; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 22px; }
.modal-text { margin: 8px 0 20px 0; font-size: 14px; color: rgba(255, 255, 255, 0.7); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal .btn-ghost { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); color: #FFFFFF; }

/* Run pressed without a usable Scraper Agent (tool page): the Log out dialog's shape, a little wider for its text,
   in light amber with a red heading - a warning and a choice to make, not an error */
.modal.modal-warn { max-width: 440px; padding: 22px 24px; background: #FFF6E8; border: 1px solid #F3C98B;
                    border-top: 4px solid #F59E0B; color: #4A3418; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.30); }
.modal-warn-head { display: flex; align-items: flex-start; gap: 10px; }
.modal-warn-icon { flex: none; width: 26px; height: 26px; margin-top: 2px; color: #E08600; }
.modal-warn .modal-title { font-size: 20px; line-height: 1.3; color: #C62828; }
.modal-warn .modal-text { margin: 8px 0 18px 0; font-size: 14px; line-height: 1.55; color: #5C4325; }
.modal-warn .modal-actions { flex-wrap: wrap; align-items: center; }
.modal-warn .btn-ghost { background: #FFFFFF; border-color: #E8C690; color: #6B4E2A; }
.modal-warn a.btn-ghost { display: inline-flex; align-items: center; text-decoration: none; }

/* ===== Tool page ===== */
.page-narrow { max-width: 820px; }

.tool-title {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 28px;
}

.tool-sub {
  margin: 2px 0 0 0;
  font-size: 14px;
  color: var(--muted);
}
/* ===== Tool page: hero banner ===== */
.tool-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  margin-bottom: 16px;
  border-radius: 18px;
  color: #FFFFFF;
  /* same layered gradient as the home cards, painted over the tool's own colour */
  background:
    radial-gradient(circle at 10% 105%, rgba(255,255,255,0.10) 0 65px, transparent 66px),
    radial-gradient(circle at 72% -14%, transparent 0 78px, rgba(255,255,255,0.16) 79px 86px, transparent 87px),
    radial-gradient(140% 90% at 100% 0%, rgba(255,255,255,0.22) 0%, transparent 45%),
    linear-gradient(165deg, rgba(255,255,255,0.10) 0%, rgba(22,14,42,0.52) 100%),
    var(--tool-color, var(--brand));
}

.hero-back {
  align-self: flex-start;
  font-weight: 700;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}
.hero-back:hover { color: #FFFFFF; text-decoration: underline; }

.hero-head { display: flex; align-items: center; gap: 16px; }

.hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-hero .tool-title { color: #FFFFFF; }
.tool-hero .tool-sub   { color: rgba(255, 255, 255, 0.85); }

.hero-meta  { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero-label { font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, 0.75); margin-right: 4px; }
.hero-cols  { display: flex; flex-wrap: wrap; gap: 8px; }

.hero-col {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 800;
  font-size: 12px;
}

.hero-mode {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
}

/* ===== Tool page: work card (input + options + run) ===== */
.work-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.work-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.work-head .tabs { margin-bottom: 0; }
.work-divider { height: 1px; background: var(--line); }
.work-card .run-row { margin-top: 0; justify-content: space-between; }
.work-card .count { color: var(--tool-color, var(--brand)); }   /* counter wears the tool colour */

.hint-right a { color: var(--brand); font-weight: 800; text-decoration: none; }
.hint-right a:hover { text-decoration: underline; }

/* Option label + small helper line under it */
.opt-text { display: flex; flex-direction: column; gap: 3px; }
.opt-hint { font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  .tool-hero { padding: 20px; }
  .hero-mode { margin-left: 0; }
  .work-head { flex-wrap: wrap; }
}

/* ===== Step cards (tool page) ===== */
.step-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 16px;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.step-title {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 18px;
}

.hidden { display: none !important; }   /* must beat later display:flex rules (e.g. .tabs) */

/* ===== Tabs ===== */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }

.tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

/* ===== Paste pane ===== */
.list-input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  background: #FDFBF7;
  resize: vertical;
}
.list-input:focus { outline: none; border-color: var(--brand); }

/* Lat/Long adds one row at a time: the two fields sit on a line with the
   button, and every added row is listed below them. */
.row-form { display: flex; gap: 12px; align-items: flex-end; }
.row-field { flex: 1; min-width: 0; }
.row-field-wide { flex: 1.6; }
.row-add { white-space: nowrap; }

.bulk-panel {
  margin-top: 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #FDFBF7;
}
.bulk-actions { display: flex; gap: 8px; margin-top: 10px; }

/* The rows that will actually run. Long lists scroll instead of pushing the
   Run button off the screen. */
.row-list-box { max-height: 260px; overflow-y: auto; margin-top: 4px; }
.pair-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pair-table td { padding: 6px; border-top: 1px solid var(--line); vertical-align: top; }
.pair-table tr:first-child td { border-top: none; }
.pair-num { width: 26px; color: #A79FB8; font-weight: 800; }
.pair-name { width: 32%; font-weight: 800; }
.pair-empty { color: #A79FB8; font-weight: 400; font-style: italic; }
.row-remove { width: 34px; text-align: right; }

.row-line { cursor: pointer; }
.row-line:hover td { background: #FBF7F0; }
.row-line.editing td { background: #EFE9FB; }

body.dash-dark .bulk-panel { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.14); }
body.dash-dark .pair-table td { border-top-color: rgba(255, 255, 255, 0.12); color: #FFFFFF; }
body.dash-dark .pair-num, body.dash-dark .pair-empty { color: rgba(255, 255, 255, 0.45); }
body.dash-dark .row-line:hover td { background: rgba(255, 255, 255, 0.06); }
body.dash-dark .row-line.editing td { background: rgba(106, 90, 224, 0.28); }

@media (max-width: 720px) {
  .row-form { flex-direction: column; align-items: stretch; }
}

.input-hint {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
}

.count { font-weight: 800; color: var(--brand); }
.hint-right { color: #A79FB8; }

/* ===== Upload pane ===== */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 32px;
  cursor: pointer;
  text-align: center;
  color: var(--muted);
}
.dropzone:hover { border-color: var(--brand); color: var(--brand); }

.drop-title { font-weight: 800; font-size: 14px; color: var(--ink); }
.drop-sub { font-size: 12px; color: #A79FB8; }
.drop-file { font-size: 13px; font-weight: 800; color: var(--brand); }

/* ===== Single URL field (Trip.com Data) ===== */
.field-label {
  display: block;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 8px;
}

.text-field {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #FDFBF7;
}
.text-field:focus { outline: none; border-color: var(--brand); }

/* ===== Country pills (Cards & Banks, Paste list tab) ===== */
.countries-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.countries-head .field-label { margin-bottom: 0; }
.countries-actions { display: flex; gap: 6px; }
.countries-actions .btn-ghost { padding: 4px 10px; font-size: 12px; }

.country-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.country-pill {
  border: 1.5px solid var(--line);
  background: #FDFBF7;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 13px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.country-pill:hover { border-color: var(--tool-color, var(--brand)); color: var(--ink); }
.country-pill.on {
  background: var(--tool-color, var(--brand));
  border-color: var(--tool-color, var(--brand));
  color: #FFFFFF;
}
body.dash-dark .country-pill { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.75); }
body.dash-dark .country-pill.on { color: #FFFFFF; }

/* ===== Options card ===== */
.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.opt-row:last-child { border-bottom: none; }

.opt-label { font-weight: 700; font-size: 14px; }

.no-options { margin: 0; color: var(--muted); font-size: 14px; }

.num-field { width: 90px; text-align: center; }
.date-field { width: 170px; flex-shrink: 0; padding: 10px 12px; }
body.dash-dark .date-field { color-scheme: dark; }   /* the calendar popup follows the dark theme */
/* Two dates in one row (check-in, check-out), each with its small name above it */
.date-pair { display: flex; gap: 12px; flex-wrap: wrap; }
.date-cell { display: flex; flex-direction: column; gap: 4px; }
.date-caption { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ===== Settings page: field layout ===== */
.field-gap { height: 14px; }
.field-gap-top { margin-top: 14px; }
.field-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.inline-row { display: flex; align-items: center; gap: 10px; }
.inline-row .text-field { flex: 1; min-width: 0; }
.inline-row .btn-ghost, .inline-row .btn-primary { flex-shrink: 0; white-space: nowrap; }
.inline-row .field-note { margin-top: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }   /* 2 or 3 boxes: fits either, wraps on phones */
.sub-box { margin-top: 14px; padding: 16px; border: 1.5px dashed var(--line); border-radius: 14px; background: var(--bg); }

/* ===== Settings page: section navigation on the left, cards on the right ===== */
.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  max-width: 1040px;
}
.settings-nav {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.settings-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.settings-tab svg { flex-shrink: 0; }
.settings-tab:hover { background: #F1EBE1; color: var(--ink); }
.settings-tab.active { background: var(--brand-soft); color: var(--brand); }
.settings-panels { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Card header: title + one-line description on the left, the card's own button on the right */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.card-title { margin: 0; font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 20px; }
.card-sub { margin: 4px 0 0 0; font-size: 13px; color: var(--muted); }
.card-head .btn-primary { flex-shrink: 0; white-space: nowrap; }
.card-foot { margin-top: 14px; min-height: 18px; }

/* Profile card: big avatar + name + email */
.who { display: flex; align-items: center; gap: 14px; padding: 4px 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; flex-shrink: 0; box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 4px var(--line); }
.who-name { font-weight: 800; font-size: 16px; }
.who-mail { font-size: 13px; color: var(--muted); word-break: break-all; }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-tab { white-space: nowrap; }
  .card-head { flex-wrap: wrap; }
}

/* ===== Toggle switch ===== */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }

.knob {
  position: absolute;
  inset: 0;
  background: #D9D2C7;
  border-radius: 999px;
  transition: background .15s;
  cursor: pointer;
}
.knob::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  top: 3px;
  left: 3px;
  transition: left .15s;
}
.switch input:checked + .knob { background: #3FA65B; }
.switch input:checked + .knob::before { left: 21px; }

/* ===== Run button ===== */
.run-row { display: flex; align-items: center; gap: 14px; margin-top: 20px; }

.run-btn {
  border: none;
  border-radius: 14px;
  padding: 14px 28px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #FFFFFF;
  cursor: pointer;
}
.run-btn:disabled { opacity: .5; cursor: not-allowed; }
.run-btn:hover { filter: brightness(0.93); }

.run-note { font-size: 13px; color: var(--muted); }
/* Scraper Agent box on the tool page: green = the user's PC is ready, amber = start the agent first */
.agent-note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 20px; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.agent-note .agent-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.agent-note.online { background: #E3F4E8; color: #23703A; }
.agent-note.online .agent-dot { background: #3FA65B; }
.agent-note.offline { background: #FDEEDF; color: #B55A12; }
.agent-note.offline .agent-dot { background: #EF8A3C; animation: pulse 1s infinite; }
/* Connecting a PC: the button sits at the end of the agent line, the code appears under it */
.agent-note-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.agent-connect { padding: 7px 14px; font-size: 13px; flex-shrink: 0; align-self: flex-start; }
.agent-buttons { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; align-self: flex-start; }
a.agent-connect { text-decoration: none; display: inline-flex; align-items: center; }
.agent-buttons { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; align-self: flex-start; }
a.agent-connect { text-decoration: none; display: inline-flex; align-items: center; }
.pair-box { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pair-code { font-family: 'Baloo 2', sans-serif; font-size: 30px; font-weight: 800; letter-spacing: 0.16em; line-height: 1.1; }
.pair-hint { font-size: 12.5px; font-weight: 700; opacity: .85; }
/* Settings: one row per connected PC */
.agent-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.agent-row:last-child { border-bottom: 0; }
.agent-live { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #3FA65B; margin-left: 6px; }
body.dash-dark .agent-live { color: #7ED79A; }
.agent-old { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #B55A12; margin-left: 6px; }
body.dash-dark .agent-old { color: #F4B27A; }

/* ===== Results page: same hero + work card as the tool page ===== */
.hero-head-run { flex-wrap: wrap; }
.hero-titles { flex: 1; min-width: 200px; }
.hero-actions { display: flex; align-items: center; gap: 10px; }
.tool-hero .status-pill { background: rgba(255, 255, 255, 0.22); color: #FFFFFF; }
.tool-hero .dot { background: #FFFFFF; }
.hero-btn {
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}
.hero-btn:hover { background: rgba(255, 255, 255, 0.24); }

.work-card .alert { margin-bottom: 0; }
.work-card .pct { font-family: 'Baloo 2', sans-serif; font-size: 22px; color: var(--tool-color, var(--brand)); }
.work-card .progress-fill { background: var(--tool-color, var(--brand)); }
/* Progress: a ring spinner next to the title while the run is alive; a check / cross / square when it is over */
.step-title .spin { display: inline-block; width: 16px; height: 16px; margin-left: 10px; vertical-align: -2px; border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--tool-color, var(--brand)) 25%, transparent); border-top-color: var(--tool-color, var(--brand));
  animation: spin .8s linear infinite; }
.step-title .spin.wait { border-color: rgba(239, 138, 60, 0.25); border-top-color: #EF8A3C; animation-duration: 1.6s; }
.step-title .spin.ok, .step-title .spin.bad, .step-title .spin.stop { animation: none; border: none; border-radius: 0; font-size: 15px; font-weight: 800; line-height: 16px; text-align: center; }
.step-title .spin.ok::before { content: '\2713'; color: #3FA65B; }
.step-title .spin.bad::before { content: '\2715'; color: #E8604C; }
.step-title .spin.stop::before { content: '\25A0'; color: #EF8A3C; font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }
/* The bar shows REAL progress: the width eases to each new value, and while the run is alive slow diagonal
   stripes ride on the fill at a constant speed. At 0% nothing is measured yet, so a segment slides along the
   track instead (indeterminate). amber = waiting or stuck, red = failed */
.work-card .progress-fill { transition: width 1.2s cubic-bezier(.22, .61, .36, 1); }
.work-card .progress-fill.live {
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.28) 0 10px, transparent 10px 20px);
  background-size: 28.28px 28.28px;   /* one stripe pair along the x axis at 45 degrees */
  animation: stripes 1s linear infinite;
}
@keyframes stripes { from { background-position: 0 0; } to { background-position: 28.28px 0; } }
.work-card .progress-track.indeterminate .progress-fill { width: 30% !important; transition: none; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(333%); } }
.work-card .progress-fill.warn { background: #EF8A3C; }
.work-card .progress-fill.bad { background: #E8604C; }
.count-wrap { display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.since { font-size: 12px; font-weight: 700; color: var(--muted); }
.since:empty { display: none; }
.run-alert { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 14px; border-radius: 12px; font-size: 13px; font-weight: 700; line-height: 1.45; }
.run-alert .msg { white-space: pre-wrap; word-break: break-word; }
.run-alert.warn { background: #FDEEDF; color: #B55A12; }
.run-alert.bad { background: #FDE8E4; color: #B23A2A; }
/* Run found lines that are not the tool's kind of input: the list under the input (tool page) */
.input-problem { margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: #FDE8E4; color: #B23A2A; font-size: 13px; line-height: 1.5; }
.input-problem-list { margin: 6px 0 0; padding-left: 18px; font-weight: 600; word-break: break-word; }
.input-problem-list li + li { margin-top: 2px; }
.input-problem-actions { margin-top: 10px; }
/* Run pressed while the Scraper Agent is offline or out of date: a red box asks first (tool page) */
@media (prefers-reduced-motion: reduce) { .step-title .spin, .work-card .progress-fill.live, .work-card .progress-track.indeterminate .progress-fill { animation: none; } }
.work-card .progress-row { align-items: center; flex-wrap: wrap; gap: 10px; }
.work-card .chips { margin-top: 0; flex-wrap: wrap; }
.work-sub { font-size: 13px; font-weight: 700; color: var(--muted); }
.empty-row td { color: var(--muted); text-align: center; padding: 22px 8px; }
.run-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.work-card .run-btn { background: var(--tool-color, var(--brand)); padding: 12px 22px; font-size: 15px; }

/* ===== Results page ===== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
}
.st-run  { background: #E5F0FB; color: #3E8FDD; }
.st-done { background: #E3F4E8; color: #3FA65B; }
.st-warn { background: #FDEEDF; color: #EF8A3C; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #3E8FDD; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #FDEEDF;
  border: 1.5px solid #EF8A3C;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}

.progress-track { height: 10px; border-radius: 999px; background: #F1EBE1; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--brand); border-radius: 999px; transition: width 0.4s ease; }
.progress-row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; }
.pct { font-weight: 800; color: var(--muted); }

.chips { display: flex; gap: 8px; margin-top: 12px; }
.chip { padding: 5px 12px; border-radius: 999px; font-weight: 800; font-size: 12px; }
.chip-ok   { background: #E3F4E8; color: #3FA65B; }
.chip-warn { background: #FBF2D7; color: #D9A414; }
.chip-bad  { background: #FDE8E4; color: #E8604C; }

.results-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.results-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #A79FB8;
  padding: 0 8px 10px 8px;
  border-bottom: 1px solid var(--line);
}
.results-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.results-table tr:last-child td { border-bottom: none; }

.row-pill { padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 11px; white-space: nowrap; }
.pill-ok   { background: #E3F4E8; color: #3FA65B; }
.pill-warn { background: #FBF2D7; color: #D9A414; }
.pill-bad  { background: #FDE8E4; color: #E8604C; }

.btn-primary {
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  background: var(--brand);
  color: #FFFFFF;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(0.93); }

.btn-ghost {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 22px;
  background: var(--card);
  color: var(--muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ===== History page ===== */
.runs { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

.run-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
}

.run-icon { width: 40px; height: 40px; border-radius: 12px; }

.run-info { flex-grow: 1; }
.run-name { font-weight: 800; font-size: 15px; }
.run-num  { color: #A79FB8; font-weight: 700; font-size: 13px; }
.run-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; text-decoration: none; }

.st-bad { background: #FDE8E4; color: #E8604C; }

/* ===== History page: table ===== */
.page-wide { max-width: 1080px; }

.hist-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); }
.seg-btn { padding: 7px 16px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: none; }
.seg-btn.active { background: var(--brand); color: #FFFFFF; }

.toolbar-right { display: flex; gap: 8px; margin-left: auto; }
.select-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.hist-card { margin-top: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 8px 24px 16px 24px; }

.hist-row {
  display: grid;
  grid-template-columns: 2.2fr 0.9fr 1.6fr 1.1fr 1.4fr;
  gap: 12px;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}
.hist-header span { font-size: 11px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #A79FB8; }
.hist-header .right { text-align: right; }

.hist-tool { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hist-icon { width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.hist-icon svg { width: 18px; height: 18px; }
.hist-name { font-weight: 800; font-size: 14px; }
.hist-name .run-num { font-size: 12px; }
.hist-when { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hist-items { font-size: 13px; font-weight: 700; }

.hist-result { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.hist-result .chip { padding: 3px 9px; font-size: 11px; }
.hist-note { font-size: 12px; color: #E8604C; font-weight: 700; }
.hist-muted { font-size: 11px; color: #A79FB8; font-weight: 700; white-space: nowrap; }
.hist-progress { flex-grow: 1; height: 8px; border-radius: 999px; background: #F1EBE1; overflow: hidden; }
.hist-progress div { height: 100%; border-radius: 999px; background: #3E8FDD; }

.hist-row .status-pill { padding: 5px 12px; font-size: 12px; justify-self: start; }

.hist-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn.danger { color: #E8604C; }
.icon-btn.danger:hover { border-color: #E8604C; }

.hist-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 0 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.hist-count { font-size: 12.5px; color: var(--muted); }
.pager { display: flex; gap: 6px; }
.pager-btn {
  padding: 6px 12px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}
.pager-btn:disabled { color: #A79FB8; cursor: default; }
.hist-empty { padding: 28px 8px; text-align: center; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .hist-head { flex-wrap: wrap; }
  .toolbar-right { margin-left: 0; }
  .hist-header { display: none; }
  .hist-row { grid-template-columns: 1fr; gap: 8px; }
  .hist-actions { justify-content: flex-start; }
}

/* ===== Auth pages (login/signup) ===== */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-wrap { width: 100%; max-width: 400px; padding: 24px; }

.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-title {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 26px;
  text-align: center;
}

.auth-sub {
  margin: 4px 0 22px 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.field { margin-bottom: 14px; }

.btn-full { width: 100%; margin-top: 6px; }

.error-msg {
  color: #E8604C;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px 0;
}

.auth-note {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  margin: 18px 0 0 0;
}

/* "or" line between the form and the Google button */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px 0;
  color: #A79FB8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex-grow: 1; height: 1px; background: var(--line); }

.google-btn { display: flex; justify-content: center; min-height: 44px; }

/* "You are already logged in" notice on the auth pages */
.auth-notice {
  background: var(--brand-soft);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 4px;
  font-size: 14px;
}
.auth-notice p { margin: 0 0 12px 0; }
.auth-notice-actions { display: flex; gap: 8px; }
.auth-notice-actions .btn-primary { display: inline-block; text-decoration: none; }

/* While logged in, the card shows only the notice */
.auth-card.logged-in form,
.auth-card.logged-in .auth-divider,
.auth-card.logged-in .google-btn,
.auth-card.logged-in .auth-note { display: none; }
.fail-reason { color: #B3261E; font-size: 0.85em; }

/* Trip Images: gallery view */
.gallery-toggle {
  margin-left: 8px; padding: 2px 10px; font-size: 12px; cursor: pointer;
  border: 1px solid #ccc; border-radius: 6px; background: #fff;
}
.gallery-row td { background: #fafafa; padding: 10px; }
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.gallery-grid img {
  width: 100%; height: 90px; object-fit: cover; border-radius: 6px; display: block;
}

/* Inputs pe pyara focus glow */
.search-box:focus-within,
.list-input:focus,
.text-field:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Verification code screen */
.auth-sub-left { text-align: left; }
.code-field { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 8px; }
.ok-msg { color: #3FA65B; font-size: 13px; font-weight: 700; margin: 0 0 10px 0; }


/* Card hover: upar rang ki patti + icon halka sa jhoole */
.tool-card {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 20px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  color: #FFFFFF;
  background:
    radial-gradient(circle at 88% 12%, rgba(255,255,255,0.20) 0 46px, transparent 47px),
    radial-gradient(circle at 103% 48%, rgba(255,255,255,0.12) 0 30px, transparent 31px),
    radial-gradient(circle at 10% 105%, rgba(255,255,255,0.10) 0 65px, transparent 66px),
    radial-gradient(circle at 72% -14%, transparent 0 78px, rgba(255,255,255,0.16) 79px 86px, transparent 87px),
    radial-gradient(140% 90% at 100% 0%, rgba(255,255,255,0.22) 0%, transparent 45%),
    linear-gradient(165deg, rgba(255,255,255,0.10) 0%, rgba(22,14,42,0.52) 100%),
    var(--tool-color);
  transition: transform .15s ease, box-shadow .15s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(45, 42, 62, 0.30);
}

.tool-icon { transition: transform .15s ease; }
.tool-card:hover .tool-icon { transform: scale(1.08) rotate(-3deg); }

/* Buttons dabane par halka sa dab jayein */
.btn-primary, .btn-ghost, .run-btn, .filter-pill, .tab {
  transition: transform .12s ease, filter .12s ease,
              background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary:active, .btn-ghost:active, .run-btn:active { transform: scale(0.97); }

/* Table rows pe hover highlight */
.results-table tbody tr:hover td { background: var(--bg); }

/* Table ko scroll dena (Part 3 ka saathi) */
.table-wrap { overflow-x: auto; }
.results-table { min-width: 560px; }

/* ===== Responsive ===== */

/* Tablet / aadhi window */
@media (max-width: 900px) {
  .page { padding: 28px 24px; }
  .toolbar { flex-wrap: wrap; }
  .search-box { width: 100%; }
}

/* Phone */
@media (max-width: 640px) {
  .brand-name { font-size: 17px; }

  .page { padding: 20px 14px; }
  .hero h1 { font-size: 25px; }
  .hero p { font-size: 14px; }

  /* Filter pills ek line me, side scroll ke saath */
  .filters {
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .filter-pill { white-space: nowrap; flex-shrink: 0; }

  .step-card { padding: 18px; }
  .tool-title { font-size: 22px; }
  .run-row { flex-wrap: wrap; }
  .opt-row { flex-wrap: wrap; }

  .tabs { flex-wrap: wrap; }
  .dropzone { padding: 24px 14px; }

  /* History rows phone pe stack ho jayein */
  .run-item { flex-wrap: wrap; }
}
/* ===== Photo-style cards: white text + glass bar ===== */
.tool-icon {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  backdrop-filter: blur(4px);
}

.tool-name { color: #FFFFFF; }
.tool-desc { color: rgba(255, 255, 255, 0.85); }

/* Neeche wali "Explore Now" jaisi frosted bar */
.tool-tag { display: none; }

/* ===== Sidebar layout ===== */
body.has-sidebar { padding-left: 250px; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 250px;
  background: var(--side-bg);
  border-right: 1px solid var(--side-bg);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 14px;
  overflow-y: auto;         /* the whole sidebar scrolls as one, footer included */
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px 8px;
}

/* Group headers (Tools / History) */
.side-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.side-group summary::-webkit-details-marker { display: none; }
.side-group summary:hover { background: var(--side-hover); }

.side-group summary::after {
  content: '▸';
  color: var(--side-muted);
  transition: transform .15s ease;
}
.side-group[open] summary::after { transform: rotate(90deg); }
/* 'Tools' is a plain link back to the dashboard (no dropdown) */
a.side-top {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  color: inherit;
  text-decoration: none;
}
a.side-top:hover { background: var(--side-hover); }
a.side-top.active { background: var(--brand); color: #FFFFFF; }

/* Sub links */
.side-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 8px 0;
  padding-left: 12px;
}

.side-link {
  display: flex;            /* icon tile + label side by side */
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--side-muted);
  text-decoration: none;
}
.side-link:hover { background: var(--side-hover); color: #FFFFFF; }
.side-link.active { background: var(--brand); color: #FFFFFF; }

/* Tool icon in the sidebar: the dashboard card's SVG and colours in a small tile */
.side-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tool-bg);
  color: var(--tool-color);
}
.side-icon svg { width: 15px; height: 15px; }

/* ===== Sidebar footer: email, Profile (opens the profile card) and Role (later phase) ===== */
.side-profile {
  margin-top: auto;         /* short list: pushed to the bottom; long list: simply the last block, scrolls with it */
  flex-shrink: 0;
  background: var(--side-bg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0 6px;
  border-top: 1px solid var(--side-line);
}

/* One footer row: icon tile + text (a div for plain rows, a button for Profile) */
.side-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--side-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}
.side-meta-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.10);
  color: #C9C3E6;
}
.side-meta-icon svg { width: 14px; height: 14px; }
/* User block: avatar, name, email and the log-out button (same design as before) */
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 2px;   /* now the last row of the footer */
}
.profile-name { font-weight: 800; font-size: 13.5px; }
.profile-mail { font-size: 11.5px; color: var(--side-muted); word-break: break-all; }
.profile-mail:empty::before { content: '\00a0'; }   /* keeps the line's height before the email arrives, so the footer does not jump */
.logout-btn {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--side-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
}
.logout-btn:hover { background: rgba(232, 96, 76, 0.25); color: #FFB4A8; }

/* Settings row is a link; .active marks it on the Settings page */
.side-meta-link { text-decoration: none; transition: background .12s ease; }
.side-meta-link:hover { background: var(--side-hover); }
.side-meta-link.active { background: rgba(106, 90, 224, 0.35); color: #FFFFFF; }
.side-meta-link.active .side-meta-icon { background: rgba(255, 255, 255, 0.16); color: #FFFFFF; }
.side-meta-link::after { content: '\203A'; margin-left: auto; color: var(--side-muted); font-size: 18px; line-height: 1; }

/* Role row: a plain label for everyone; guard.js turns it into a link to the Roles page for admins */
.side-meta-soon { color: var(--side-muted); cursor: default; }
.side-role:not([href])::after { content: none; }
.side-role:not([href]):hover { background: none; }
.side-role[href]::after { margin-left: 6px; }   /* the pill keeps the auto margin, the chevron sits next to it */
.side-pill {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(106, 90, 224, 0.35);
  color: #DED6FA;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .3px;
}

/* ===== Sidebar open/close ===== */
.sidebar { transition: transform .22s ease, box-shadow .22s ease; }

/* Close button: right side of the sidebar header */
.side-close {
  margin-left: auto;
  width: 30px; height: 30px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--side-ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.side-close:hover { background: #F1EBE1; color: var(--ink); }

/* ☰ inside the top bar: desktop only, shown while the sidebar is collapsed */
.side-open {
  display: none;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-size: 18px;
  padding: 6px 12px;
  cursor: pointer;
}
.side-open:hover { background: #F1EBE1; }

/* Backdrop: dark layer behind the mobile drawer */
.side-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 30, .45);
  z-index: 95;
}

.mobile-top { display: none; }

.menu-btn {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-size: 18px;
  padding: 6px 12px;
  cursor: pointer;
}

/* ---- Desktop: collapse (state is remembered) ---- */
@media (min-width: 901px) {
  html.side-collapsed body.has-sidebar { padding-left: 0; }
  html.side-collapsed .sidebar { transform: translateX(-100%); }
  html.side-collapsed .side-open { display: inline-block; }
}

/* ---- Mobile: drawer ---- */
@media (max-width: 900px) {
  body.has-sidebar { padding-left: 0; padding-top: 58px; }
  body.side-locked { overflow: hidden; }   /* no page scroll while the drawer is open */

  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0, 0, 0, .25);
  }

  .side-backdrop.show { display: block; }

  .mobile-top {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 58px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    z-index: 90;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* ===== Logout button (sidebar profile) ===== */

/* ===== Roles: sidebar pill + Users page (admin) ===== */
.side-pill:empty { display: none; }   /* nothing to show until /api/me answers with the role */

.users-row { grid-template-columns: 2.2fr 1fr 1.6fr 1fr; }
.users-row .hist-actions .btn-ghost { padding: 8px 14px; }   /* Save + Delete fit side by side */
.btn-ghost.btn-danger { color: #E8604C; }
.btn-ghost.btn-danger:hover { border-color: #E8604C; color: #E8604C; }
body.dash-dark .btn-ghost.btn-danger { color: #FFB4A8; }
body.dash-dark .btn-ghost.btn-danger:hover { border-color: #FFB4A8; color: #FFB4A8; }
.card-actions { display: flex; gap: 10px; flex-shrink: 0; }   /* Cancel + Create side by side in the card header */
/* The dark-glass card is its own stacking context, so its open dropdown would paint UNDER the accounts card
   below it. Lifting the whole New user card above its neighbours fixes that. */
#new-user-card, #new-role-card { position: relative; z-index: 5; }
/* Same for the accounts card: its last rows' dropdowns open over the Roles card below it. Order = 5 > 4 > auto. */
#users-card { position: relative; z-index: 4; }
.role-select { width: auto; min-width: 110px; padding: 8px 12px; }

.tool-picker { position: relative; }
.tool-picker summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 13px;
  font-weight: 700;
}
.tool-picker summary::-webkit-details-marker { display: none; }
.tool-picker summary::after { content: ' \25BE'; color: var(--muted); }
.tool-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  max-height: 380px;   /* 11 tools + the search box fit without scrolling; more tools would scroll */
  overflow-y: auto;
}
.tool-picker-menu label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tool-picker-search {
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 2px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}
.tool-picker-search:focus { outline: none; border-color: var(--brand); }
.tool-picker-empty { font-size: 12px; color: var(--muted); padding: 2px 0; }

/* dark scene: solid dark surfaces so the open menu stays readable over the page */
body.dash-dark .tool-picker summary, body.dash-dark .tool-picker-menu, body.dash-dark .role-select {
  background: #2A2450;
  border-color: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}
/* The native dropdown list inherits the select's dark background on Windows, so its options must be light too.
   color-scheme: dark asks the browser for its dark popup; the option colours cover browsers that ignore that. */
body.dash-dark .role-select, body.dash-dark .select-pill { color-scheme: dark; }
body.dash-dark .role-select option, body.dash-dark .select-pill option { background: #2A2450; color: #FFFFFF; }
body.dash-dark .tool-picker-search { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.14); color: #FFFFFF; }
body.dash-dark .tool-picker-search::placeholder { color: rgba(255, 255, 255, 0.38); }

/* Dashboard note after being sent back from a tool page the account may not open */
.access-note {
  position: fixed;
  bottom: 28px;   /* snackbar at the bottom: nothing of the stage sits there */
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 14px 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid #EF8A3C;
  background: rgba(38, 33, 74, 0.97);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}
.access-note-close { border: none; background: transparent; color: inherit; font: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .7; }
.access-note-close:hover { opacity: 1; }

/* New role card: a small two-step wizard (title -> scrapers) */
.wizard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.btn-link { border: none; background: none; padding: 4px 6px; color: var(--muted); font-family: inherit; font-weight: 800; font-size: 13.5px; cursor: pointer; border-radius: 8px; }
.btn-link:hover { color: var(--brand); }
.wizard-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.wizard-step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px 5px 5px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--muted);
  font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer;
}
.wizard-num { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.08); font-size: 12px; }
.wizard-step.active { border-color: var(--brand); color: var(--brand); }
.wizard-step.active .wizard-num { background: var(--brand); color: #FFFFFF; }
.wizard-step.done .wizard-num { background: var(--brand-soft); color: var(--brand); }
.wizard-panel .text-field { max-width: 560px; }
.wizard-panel .field-note { min-height: 18px; margin: 6px 0 0; }
.wizard-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.wizard-pick { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.wizard-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.scraper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.scraper-tile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card);
  font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.scraper-tile:hover { border-color: var(--brand); }
.scraper-tile.on { border-color: var(--brand); background: var(--brand-soft); }
.scraper-tile input { accent-color: var(--brand); flex-shrink: 0; }
.scraper-icon { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--tool-bg); color: var(--tool-color); }
.scraper-icon svg { width: 16px; height: 16px; }
body.dash-dark .wizard-step { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.6); }
body.dash-dark .wizard-step .wizard-num { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }
body.dash-dark .wizard-step.active { border-color: #A79BFF; color: #FFFFFF; }
body.dash-dark .wizard-step.active .wizard-num { background: var(--brand); }
body.dash-dark .wizard-step.done .wizard-num { background: rgba(106, 90, 224, 0.45); color: #DED6FA; }
body.dash-dark .btn-link { color: rgba(255, 255, 255, 0.6); }
body.dash-dark .btn-link:hover { color: #FFFFFF; }
body.dash-dark .wizard-pick { color: rgba(255, 255, 255, 0.6); }
body.dash-dark .scraper-tile { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.14); color: #FFFFFF; }
body.dash-dark .scraper-tile:hover { border-color: #A79BFF; }
body.dash-dark .scraper-tile.on { background: rgba(106, 90, 224, 0.30); border-color: #A79BFF; }
/* Roles page: one row per role (title, tools, account count, actions) */
.hist-head .btn-primary { white-space: nowrap; }   /* 'New role' / 'New user' stay on one line next to a long intro */
.roles-row { grid-template-columns: 1.6fr 1.6fr 0.9fr 1fr; }
.roles-row .hist-actions .btn-ghost { padding: 8px 14px; }
.role-name-field { width: 100%; max-width: 260px; padding: 8px 12px; }
.role-name-field[readonly] { opacity: .7; cursor: default; }
.role-tag { display: block; margin-top: 4px; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hist-foot .field-note { margin-left: 12px; }
/* Users page: role + tools are small muted text; a suspended account is dimmed and tagged */
.user-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; vertical-align: 2px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: rgba(232, 96, 76, 0.15); color: #E8604C; }
.users-row.suspended .hist-name, .users-row.suspended .hist-when { opacity: .55; }
.users-row.suspended .user-tag { opacity: 1; }
body.dash-dark .user-tag { background: rgba(232, 96, 76, 0.28); color: #FFB4A8; }
