/* ============================================================
   ToolHub v18 — Light Marketplace Design System
   Soft off-white gradient bg · white surfaces · green #14a800 primary
   High-contrast text (#111827 on #f4f6f9) for readability
   ============================================================ */
:root {
  --bg: #f4f6f9;
  --bg-soft: #eceff3;
  --bg-raise: #ffffff;
  --card: #ffffff;
  --card-hover: #f6faf6;
  --border: #dfe3e8;
  --border-soft: #e9edf1;
  --text: #111827;
  --text-dim: #4b5563;
  --text-faint: #8a94a3;
  --primary: #14a800;
  --primary-strong: #0f8a00;
  --primary-soft: rgba(20, 168, 0, .10);
  --accent: #0f8a00;
  --accent-soft: rgba(20, 168, 0, .08);
  --green: #14a800;
  --amber: #b45309;
  --red: #dc2626;
  --violet: #7c3aed;
  --pink: #db2777;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 8px 24px rgba(16, 24, 40, .09);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, .14);
  --glow: 0 0 0 1px rgba(20, 168, 0, .22), 0 12px 32px rgba(20, 168, 0, .16);
  --grad: linear-gradient(135deg, #14a800 0%, #37c21e 55%, #63d34f 100%);
  --grad-soft: linear-gradient(135deg, rgba(20,168,0,.10), rgba(99,211,79,.08));
  --font: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1000px 460px at 90% -10%, rgba(20, 168, 0, .08), transparent 60%),
    radial-gradient(760px 400px at -8% 0%, rgba(55, 194, 30, .05), transparent 55%),
    linear-gradient(180deg, #f7f9fb 0%, var(--bg) 42%, #eef1f5 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
::selection { background: rgba(99, 102, 241, .4); color: #fff; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #263154; border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #33406e; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s ease;
  font-family: inherit;
  background: var(--bg-raise);
  color: var(--text);
  user-select: none;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--primary); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(99, 102, 241, .38);
}
.btn-primary:hover { filter: brightness(1.12); box-shadow: 0 8px 26px rgba(99, 102, 241, .5); }
.btn-green { background: rgba(52, 211, 153, .12); color: var(--green); border-color: rgba(52, 211, 153, .32); }
.btn-green:hover { background: rgba(52, 211, 153, .2); border-color: var(--green); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.04); }
.btn-danger { background: rgba(248, 113, 113, .1); color: var(--red); border-color: rgba(248, 113, 113, .32); }
.btn-danger:hover { background: rgba(248, 113, 113, .2); border-color: var(--red); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .82rem; border-radius: 9px; }
.btn-big { padding: 15px 30px; font-size: 1rem; border-radius: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* ============================================================
   Header — sticky glass
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(10, 14, 26, .72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(38, 49, 84, .6);
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, .45);
  transition: transform .2s, box-shadow .2s;
}
.brand:hover .brand-logo { transform: scale(1.06) rotate(-4deg); box-shadow: 0 8px 26px rgba(99, 102, 241, .6); }
.brand-logo svg { width: 21px; height: 21px; }
.brand em { font-style: normal; color: var(--accent); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 14px;
}
.main-nav a {
  position: relative;
  padding: 9px 15px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: .92rem;
  font-weight: 600;
  transition: color .15s, background .15s;
}
.main-nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.main-nav a.active { color: #fff; background: rgba(99, 102, 241, .14); }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-search {
  position: relative;
  flex: 0 1 300px;
}
.nav-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border .2s, box-shadow .2s, background .2s;
  font-family: inherit;
}
.nav-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--bg-raise);
}
.nav-search input::placeholder { color: var(--text-faint); }
.nav-search > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-faint);
  pointer-events: none;
}

/* Search suggestions dropdown */
.search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 70;
  display: none;
  max-height: 320px;
  overflow: auto;
}
.search-suggest.show { display: block; animation: dropIn .16s ease; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.search-suggest a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: .88rem;
  color: var(--text-dim);
  transition: background .12s, color .12s;
}
.search-suggest a:hover { background: var(--primary-soft); color: #fff; }
.search-suggest a svg { width: 15px; height: 15px; color: var(--primary); flex-shrink: 0; }
.search-suggest .ss-name { font-weight: 600; color: var(--text); }
.search-suggest .ss-cat { margin-left: auto; font-size: .7rem; color: var(--text-faint); }

.nav-auth { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.auth-link {
  color: var(--text-dim);
  font-size: .9rem;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 10px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.auth-link:hover { color: var(--text); background: rgba(255,255,255,.05); }

/* User menu dropdown */
.user-menu-wrap { position: relative; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 13px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-raise);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
  color: var(--text);
  font-weight: 600;
  font-size: .88rem;
}
.user-chip:hover { border-color: var(--primary); }
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .85rem;
  flex-shrink: 0;
}
.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 70;
  display: none;
}
.user-menu.show { display: block; animation: dropIn .16s ease; }
.user-menu a, .user-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: none;
  border-radius: 9px;
  color: var(--text-dim);
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}
.user-menu a:hover, .user-menu button:hover { background: var(--primary-soft); color: #fff; }
.user-menu a svg, .user-menu button svg { width: 16px; height: 16px; color: var(--primary); }
.user-menu .um-danger:hover { background: rgba(248, 113, 113, .12); color: var(--red); }
.user-menu .um-danger svg { color: var(--red); }
.user-menu .um-head {
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}
.user-menu .um-head b { display: block; font-size: .9rem; color: #fff; }
.user-menu .um-head span { font-size: .74rem; color: var(--text-faint); }

/* Hamburger (mobile) */
.hamburger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-raise);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
}
.hamburger:hover { border-color: var(--primary); }
.hamburger svg { width: 20px; height: 20px; }

/* Mobile slide-down menu */
.mobile-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 200;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #0a0e1a; /* solid fallback — light theme overrides below */
  box-shadow: 0 18px 40px rgba(10, 14, 26, .28);
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 20px 18px;
}
.mobile-menu.open { display: block; animation: dropIn .2s ease; }
.mobile-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: .98rem;
  transition: background .15s, color .15s;
}
.mobile-menu a:hover, .mobile-menu a.active { background: var(--primary-soft); color: #fff; }
.mobile-menu a svg { width: 18px; height: 18px; color: var(--primary); }
.mobile-menu .mm-divider { height: 1px; background: var(--border-soft); margin: 8px 8px; }
.mobile-menu .mm-cta {
  margin: 10px 8px 4px;
  justify-content: center;
  background: var(--grad);
  color: #fff;
  border-radius: 12px;
}
.mobile-menu .mm-cta:hover { filter: brightness(1.1); }
.mobile-menu .mm-logout {
  background: rgba(220, 38, 38, .12);
  border: 1px solid rgba(220, 38, 38, .35);
  color: var(--red);
}
.mobile-menu .mm-logout:hover { background: rgba(220, 38, 38, .2); border-color: var(--red); color: var(--red); }
html.dark .mobile-menu .mm-logout { color: var(--red); }
.mobile-menu .mm-search { margin: 10px 8px 4px; position: relative; }
.mobile-menu .mm-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-faint); }
.mobile-menu .mm-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: .95rem;
  outline: none;
  font-family: inherit;
}
.mobile-menu .mm-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 76px 24px 30px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 460px;
  background: radial-gradient(closest-side, rgba(99, 102, 241, .3), rgba(34, 211, 238, .12) 55%, transparent 75%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(34, 211, 238, .3);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 22px;
  letter-spacing: .03em;
  backdrop-filter: blur(6px);
}
.hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.08;
  background: linear-gradient(120deg, #fff 25%, #c7d2fe 55%, var(--accent) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero h1 .grad-word {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero p {
  max-width: 640px;
  margin: 18px auto 0;
  color: var(--text-dim);
  font-size: 1.08rem;
  line-height: 1.7;
}
.hero-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 44px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.hero-stats .stat { position: relative; padding: 0 6px; }
.hero-stats .stat:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 34px;
  background: var(--border-soft);
}
.hero-stats .stat b {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  line-height: 1.15;
}
.hero-stats .stat span {
  font-size: .8rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
}

/* ============================================================
   Search / filter bar
   ============================================================ */
.catalog-bar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 24px 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.search-field {
  flex: 1;
  min-width: 250px;
  position: relative;
}
.search-field input {
  width: 100%;
  padding: 13px 18px 13px 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: border .2s, box-shadow .2s, background .2s;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}
.search-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-sm);
  background: var(--bg-raise);
}
.search-field svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  pointer-events: none;
}
.chip {
  padding: 10px 17px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  user-select: none;
  font-family: inherit;
}
.chip:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.chip.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 5px 16px rgba(99, 102, 241, .4);
}
.tool-count {
  font-size: .84rem;
  color: var(--text-faint);
  margin-left: auto;
  font-weight: 600;
}

/* ============================================================
   Section headers
   ============================================================ */
.section-head {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 24px 4px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-head h2::before {
  content: "";
  width: 5px;
  height: 26px;
  border-radius: 999px;
  background: var(--grad);
}
.section-head p { color: var(--text-dim); font-size: .93rem; margin-top: 6px; padding-left: 17px; }

/* ============================================================
   Tool grid + cards
   ============================================================ */
.grid {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(262px, 1fr));
  gap: 18px;
}
.tool-card {
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 40%), var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .2s;
}
.tool-card::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  background: radial-gradient(closest-side, rgba(99, 102, 241, .18), transparent);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.tool-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, .55);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 45%), var(--card-hover);
  box-shadow: var(--glow);
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover::after { opacity: 1; }
.tool-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--grad-soft);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, .28);
  transition: transform .2s, box-shadow .2s;
}
.tool-card:hover .icon {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 6px 18px rgba(99, 102, 241, .3);
}
.tool-card .icon svg { width: 23px; height: 23px; }
.tool-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}
.tool-card p {
  font-size: .87rem;
  color: var(--text-dim);
  flex: 1;
  line-height: 1.55;
}
.tool-card .go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 3px;
}
.tool-card .go svg { width: 15px; height: 15px; transition: transform .2s; }
.tool-card:hover .go svg { transform: translateX(4px); }
.cat-tag {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: .64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-faint);
  background: rgba(10, 14, 26, .7);
  border: 1px solid var(--border-soft);
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* ============================================================
   Tool page
   ============================================================ */
.tool-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 42px 24px 76px;
}
.tool-head {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 8px;
}
.tool-head .icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--grad-soft);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, .3);
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .16);
}
.tool-head .icon svg { width: 28px; height: 28px; }
.tool-head h1 { font-size: 1.85rem; font-weight: 800; letter-spacing: -.025em; }
.breadcrumb {
  font-size: .84rem;
  color: var(--text-faint);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.crumb-sep { opacity: .5; }
.tool-desc {
  color: var(--text-dim);
  margin-bottom: 28px;
  max-width: 660px;
  font-size: .98rem;
}

/* ============================================================
   Panels / controls
   ============================================================ */
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 50%), var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: clamp(20px, 3.6vw, 30px);
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.panel h2 {
  font-size: .98rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel h2 .hint {
  font-size: .76rem;
  font-weight: 500;
  color: var(--text-faint);
  margin-left: auto;
}

label.field-label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-dim);
  margin: 16px 0 7px;
}
textarea, input[type="text"], input[type="number"], input[type="url"], input[type="search"],
input[type="email"], input[type="password"], input[type="date"], select {
  width: 100%;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: .94rem;
  outline: none;
  transition: border .2s, box-shadow .2s, background .2s;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
textarea.mono, input.mono { font-family: var(--mono); font-size: .88rem; }
textarea:focus, input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--bg-raise);
}
input[type="range"] { width: 100%; accent-color: var(--primary); }
input[type="color"] {
  width: 100%;
  height: 52px;
  padding: 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.result-box {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 17px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: .9rem;
  word-break: break-all;
  white-space: pre-wrap;
  max-height: 340px;
  overflow: auto;
  color: var(--text);
  box-shadow: inset 0 2px 8px rgba(2, 6, 23, .3);
}
.copy-btn { float: right; margin-top: 16px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.stat-card {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  transition: border-color .15s, transform .15s;
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.stat-card b {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  line-height: 1.2;
}
.stat-card span { font-size: .74rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

.error-box {
  background: rgba(248, 113, 113, .08);
  border: 1px solid rgba(248, 113, 113, .3);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  margin-top: 12px;
  font-size: .88rem;
  display: none;
}
.error-box.show { display: block; }

/* segmented control */
.seg {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  flex-wrap: wrap;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  padding: 8px 17px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.seg button.active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 3px 12px rgba(99, 102, 241, .4);
}

/* two-column tool layouts */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ---------- Tool-specific: dropzone (image compressor) ---------- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 46px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .22s;
  background: var(--bg-soft);
}
.dropzone svg { width: 46px; height: 46px; color: var(--primary); margin-bottom: 12px; }
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.005); }

/* ---------- Tool-specific: timer & stopwatch ---------- */
.clock-display {
  font-family: var(--mono);
  font-size: clamp(2.6rem, 10vw, 4.6rem);
  font-weight: 700;
  text-align: center;
  color: #fff;
  letter-spacing: .04em;
  padding: 26px 0 10px;
  line-height: 1.1;
  text-shadow: 0 0 34px rgba(99, 102, 241, .35);
}
.clock-display.warning { color: var(--amber); animation: pulse 1s infinite; }
.clock-display.done { color: var(--green); }
.timer-inputs { display: flex; gap: 12px; justify-content: center; }
.timer-inputs > div { display: flex; align-items: center; gap: 6px; }
.timer-inputs input { width: 84px; text-align: center; font-family: var(--mono); font-size: 1.2rem; padding: 10px 6px; }
.timer-inputs span { color: var(--text-faint); font-weight: 600; }
.btn-row.center { justify-content: center; }
.laps { margin-top: 18px; max-height: 220px; overflow: auto; }
.lap-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-size: .9rem;
}
.lap-row:first-child { color: var(--primary); font-weight: 700; }

/* ---------- Tool-specific: BMI scale ---------- */
.bmi-scale { margin-top: 18px; }
.bmi-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8 0 24%, #34d399 24% 49%, #fbbf24 49% 71%, #f87171 71% 100%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.4);
}
.bmi-marker {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 22px;
  border-radius: 3px;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px rgba(0,0,0,.35);
  transition: left .3s;
}
.bmi-labels { display: flex; justify-content: space-between; font-size: .7rem; color: var(--text-faint); margin-top: 8px; }

/* ---------- Tool-specific: url shortener history ---------- */
.hist-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--bg-soft);
}

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  left: auto;
  transform: translateY(20px);
  background: rgba(29, 39, 73, .95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 99;
  max-width: calc(100vw - 40px);
}
#toast.show { opacity: 1; transform: translateY(0); }

/* ============================================================
   Footer — modern multi-column
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(15, 21, 38, .6), rgba(10, 14, 26, .9));
  margin-top: 20px;
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 24px 26px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 36px;
}
.footer-col h4 {
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.footer-brand .brand-logo { width: 36px; height: 36px; }
.footer-brand b { font-size: 1.1rem; font-weight: 800; }
.footer-brand em { font-style: normal; color: var(--accent); }
.footer-col p { color: var(--text-dim); font-size: .88rem; line-height: 1.7; max-width: 300px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul a {
  color: var(--text-dim);
  font-size: .9rem;
  transition: color .15s, padding-left .15s;
}
.footer-col ul a:hover { color: var(--accent); padding-left: 4px; }
.footer-col ul a::before { content: "› "; color: var(--primary); opacity: .7; }
.footer-social { display: flex; gap: 10px; margin-top: 4px; }
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-raise);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: all .18s;
}
.footer-social a:hover { border-color: var(--primary); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(99,102,241,.3); }
.footer-social svg { width: 17px; height: 17px; }
.contact-list li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; font-size: .88rem; color: var(--text-dim); line-height: 1.55; }
.contact-list li::before { content: none; }
.contact-list li svg { width: 17px; height: 17px; flex: none; margin-top: 3px; color: var(--primary); }
.contact-list a { color: var(--text-dim); transition: color .15s; }
.contact-list a:hover { color: var(--accent); }
html.dark .contact-list li { color: var(--text-dim); }
html.dark .contact-list a { color: var(--text-dim); }
html.dark .contact-list a:hover { color: var(--primary); }
.newsletter { display: flex; gap: 8px; margin-top: 4px; }
.newsletter input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: .86rem;
  outline: none;
  font-family: inherit;
  transition: border .2s, box-shadow .2s;
}
.newsletter input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.footer-bottom {
  border-top: 1px solid var(--border-soft);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1240px;
  margin: 0 auto;
  color: var(--text-faint);
  font-size: .82rem;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-size: .86rem; transition: color .15s; }
.footer-links a:hover { color: var(--accent); }

/* ============================================================
   Ad slots (Adsterra) — responsive, centered, mobile-safe
   ============================================================ */
.ad-slot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.ad-slot-inner {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.ad-slot-inner > div,
.ad-slot-inner iframe,
.ad-slot-inner ins {
  margin: 0 auto !important;
}
.ad-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: rgba(10, 14, 26, .6);
  border: 1px solid var(--border-soft);
  padding: 2px 11px;
  border-radius: 999px;
  user-select: none;
}
.ad-slot-grid {
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 50%), var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  min-height: 200px;
  justify-content: center;
  padding: 16px;
  align-items: center;
  margin: 0;
  max-width: none;
  width: 100%;
  height: 100%;
}
@media (max-width: 720px) {
  .ad-slot { padding: 10px 14px; }
  .ad-slot-inner iframe { max-width: 100%; }
}

/* ============================================================
   Page wrap, breadcrumb, blog & static pages
   ============================================================ */
.page-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 30px 24px 64px;
}
.blog-head { margin-bottom: 28px; position: relative; }
.blog-head h1 { font-size: 2.1rem; letter-spacing: -.025em; font-weight: 800; }
.blog-head p { color: var(--text-dim); margin-top: 8px; max-width: 640px; font-size: .98rem; }

.blog-tags { margin-bottom: 28px; flex-wrap: wrap; }
.blog-tags .chip { cursor: pointer; }

/* Blog grid + cards */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 22px;
  margin-bottom: 36px;
}
.blog-card {
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 45%), var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.blog-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, .55);
  box-shadow: var(--glow);
}
.blog-cover { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-soft); position: relative; }
.blog-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.blog-card:hover .blog-cover img { transform: scale(1.04); }
.blog-cover-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--grad-soft);
}
.blog-cover-ph svg { width: 46px; height: 46px; color: var(--primary); opacity: .7; }
.blog-card-body { padding: 19px 21px 21px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.blog-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .79rem;
  color: var(--text-faint);
}
.blog-dot { opacity: .5; }
.blog-tag { color: var(--accent); font-weight: 600; }
.blog-tag:hover { text-decoration: underline; }
.blog-card h2 { font-size: 1.14rem; line-height: 1.35; letter-spacing: -.01em; }
.blog-card h2 a:hover { color: var(--accent); }
.blog-card p { color: var(--text-dim); font-size: .92rem; flex: 1; line-height: 1.6; }
.blog-card .go { color: var(--primary); font-weight: 700; font-size: .88rem; display: inline-flex; align-items: center; gap: 6px; }
.blog-card .go svg { width: 15px; height: 15px; transition: transform .18s; }
.blog-card:hover .go svg { transform: translateX(3px); }
.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Featured post */
.featured-post {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent 50%), var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 30px;
  transition: border-color .2s, box-shadow .2s;
}
.featured-post:hover { border-color: rgba(99, 102, 241, .5); box-shadow: var(--glow); }
.featured-post .blog-cover { aspect-ratio: auto; height: 100%; min-height: 250px; }
.featured-post .fp-body { padding: 30px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.featured-post .fp-body h2 { font-size: 1.5rem; line-height: 1.3; letter-spacing: -.02em; }
.featured-post .fp-body p { color: var(--text-dim); font-size: .95rem; line-height: 1.65; }
.fp-badge {
  align-self: flex-start;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(34, 211, 238, .3);
  padding: 4px 12px;
  border-radius: 999px;
}

/* Single post */
.post-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 55%), var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4.5vw, 46px);
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}
.post-head { margin-bottom: 24px; }
.post-head h1 { font-size: clamp(1.6rem, 3.8vw, 2.3rem); line-height: 1.24; letter-spacing: -.025em; }
.post-head .blog-meta { margin-top: 14px; }
.post-cover {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 30px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  aspect-ratio: 21/9;
  object-fit: cover;
}
.post-body { font-size: 1.04rem; line-height: 1.85; color: var(--text); }
.post-body h2 { font-size: 1.45rem; margin: 32px 0 13px; letter-spacing: -.01em; }
.post-body h3 { font-size: 1.18rem; margin: 26px 0 10px; }
.post-body p { margin-bottom: 17px; }
.post-body ul, .post-body ol { margin: 0 0 18px 26px; }
.post-body li { margin-bottom: 7px; }
.post-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.post-body strong { color: #fff; }
.post-body blockquote {
  border-left: 3px solid var(--primary);
  background: linear-gradient(90deg, var(--primary-soft), transparent 80%);
  padding: 16px 20px;
  margin: 0 0 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-dim);
  font-size: 1.02rem;
}
.post-body pre {
  background: #0a0f1f;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 17px 19px;
  overflow-x: auto;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.6;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.3);
}
.post-body code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 6px;
}
.post-body pre code { background: none; border: none; padding: 0; }
.post-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  margin: 6px 0;
}
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

.post-share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.post-share a {
  color: var(--primary);
  font-size: .9rem;
  font-weight: 600;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all .15s;
}
.post-share a:hover { border-color: var(--primary); background: var(--primary-soft); text-decoration: none; }

.author-box {
  display: flex;
  gap: 15px;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 26px;
}
.author-box .author-avatar { width: 48px; height: 48px; font-size: 1.1rem; }
.author-box b { color: #fff; font-size: .98rem; }
.author-box p { color: var(--text-dim); font-size: .86rem; margin-top: 3px; }

.related-section { margin-top: 10px; }
.related-section h2 { font-size: 1.3rem; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.related-section h2::before { content: ""; width: 4px; height: 22px; border-radius: 999px; background: var(--grad); }
.related-section .grid { margin-bottom: 30px; padding-left: 0; padding-right: 0; }

/* ============================================================
   Alerts
   ============================================================ */
.alert {
  padding: 13px 17px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 18px;
  border: 1px solid;
  backdrop-filter: blur(6px);
}
.alert-success { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .35); color: var(--green); }
.alert-error { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .35); color: var(--red); }

/* ============================================================
   Auth pages (login / register / dashboard / editor)
   ============================================================ */
.auth-wrap { max-width: 470px; }
.auth-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 50%), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 4.5vw, 42px);
  margin-top: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
}
.auth-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-logo-row .brand-logo { width: 44px; height: 44px; }
.auth-logo-row b { font-size: 1.15rem; font-weight: 800; }
.auth-logo-row em { font-style: normal; color: var(--accent); }
.auth-card h1 { font-size: 1.55rem; margin-bottom: 6px; letter-spacing: -.02em; }
.auth-card .muted { margin-bottom: 24px; }
.auth-form .field { margin-bottom: 17px; }
.auth-form label { display: block; font-size: .86rem; font-weight: 700; color: var(--text-dim); margin-bottom: 7px; }
.auth-form .hint { font-weight: 400; color: var(--text-faint); font-size: .8rem; }
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 13px 15px;
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--bg-raise);
}
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-soft) inset;
  box-shadow: 0 0 0 1000px var(--bg-soft) inset;
  border-color: var(--border);
  transition: background-color 9999s ease-in-out 0s;
}
.auth-alt { margin-top: 20px; font-size: .88rem; color: var(--text-dim); text-align: center; }
.auth-alt a { color: var(--primary); font-weight: 600; }

/* Dashboard */
.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.dash-head h1 { font-size: 1.75rem; margin-bottom: 4px; letter-spacing: -.02em; }
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .03em;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--bg-soft);
  white-space: nowrap;
}
.badge-on { background: rgba(52, 211, 153, .15); color: var(--green); border-color: rgba(52, 211, 153, .4); }
.badge-off { background: rgba(248, 113, 113, .12); color: var(--red); border-color: rgba(248, 113, 113, .35); }
.badge-pending { background: rgba(251, 191, 36, .13); color: var(--amber); border-color: rgba(251, 191, 36, .4); }

/* User post table */
.user-table { width: 100%; border-collapse: collapse; }
.user-table th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.user-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-soft);
  font-size: .9rem;
  vertical-align: middle;
}
.user-table tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.post-thumb {
  width: 74px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-soft);
  display: block;
}
.post-thumb-ph {
  width: 74px;
  height: 44px;
  border-radius: 8px;
  background: var(--grad-soft);
  border: 1px solid var(--border-soft);
  display: grid;
  place-items: center;
}
.post-thumb-ph svg { width: 18px; height: 18px; color: var(--primary); }

/* Post editor */
.stack-form .panel { margin-bottom: 22px; }
.stack-form .panel h2 { font-size: 1.06rem; margin-bottom: 16px; }
.stack-form .field { margin-bottom: 17px; }
.stack-form .field label { display: block; font-size: .86rem; font-weight: 700; color: var(--text-dim); margin-bottom: 7px; }
.stack-form .field .hint { font-weight: 400; color: var(--text-faint); font-size: .8rem; }
.stack-form .field .req { color: var(--red); }
.two-col-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.slot-actions { display: flex; align-items: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }

/* Blog editor (public editor mirrors admin) */
.blog-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.blog-editor .field { display: flex; flex-direction: column; margin-bottom: 0; }
.blog-editor textarea { min-height: 440px; }
.markdown-preview {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 17px 19px;
  min-height: 440px;
  overflow-y: auto;
  font-size: .95rem;
  line-height: 1.7;
  color: var(--text);
}
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { margin: 14px 0 8px; color: #fff; }
.markdown-preview p { margin-bottom: 12px; }
.markdown-preview ul, .markdown-preview ol { margin: 0 0 12px 22px; }
.markdown-preview pre {
  background: #0a0f1f;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: .83rem;
}
.markdown-preview code { font-family: var(--mono); font-size: .86em; background: var(--bg-soft); border-radius: 4px; padding: 1px 5px; }
.markdown-preview pre code { background: none; padding: 0; }
.markdown-preview blockquote {
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--primary-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text-dim);
}
.markdown-preview img { max-width: 100%; border-radius: 8px; }
.markdown-preview a { color: var(--primary); text-decoration: underline; }

/* Image upload UI */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-raise);
  color: var(--text-dim);
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.upload-btn:hover { border-color: var(--primary); color: #fff; }
.upload-btn svg { width: 15px; height: 15px; color: var(--primary); }
.upload-btn input[type="file"] { display: none; }
.upload-progress {
  flex: 1;
  min-width: 120px;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  display: none;
}
.upload-progress.show { display: block; }
.upload-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--grad);
  border-radius: 999px;
  transition: width .2s;
}
.upload-status { font-size: .8rem; color: var(--text-dim); font-weight: 600; }
.upload-status.ok { color: var(--green); }
.upload-status.err { color: var(--red); }
.cover-thumb {
  margin-top: 10px;
  max-width: 260px;
  max-height: 146px;
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  display: none;
  box-shadow: var(--shadow-sm);
}
.cover-thumb.show { display: block; }

/* Dark selects + date inputs across public editors (admin & user) */
.stack-form select,
.auth-form select,
.stack-form input[type="date"] {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa5c9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 38px;
  cursor: pointer;
}
.stack-form select option { background: var(--card); color: var(--text); }
.stack-form input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }

/* ============================================================
   Utility
   ============================================================ */
.muted { color: var(--text-dim); }
.small { font-size: .82rem; }
.mt { margin-top: 14px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.center { text-align: center; }
strong.pick { color: #fff; }

/* qr canvas center */
.qr-wrap { display: flex; justify-content: center; margin-top: 14px; }
.qr-wrap img { border-radius: 12px; background: #fff; padding: 10px; max-width: 100%; height: auto; box-shadow: var(--shadow-sm); }

/* JSON tree */
#jsonTree { max-height: 380px; overflow: auto; font-family: var(--mono); font-size: .84rem; background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px; margin-top: 12px; display: none; }
.tree-key { color: var(--accent); }
.tree-str { color: var(--green); }
.tree-num { color: var(--amber); }
.tree-bool { color: var(--primary); }
.tree-null { color: var(--red); font-style: italic; }
#jsonTree summary { cursor: pointer; color: var(--text-dim); }
#jsonTree summary:hover { color: var(--text); }

/* diff */
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 720px) { .diff-grid { grid-template-columns: 1fr; } }
.diff-pane pre {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.6;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.diff-pane pre .add { background: rgba(52, 211, 153, .18); color: var(--green); border-radius: 3px; }
.diff-pane pre .del { background: rgba(248, 113, 113, .16); color: var(--red); border-radius: 3px; }
.diff-pane pre .same { color: var(--text-dim); }
.diff-pane h3 { font-size: .8rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }

/* number system grid */
.ns-grid { display: grid; gap: 12px; }
.ns-row { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center; }
.ns-row label { font-family: var(--mono); font-weight: 700; color: var(--accent); font-size: .9rem; }
@media (max-width: 560px) { .ns-row { grid-template-columns: 1fr; gap: 6px; } }

/* color page */
.color-preview {
  height: 84px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  transition: background .15s;
}
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.swatch {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  cursor: pointer;
  transition: transform .15s;
}
.swatch:hover { transform: scale(1.12); }

/* password meter */
.meter { height: 8px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border-soft); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; width: 0%; border-radius: 999px; transition: width .25s, background .25s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 992px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .blog-cover { min-height: 200px; }
}
@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-search { display: none; }
  .hamburger { display: inline-flex; }
  .nav-right { margin-left: auto; }
  .nav-auth .auth-link { display: none; }
}
@media (max-width: 860px) {
  /* v17: squeeze the logged-in header so nothing overflows at 390px */
  .nav-right { gap: 7px; }
  .theme-toggle { width: 34px; height: 34px; }
  .theme-toggle svg { width: 16px; height: 16px; }
  .bell-btn { width: 34px; height: 34px; }
  .bell-btn svg { width: 17px; height: 17px; }
  .user-chip { padding: 4px 6px 4px 4px; }
  .user-chip .chip-name { display: none; }
  .user-chip .chip-pts { display: none; }
  .user-avatar { width: 26px; height: 26px; font-size: .78rem; }
  .hamburger { width: 34px; height: 34px; }
}
@media (max-width: 720px) {
  .header-inner { padding: 11px 16px; }
  .hero { padding: 56px 18px 22px; }
  .hero-stats { gap: 26px; }
  .hero-stats .stat:not(:last-child)::after { right: -15px; }
  .grid { padding: 16px 16px 48px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .catalog-bar { padding: 20px 16px 4px; }
  .section-head { padding: 20px 16px 4px; }
  .tool-page, .page-wrap { padding: 30px 16px 56px; }
  .two-col-form, .blog-editor { grid-template-columns: 1fr; }
  .blog-editor textarea, .markdown-preview { min-height: 280px; }
  .dash-head { flex-direction: column; }
  .user-table th:nth-child(3), .user-table td:nth-child(3) { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; padding: 36px 20px 20px; }
  .footer-bottom { justify-content: center; text-align: center; }
  .tool-head h1 { font-size: 1.5rem; }
  .post-panel { padding: 20px 18px; }
  .ad-slot { padding: 10px 14px; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tool-card { padding: 18px 15px; }
  .tool-card .icon { width: 42px; height: 42px; }
  .hero h1 { font-size: clamp(1.9rem, 8.5vw, 2.6rem); }
  .featured-post .fp-body { padding: 22px; }
}
textarea::placeholder, input::placeholder, select::placeholder { color: #55608a; opacity: 1; }

/* ============================================================
   v9 — Premium tools (studio editor, lock panel, badges)
   ============================================================ */

/* --- Premium badge on home cards --- */
.tool-card { position: relative; }
.premium-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(251, 191, 36, .18), rgba(244, 114, 182, .18));
  border: 1px solid rgba(251, 191, 36, .45);
  color: #fcd34d;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.tool-card-premium { border-color: rgba(251, 191, 36, .28); }
.tool-card-premium:hover { border-color: rgba(251, 191, 36, .55); box-shadow: 0 14px 40px rgba(251, 191, 36, .12); }
.tool-card-premium .cat-tag { background: rgba(251, 191, 36, .12); color: #fcd34d; }

/* --- Premium note bar under the grid --- */
.premium-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 auto 42px;
  max-width: 1180px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(251,191,36,.10), rgba(99,102,241,.10));
  border: 1px solid rgba(251, 191, 36, .25);
  color: var(--text);
  font-size: .92rem;
}
.premium-note-icon { font-size: 1.15rem; }
.premium-note .btn { margin-left: auto; }
@media (max-width: 720px) {
  .premium-note { padding: 14px 16px; }
  .premium-note .btn { margin-left: 0; }
}

/* --- Premium lock panel (guests) --- */
.premium-lock {
  max-width: 760px;
  margin: 26px auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}
.premium-lock-preview {
  position: relative;
  height: 230px;
  background:
    radial-gradient(400px 200px at 20% 0%, rgba(251,191,36,.16), transparent 60%),
    radial-gradient(400px 220px at 85% 10%, rgba(99,102,241,.18), transparent 60%),
    linear-gradient(160deg, #0d1326, #131a2e);
  overflow: hidden;
}
.plp-art {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -58%);
  width: 130px;
  height: 130px;
  color: rgba(255, 255, 255, .5);
  filter: blur(6px);
}
.plp-art svg { width: 100%; height: 100%; }
.plp-bars {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 46px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  filter: blur(5px);
}
.plp-bars span { height: 15px; border-radius: 8px; background: rgba(255,255,255,.35); }
.plp-lock {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 14, 26, .72);
  border: 1px solid rgba(255,255,255,.16);
  color: #fcd34d;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.plp-lock svg { width: 34px; height: 34px; }
.premium-lock-body { padding: 30px 34px 34px; text-align: center; }
.premium-lock-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(251,191,36,.14);
  border: 1px solid rgba(251,191,36,.4);
  color: #fcd34d;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.premium-lock-body h2 { font-size: 1.6rem; margin-bottom: 8px; }
.premium-lock-body > p { color: var(--text-dim); max-width: 460px; margin: 0 auto; }
.premium-lock-features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 18px 0 24px;
}
.premium-lock-features li { font-size: .9rem; color: var(--text-dim); }
.premium-lock-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 14px; }
@media (max-width: 720px) {
  .premium-lock-body { padding: 24px 18px 28px; }
  .premium-lock-cta .btn-big { width: 100%; }
}

/* --- Studio layout (editor pages) --- */
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 26px;
  align-items: start;
}
@media (max-width: 980px) { .studio-layout { grid-template-columns: 1fr; } }
.studio-stage { min-width: 0; }
.canvas-frame {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #060a14;
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.canvas-frame canvas { display: block; width: 100%; height: auto; border-radius: 10px; background: #060a14; }
.news-frame canvas { aspect-ratio: 1 / 1; }
.meme-frame canvas { aspect-ratio: 4 / 3; }
.yt-frame canvas { aspect-ratio: 16 / 9; }
.greeting-frame canvas { aspect-ratio: 5 / 6; }
.logo-frame canvas { aspect-ratio: 1 / 1; }
.studio-controls { display: flex; flex-direction: column; gap: 4px; }
.ctl-sec { padding: 14px 2px; border-bottom: 1px solid var(--border-soft); }
.ctl-sec:last-child { border-bottom: 0; }
.ctl-sec h4 {
  font-size: .8rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.tmpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.tmpl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-raise);
  color: var(--text-dim);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, transform .18s, background .18s, color .18s;
  font-family: inherit;
}
.tmpl:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.tmpl.active { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.tmpl-swatch {
  display: grid;
  place-items: center;
  width: 100%;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(150deg, var(--t1), var(--t2));
  color: #fff;
  font-size: .72rem;
  letter-spacing: .08em;
}
.tmpl-swatch b { font-weight: 800; text-shadow: 0 2px 6px rgba(0,0,0,.4); }
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(99, 102, 241, .55);
  background: var(--primary-soft);
  color: #c7d2fe;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.upload-btn:hover { border-color: var(--primary); background: rgba(99,102,241,.22); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text-dim); cursor: pointer; }
.check-row input { accent-color: var(--primary); width: 16px; height: 16px; }
.studio-controls .field-label { display: block; font-size: .78rem; color: var(--text-faint); margin: 0 0 5px; }
.hint { color: var(--text-faint); font-weight: 400; }

/* --- How-it-works grid --- */
.how-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.how-item {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-raise);
  border: 1px solid var(--border-soft);
  font-size: .9rem;
  color: var(--text-dim);
  line-height: 1.55;
}
.how-item b { color: var(--primary); margin-right: 6px; }

/* --- Auth premium note --- */
.auth-premium-note {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(251,191,36,.09), rgba(99,102,241,.09));
  border: 1px solid rgba(251,191,36,.22);
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.auth-premium-note a { color: #fcd34d; font-weight: 600; }
.auth-premium-icon { font-size: 1.05rem; }

/* --- Dashboard premium tools grid --- */
.dash-sec-head { margin: 34px 0 14px; }
.dash-sec-head h2 { font-size: 1.25rem; }
.premium-dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.premium-dash-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border-soft);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.premium-dash-card:hover { border-color: rgba(251,191,36,.4); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.premium-dash-card .icon { width: 44px; height: 44px; flex: 0 0 auto; }
.premium-dash-card .icon svg { width: 22px; height: 22px; }
.premium-dash-card > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.premium-dash-card b { font-size: .95rem; }
.premium-dash-card > svg { width: 18px; height: 18px; color: var(--text-faint); flex: 0 0 auto; }
/* ============================================================
   ToolHub v10 — Earnings / referral / withdrawal styles
   ============================================================ */
.earn-card {
  background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(34,211,238,.08)), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.earn-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.earn-card-head h2 { font-size: 1.15rem; margin-bottom: 2px; }
.earn-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0 6px; }
.earn-stat {
  background: rgba(10,14,26,.55); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.earn-stat b { display: block; font-size: 1.35rem; font-weight: 800; background: var(--grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.earn-stat span { font-size: .74rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.earn-cap-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.progress-bar { flex: 1; min-width: 120px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .4s; }
.earn-tx { margin-top: 14px; }
.earn-tx h4 { font-size: .9rem; margin-bottom: 8px; color: var(--text-dim); }
.earn-tx ul { list-style: none; }
.earn-tx li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: .9rem; }
.earn-tx li:last-child { border-bottom: none; }
.tx-type { flex: 1; min-width: 0; }
.tx-pts { font-weight: 800; color: var(--green); white-space: nowrap; }
.dash-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.earn-balance {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(34,211,238,.1)), var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px;
}
.earn-balance > div:first-child { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.earn-balance b { font-size: 1.6rem; font-weight: 800; }
.earn-balance-mini { display: flex; gap: 16px; flex-wrap: wrap; }
.earn-balance-mini span { font-size: .82rem; color: var(--text-dim); }
.earn-balance-mini b { font-size: .95rem; color: var(--text); }
.earn-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.earn-step {
  background: rgba(10,14,26,.5); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 18px;
}
.earn-step-ico { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.earn-step h3 { font-size: .98rem; margin-bottom: 6px; }
.earn-step p { font-size: .86rem; color: var(--text-dim); margin-bottom: 6px; }
.earn-step .bn { color: var(--text-faint); font-size: .78rem; }
.bn { color: var(--text-faint); }
.referral-box {
  background: rgba(10,14,26,.5); border: 1px dashed var(--border);
  border-radius: var(--radius-sm); padding: 18px; margin-top: 14px;
}
.ref-link-row { display: flex; gap: 10px; margin: 8px 0 12px; }
.ref-link-row input {
  flex: 1; min-width: 0; font-family: var(--mono); font-size: .85rem;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 14px;
}
.ref-share { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-share { display: inline-flex; align-items: center; gap: 8px; border-radius: var(--radius-sm); padding: 10px 18px; font-weight: 700; font-size: .88rem; }
.btn-share svg { width: 17px; height: 17px; }
.btn-wa { background: rgba(37,211,102,.16); border: 1px solid rgba(37,211,102,.4); color: #6ee7a0; }
.btn-wa:hover { background: rgba(37,211,102,.28); }
.btn-fb { background: rgba(59,89,152,.2); border: 1px solid rgba(59,89,152,.5); color: #9db4e8; }
.btn-fb:hover { background: rgba(59,89,152,.34); }
.quick-tool-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-tool-links a {
  font-size: .82rem; padding: 7px 13px; border-radius: 99px;
  background: var(--bg-raise); border: 1px solid var(--border-soft); color: var(--text-dim);
  transition: all .16s;
}
.quick-tool-links a:hover { color: var(--text); border-color: var(--primary); transform: translateY(-1px); }
.earn-list { margin: 10px 0 6px 18px; }
.earn-list li { margin-bottom: 7px; }
.radio-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer;
  font-weight: 600; font-size: .92rem;
}
.radio-row:has(input:checked) { border-color: var(--primary); background: rgba(99,102,241,.1); }
.radio-row input { accent-color: var(--primary); width: 17px; height: 17px; }
.howearn-hero { text-align: center; padding: 60px 0 40px; }
.howearn-hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); margin: 14px 0; line-height: 1.15; }
.howearn-hero p { max-width: 640px; margin: 0 auto 26px; color: var(--text-dim); }
.hero-earn-link { margin-top: 14px; font-size: .95rem; color: var(--text-dim); }
.hero-earn-link a { color: var(--accent); font-weight: 700; }
.hero-earn-link a:hover { text-decoration: underline; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .ref-link-row { flex-direction: column; }
  .earn-stats { grid-template-columns: repeat(2, 1fr); }
  .earn-balance { flex-direction: column; align-items: flex-start; }
}
/* ============================================================
   ToolHub v11 — Light Theme Overrides
   (Upwork/WorkUp-style: white surfaces, green accents)
   ============================================================ */

/* Header nav + search */
.site-header { background: rgba(255, 255, 255, .86); border-bottom: 1px solid rgba(223, 227, 232, .9); }
.main-nav a { color: #4b5563; }
.main-nav a:hover { color: #0f8a00; background: rgba(20, 168, 0, .07); }
.main-nav a.active { color: #0f8a00; background: rgba(20, 168, 0, .10); }
.main-nav a.active::after { background: var(--grad); }
.search-suggest a:hover { background: var(--primary-soft); color: #0f8a00; }
.nav-right .nav-search input, .nav-search input { background: #f3f5f8; color: #1f2937; }
.nav-right .nav-search input::placeholder, .nav-search input::placeholder, .mm-search input::placeholder { color: #6b7280; opacity: 1; }
.user-menu { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); }
.user-menu a, .user-menu button { color: #374151; }
.user-menu a:hover, .user-menu button:hover { background: var(--primary-soft); color: #0f8a00; }
.user-menu .um-head b { color: #1f2937; }
.user-menu .um-head span { color: var(--text-faint); }
.user-menu .um-danger:hover { background: rgba(220,38,38,.08); color: #dc2626; }
.user-menu .um-danger svg { color: #dc2626; }

/* Mobile menu */
.mobile-menu { background: #ffffff; box-shadow: 0 18px 40px rgba(15, 23, 42, .14); }
.mobile-menu a { color: #374151; }
.mobile-menu a:hover, .mobile-menu a.active { background: var(--primary-soft); color: #0f8a00; }
.mobile-menu .mm-cta { color: #fff; }
.mobile-menu .mm-logout { background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c !important; }
.mobile-menu .mm-logout:hover { background: #fecaca; border-color: #ef4444; color: #b91c1c !important; }
.mm-search input { background: #f3f5f8; color: #1f2937; }

/* Header buttons in light mode */
.theme-toggle { background: #fff; border-color: #e5e7eb; color: #4b5563; }
.theme-toggle:hover { color: #0f8a00; border-color: #14a800; }
.hamburger { background: #fff; color: #374151; }

/* Buttons */
.btn { background: #fff; color: #1f2937; border-color: #e5e7eb; }
.btn:hover { border-color: #14a800; color: #0f8a00; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn-primary:hover { background: var(--grad); filter: brightness(1.06); border-color: transparent; color: #fff; }
.btn-ghost { background: transparent; color: #14a800; }
.btn-ghost:hover { background: var(--primary-soft); border-color: #14a800; color: #0f8a00; }
.btn-danger { background: #fee2e2; border-color: #fecaca; color: #dc2626; }
.btn-danger:hover { background: #fecaca; border-color: #dc2626; color: #dc2626; }

/* Panels & cards */
.panel { background: #fff; border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); }
.panel h2 { color: #111827; }
.panel h3 { color: #111827; }
.tool-card { background: #fff; border: 1px solid var(--border-soft); }
.tool-card:hover { border-color: rgba(20,168,0,.45); background: #fff; box-shadow: var(--glow); }
.tool-card h3 { color: #111827; }
.tool-card p { color: #6b7280; }

/* Section headings */
.section-head h2 { color: #111827; }

/* Footer */
.site-footer { border-top: 1px solid var(--border-soft); background: #fff; }
.footer-col h4 { color: #6b7280; }
.footer-brand b { color: #111827; }
.footer-col p { color: #6b7280; }
.footer-col ul a { color: #4b5563; }
.footer-col ul a:hover { color: #14a800; }
.footer-social a { background: #f5f7f9; border-color: var(--border); color: #6b7280; }
.footer-social a:hover { border-color: #14a800; color: #14a800; box-shadow: 0 6px 16px rgba(20,168,0,.18); }
.newsletter input { background: #f5f7f9; border-color: var(--border); color: #1f2937; }
.footer-bottom { color: #9ca3af; }
.footer-links a { color: #6b7280; }
.footer-links a:hover { color: #14a800; }

/* Hero */
.hero-badge { background: rgba(20,168,0,.08); border-color: rgba(20,168,0,.18); color: #0f8a00; }
.hero h1 { color: #111827; }
.hero .grad-word {
  background: linear-gradient(120deg, #14a800, #37c21e 60%, #63d34f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero p { color: #4b5563; }
.hero-stats .stat b { color: #111827; }
.hero-stats .stat span { color: #6b7280; }

/* Alerts */
.alert { background: #fff; border: 1px solid var(--border); }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* Badges */
.badge-on { background: #f0fdf4; color: #15803d; }
.badge-pending { background: #fffbeb; color: #b45309; }
.badge-off { background: #f3f4f6; color: #6b7280; }

/* Empty states */
.empty-state h3 { color: #111827; }

/* Breadcrumb */
.breadcrumb a { color: #4b5563; }
.breadcrumb a:hover { color: #14a800; }

/* Cat tag */
.cat-tag { background: var(--primary-soft); color: #0f8a00; }

/* Earn card */
.earn-card { background: #fff; border: 1px solid var(--border-soft); }
.earn-card h2 { color: #111827; }
.earn-stat b { color: #14a800; }
.earn-stat { background: #0d1428; border-color: rgba(13, 20, 40, .12); }
.earn-stat span { color: #a5b4d8; }

/* Auth */
.auth-card { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); }
.auth-card h1 { color: #111827; }
.auth-alt, .auth-link a { color: #14a800; }

/* Dashboard */
.dash-head h1 { color: #111827; }
.user-table th { color: #6b7280; }
.user-table td { color: #1f2937; }

/* Blog */
.blog-card { background: #fff; border: 1px solid var(--border-soft); }
.blog-card h3 { color: #111827; }
.blog-card h3 a { color: #111827; }
.blog-meta { color: #6b7280; }
.post-body { color: #374151; }
.post-body strong { color: #111827; }
.post-body blockquote { border-left-color: #14a800; background: #f8fafc; color: #4b5563; }
.post-body pre { background: #0f172a; color: #e2e8f0; }
.post-body code { background: #f1f5f9; color: #be185d; }
.post-body pre code { background: transparent; color: #e2e8f0; }
.post-body img { border-radius: var(--radius-sm); }
.blog-head h1 { color: #111827; }
.blog-tag { background: var(--primary-soft); color: #0f8a00; }
.author-box { background: #f8fafc; border: 1px solid var(--border-soft); }
.author-box b { color: #111827; }

/* Tool pages */
.tool-head h1 { color: #111827; }
.tool-head p { color: #4b5563; }
.ctl-sec h3 { color: #111827; }
.ctl-sec label { color: #374151; }
input, textarea, select {
  background: #fff;
  color: #1f2937;
  border-color: #d1d5db;
}
input:focus, textarea:focus, select:focus {
  border-color: #14a800;
  box-shadow: 0 0 0 3px rgba(20,168,0,.12);
}
textarea { background: #fff; color: #1f2937; }

/* Markdown preview (blog editor) */
.markdown-preview { background: #f8fafc; border: 1px solid var(--border); }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { color: #111827; }
.markdown-preview pre { background: #0f172a; color: #e2e8f0; }

/* Locked premium preview */
.premium-lock-preview {
  background:
    radial-gradient(400px 200px at 20% 0%, rgba(251,191,36,.14), transparent 60%),
    radial-gradient(400px 220px at 85% 10%, rgba(20,168,0,.14), transparent 60%),
    linear-gradient(160deg, #f0fdf4, #dcfce7);
}
.premium-lock-preview .plp-bars span { background: rgba(20, 168, 0, .18); }
.premium-lock-preview .plp-art { color: rgba(20, 168, 0, .55); }
.plp-hero {
  background:
    radial-gradient(400px 200px at 20% 0%, rgba(251,191,36,.14), transparent 60%),
    radial-gradient(400px 220px at 85% 10%, rgba(20,168,0,.14), transparent 60%),
    linear-gradient(160deg, #f0fdf4, #dcfce7);
}
.canvas-frame { background: #fff; border: 1px solid var(--border); }
.canvas-frame canvas { background: #fff; }

/* How-it-works */
.how-card { background: #fff; border: 1px solid var(--border-soft); }
.how-card b { color: #111827; }
.how-num { background: var(--grad); color: #fff; }

/* CTA banner */
.cta-banner {
  background: linear-gradient(135deg, #0f8a00, #14a800 55%, #37c21e);
  border-radius: var(--radius-lg);
  color: #fff;
}
.cta-banner h2 { color: #fff; }
.cta-banner .muted { color: rgba(255,255,255,.85); }
.cta-banner .btn { background: #fff; color: #0f8a00; border-color: #fff; }
.cta-banner .btn:hover { background: #f0fdf4; color: #0f8a00; }

/* Tasks */
.task-card { background: #fff; border: 1px solid var(--border-soft); }
.task-card:hover { border-color: rgba(20,168,0,.45); box-shadow: var(--glow); }
.task-card h3 { color: #111827; }
.task-card p { color: #6b7280; }
.tasks-hero h1 { color: #111827; }
.task-detail-head h1 { color: #111827; }
.task-budget b { color: #14a800; }
.task-desc { color: #374151; }
.tabs .tab { background: #f5f7f9; border: 1px solid var(--border); color: #6b7280; }
.tabs .tab.active { background: #14a800; border-color: #14a800; color: #fff; }
.completions-box { background: #f8fafc; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.balance-strip { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius-sm); }
.balance-strip b { color: #15803d; }

/* Toast */
#toast { background: #111827; color: #fff; }

/* Scrollbar */
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Premium note */
.premium-note { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.premium-note a { color: #0f8a00; }

/* Tables */
.admin-table th { color: #6b7280; }
.admin-table td { color: #1f2937; }
.admin-table tbody tr:nth-child(even) { background: #fafbfc; }
.admin-table tbody tr:hover { background: #f0fdf4; }

/* ============================================================
   ToolHub v11 — Tasks marketplace + new home sections
   ============================================================ */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  margin: 22px 0 8px;
}
.home-tasks { margin-top: 10px; }
.task-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.task-card:hover { transform: translateY(-3px); border-color: rgba(20,168,0,.4); box-shadow: var(--shadow); }
.task-card h3 { font-size: 1.02rem; color: #111827; line-height: 1.4; }
.task-card p { color: #6b7280; font-size: .88rem; }
.task-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.task-card-meta b { color: #14a800; }
.tasks-hero {
  background:
    radial-gradient(600px 260px at 90% -20%, rgba(20,168,0,.10), transparent 60%),
    linear-gradient(160deg, #ffffff, #f5f7f9);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 5vw, 44px);
  margin-bottom: 24px;
}
.tasks-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: #111827; margin: 10px 0; }
.tasks-hero p { color: #4b5563; max-width: 620px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip-row .chip { padding: 8px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: #4b5563; font-size: .85rem; font-weight: 600; transition: all .15s; }
.chip-row .chip:hover { border-color: #14a800; color: #14a800; }
.chip-row .chip.active { background: #14a800; border-color: #14a800; color: #fff; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-row .chip { padding: 7px 13px; border-radius: 999px; background: #f5f7f9; border: 1px solid var(--border); color: #4b5563; font-size: .82rem; font-weight: 600; transition: all .15s; }
.filter-row .chip:hover { border-color: #14a800; color: #14a800; }
.filter-row .chip.active { background: #14a800; border-color: #14a800; color: #fff; }
.task-detail-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.task-detail-head h1 { font-size: clamp(1.3rem, 3vw, 1.8rem); color: #111827; margin: 10px 0 6px; }
.task-budget { text-align: right; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius-sm); padding: 14px 18px; }
.task-budget b { font-size: 1.3rem; color: #14a800; display: block; }
.task-budget span { color: #15803d; font-size: .85rem; }
.task-desc { color: #374151; line-height: 1.75; white-space: pre-wrap; margin-bottom: 20px; }
.task-complete-box { border-top: 1px solid var(--border-soft); padding-top: 20px; }
.task-complete-box h3 { margin-bottom: 12px; }
.login-note { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: var(--radius-sm); padding: 18px; }
.login-note .btn { margin-top: 10px; margin-right: 8px; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs .tab { padding: 10px 18px; border-radius: 999px; background: #f5f7f9; border: 1px solid var(--border); color: #6b7280; font-weight: 700; font-size: .9rem; cursor: pointer; transition: all .15s; }
.tabs .tab.active { background: #14a800; border-color: #14a800; color: #fff; }
.my-task-row { display: flex; flex-direction: column; gap: 12px; }
.my-task-main h3 { margin-top: 6px; }
.completions-box { background: #f8fafc; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.completion-item { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px; }
.completion-item p { margin: 4px 0; }
.how-wrap { max-width: 1240px; margin: 40px auto 10px; padding: 0 24px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 20px 0 24px; }
.how-card { background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 24px; }
.how-num { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; display: grid; place-items: center; margin-bottom: 12px; }
.how-card b { display: block; margin-bottom: 6px; }
.cta-banner {
  background: linear-gradient(135deg, #0f8a00, #14a800 55%, #37c21e);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px);
  margin: 26px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  color: #fff;
}
.cta-banner h2 { color: #fff; font-size: clamp(1.2rem, 2.6vw, 1.6rem); }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cta-actions .btn { background: #fff; color: #0f8a00; border-color: #fff; }
.cta-actions .btn:hover { background: #f0fdf4; }
.hero-earn-link { margin-top: 16px; font-size: .92rem; }
.hero-earn-link a { color: #14a800; font-weight: 700; }
.balance-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px; }
.mt { margin-top: 10px; }
@media (max-width: 640px) {
  .task-detail-head { flex-direction: column; }
  .task-budget { text-align: left; }
  .tasks-grid { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; align-items: flex-start; }
}

/* Auth premium note — light theme */
.auth-premium-note { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.auth-premium-note a { color: #0f8a00; }
/* ============================================================
   v13 — Task marketplace v2: slots, ratings, countdowns,
   notifications bell, pagination, modern cards
   ============================================================ */

/* --- Slots badges & progress --- */
.slots-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 700;
  color: #0f8a00;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.slots-badge.is-full { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.slots-progress { background: #f8fafc; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 12px 16px; margin: 14px 0 18px; }
.slots-progress-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; color: #111827; }
.slots-track { display: flex; gap: 6px; margin: 10px 0 6px; }
.slot-dot { flex: 1; height: 8px; border-radius: 999px; background: #e5e7eb; transition: background .2s; }
.slot-dot.is-filled { background: #fbbf24; }
.slot-dot.is-paid { background: #14a800; }

/* --- Countdown badges --- */
.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.countdown-badge.is-over { color: #92400e; background: #fef2f2; border-color: #fecaca; }

/* --- Task card footer --- */
.task-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.task-card { display: flex; flex-direction: column; }

/* --- Pagination --- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 26px 0 8px; }
.page-btn {
  min-width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-soft);
  background: #fff; color: #374151; font-weight: 700; font-size: .9rem; transition: all .15s;
}
.page-btn:hover { border-color: var(--primary); color: #0f8a00; }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* --- Notifications bell --- */
.bell-wrap { position: relative; }
.bell-btn {
  position: relative; width: 42px; height: 42px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--bg-raise); color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.bell-btn:hover { border-color: var(--primary); }
.bell-btn svg { width: 20px; height: 20px; }
.bell-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: #ef4444; color: #fff; font-size: .66rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.bell-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 10px);
  width: min(340px, calc(100vw - 32px)); background: #fff;
  border: 1px solid var(--border-soft); border-radius: 14px; box-shadow: var(--shadow);
  z-index: 90; overflow: hidden;
}
.bell-menu.show { display: block; animation: dropIn .18s ease; }
.bell-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.bell-head b { color: #111827; }
.bell-mark { background: none; border: 0; color: var(--primary); font-weight: 700; font-size: .8rem; cursor: pointer; }
.bell-mark:hover { text-decoration: underline; }
.bell-list { max-height: 340px; overflow-y: auto; }
.bell-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); transition: background .12s; }
.bell-item:hover { background: #f8fafc; }
.bell-item b { display: block; font-size: .88rem; color: #111827; }
.bell-item span { display: block; font-size: .8rem; color: #6b7280; margin-top: 2px; }
.bell-item em { display: block; font-size: .72rem; color: #9ca3af; font-style: normal; margin-top: 3px; }
.bell-item.unread { background: #f0fdf4; }
.bell-item.unread b::before { content: "● "; color: #14a800; }
.bell-empty { padding: 22px 16px; text-align: center; color: #9ca3af; font-size: .88rem; }

/* --- Worker rating --- */
.rating-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: .76rem; font-weight: 800;
  color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 999px;
  padding: 2px 9px; white-space: nowrap;
}
.worker-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.worker-avatar {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  background: linear-gradient(135deg, #14a800, #0ea5e9); color: #fff; font-weight: 800;
  font-size: .95rem; display: inline-flex; align-items: center; justify-content: center;
}
.completion-main { display: flex; gap: 12px; width: 100%; }
.completion-text { flex: 1; min-width: 0; }
.worker-proofs { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.worker-proofs a { color: var(--primary); font-weight: 700; }
.completion-item.is-approved { border-color: #bbf7d0; background: #fafffb; }
.rating-select { padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border-soft); background: #fff; color: #111827; font-size: .85rem; font-weight: 600; }
.approve-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.workers-box { margin-top: 22px; }
.workers-box h3 { font-size: 1.02rem; margin-bottom: 12px; color: #111827; }
.workers-box .completion-item { margin-bottom: 10px; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.task-budget span { display: block; margin-top: 2px; }

/* ============================================================
   ToolHub v16 — Growth features
   (daily bonus card, points/VIP plans, leaderboard, testimonials,
    share buttons, ad placeholder, growth settings, countdown)
   ============================================================ */

/* --- Daily bonus card --- */
.bonus-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0; border-radius: 16px; padding: 16px 20px;
  margin-bottom: 20px;
}
.bonus-card.bonus-done { background: #f9fafb; border-color: var(--border-soft); }
.bonus-card-ico {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 14px;
  background: #fff; border: 1px solid #bbf7d0; box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.bonus-card-body { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.bonus-card-body b { font-size: 1.02rem; color: #111827; }
.bonus-card-actions { display: flex; align-items: center; gap: 10px; }
.countdown {
  font-family: var(--mono); font-size: .9rem; font-weight: 700; color: var(--primary-strong);
  background: #fff; border: 1px solid #bbf7d0; border-radius: 10px; padding: 8px 14px;
}

/* --- Points / VIP plans --- */
.plans-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin: 22px 0;
}
.plan-card {
  position: relative; background: #fff; border: 1px solid var(--border-soft);
  border-radius: 16px; padding: 22px 18px; box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #bbf7d0; }
.plan-card.plan-vip { border-color: #fbbf24; background: linear-gradient(180deg, #fffbeb, #fff); }
.plan-flag {
  position: absolute; top: -10px; right: 14px; background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; font-size: .7rem; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  letter-spacing: .03em; box-shadow: var(--shadow-sm);
}
.plan-card h3 { font-size: 1.02rem; color: #111827; margin-bottom: 4px; }
.plan-price { font-size: 1.6rem; font-weight: 800; color: var(--primary-strong); margin-bottom: 10px; }
.plan-perks { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.plan-perks li { font-size: .86rem; color: #4b5563; display: flex; align-items: center; gap: 6px; }
.plan-perks li::before { content: "✓"; color: var(--primary); font-weight: 800; }
.plan-radio { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 12px; cursor: pointer; transition: border-color .12s, background .12s; }
.plan-radio:hover { border-color: var(--primary); background: var(--primary-soft); }
.plan-radio input { accent-color: var(--primary); width: 18px; height: 18px; }
.plan-radio span { font-size: .9rem; color: #374151; }

/* --- Plans editor (admin) --- */
.plans-editor { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.plan-edit-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.plan-edit-row .input { width: auto; }
.plan-edit-row .plan-key { width: 90px; }
.plan-edit-row .plan-name { width: 130px; }
.plan-edit-row .plan-bdt { width: 80px; }
.plan-edit-row .plan-pts { width: 90px; }
.plan-edit-row .plan-days { width: 110px; }
.plan-vip-check { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; color: #4b5563; cursor: pointer; }
.plan-vip-check input { accent-color: var(--primary); }

/* --- Leaderboard --- */
.lb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
@media (max-width: 720px) { .lb-grid { grid-template-columns: 1fr; } }
.lb-list { list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 0; }
.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--border-soft); border-radius: 12px;
}
.lb-row.lb-me { border-color: var(--primary); background: var(--primary-soft); }
.lb-rank { font-size: 1.15rem; width: 34px; text-align: center; font-weight: 800; color: #4b5563; }
.lb-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #14a800, #0ea5e9); color: #fff;
  font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.lb-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.lb-name b { color: #111827; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-vip { font-size: .66rem; padding: 2px 7px; }
.lb-val { font-size: .92rem; color: #4b5563; white-space: nowrap; }
.lb-val b { color: var(--primary-strong); }

/* --- Testimonials --- */
.testimonial-wrap { padding-top: 40px; }
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.testimonial-card {
  background: #fff; border: 1px solid var(--border-soft); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow-sm);
}
.testimonial-card .stars { color: #f59e0b; font-size: .95rem; letter-spacing: 2px; margin-bottom: 10px; }
.testimonial-card p { font-size: .92rem; color: #374151; line-height: 1.6; }
.t-author { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.t-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft);
  color: var(--primary-strong); font-weight: 800; display: inline-flex;
  align-items: center; justify-content: center;
}

/* --- Social share buttons --- */
.share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.share-label { font-size: .82rem; font-weight: 700; color: #6b7280; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border-radius: 999px; font-size: .8rem; font-weight: 700; color: #fff;
  text-decoration: none; transition: transform .12s, filter .12s;
}
.share-btn:hover { transform: translateY(-1px); filter: brightness(1.08); color: #fff; }
.share-btn svg { width: 15px; height: 15px; }
.share-fb { background: #1877f2; }
.share-wa { background: #25d366; }
.share-tg { background: #229ed9; }
.share-x { background: #0f1419; }
.post-share .share-row { margin: 0; }

/* --- Ad placeholder --- */
.ad-placeholder {
  min-height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: repeating-linear-gradient(45deg, #f9fafb, #f9fafb 12px, #f3f4f6 12px, #f3f4f6 24px);
  border: 1px dashed #d1d5db; border-radius: 10px; color: #9ca3af; text-align: center; padding: 16px;
}
.ad-placeholder-ico { font-size: 1.3rem; }
.ad-placeholder-txt { font-weight: 800; font-size: .9rem; color: #6b7280; letter-spacing: .02em; }
.ad-placeholder-sub { font-size: .74rem; }

/* --- Growth admin --- */
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.switch-row { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; color: #374151; }
.switch-mini {
  width: 40px; height: 22px; border-radius: 999px; background: #d1d5db; position: relative;
  transition: background .15s; flex-shrink: 0;
}
.switch-mini::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left .15s; box-shadow: var(--shadow-sm);
}
.switch-row input:checked + .switch-mini { background: var(--primary); }
.switch-row input:checked + .switch-mini::after { left: 20px; }
.switch-row input { display: none; }

/* --- Growth strip (earn page) --- */
.growth-strip {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 4px;
}
.growth-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px;
  background: #fff; border: 1px solid var(--border-soft); border-radius: 999px;
  font-size: .86rem; font-weight: 700; color: #374151; text-decoration: none;
  transition: border-color .12s, color .12s, transform .12s, box-shadow .12s;
}
.growth-chip:hover { border-color: var(--primary); color: var(--primary-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ============================================================
   ToolHub v17 — dark mode, toasts, back-to-top, favorites,
   activity timeline, dashboard widgets, responsive tables
   ============================================================ */

/* ---------- Dark mode: CSS variable overrides ---------- */
html.dark {
  --bg: #0a0f1e;
  --bg-soft: #111a30;
  --bg-raise: #131d36;
  --card: #141e38;
  --card-hover: #1b2745;
  --border: #2a3a5e;
  --border-soft: #1e2a49;
  --text: #f1f5ff;
  --text-dim: #b3bdd8;
  --text-faint: #7d8ab0;
  --primary: #34d399;
  --primary-strong: #2fbf88;
  --primary-soft: rgba(52, 211, 153, .14);
  --accent: #34d399;
  --accent-soft: rgba(52, 211, 153, .10);
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --shadow-sm: 0 1px 3px rgba(2, 6, 23, .4), 0 1px 2px rgba(2, 6, 23, .3);
  --shadow: 0 8px 24px rgba(2, 6, 23, .45);
  --shadow-lg: 0 20px 48px rgba(2, 6, 23, .6);
  --grad: linear-gradient(135deg, #34d399 0%, #22d3ee 60%, #6366f1 100%);
  --grad-soft: linear-gradient(135deg, rgba(52, 211, 153, .12), rgba(34, 211, 238, .08));
  color-scheme: dark;
}

html.dark body {
  background:
    radial-gradient(1000px 460px at 90% -10%, rgba(52, 211, 153, .07), transparent 60%),
    radial-gradient(760px 400px at -8% 0%, rgba(34, 211, 238, .05), transparent 55%),
    linear-gradient(180deg, #0c1224 0%, var(--bg) 45%, #080d1a 100%);
}

/* ---------- Dark mode: hardcoded light colors from the v11 override block ---------- */
html.dark .site-header { background: rgba(6, 9, 20, .88); border-bottom-color: var(--border); }
html.dark .main-nav a { color: #c4cce4; }
html.dark .main-nav a:hover { color: var(--primary); }
html.dark .main-nav a.active { color: var(--primary); background: var(--primary-soft); }
html.dark .search-suggest a:hover { background: var(--primary-soft); color: var(--primary); }
html.dark .nav-right .nav-search input, html.dark .nav-search input { background: var(--bg-soft); color: var(--text); }
html.dark .user-menu { background: var(--bg-raise); border-color: var(--border); }
html.dark .user-menu a, html.dark .user-menu button { color: var(--text); }
html.dark .user-menu a:hover, html.dark .user-menu button:hover { background: var(--primary-soft); color: var(--primary); }
html.dark .user-menu .um-head b { color: var(--text); }
html.dark .user-menu .um-head span { color: var(--text-faint); }
html.dark .user-menu .um-danger:hover { background: rgba(248, 113, 113, .12); color: var(--red); }
html.dark .user-menu .um-danger svg { color: var(--red); }
html.dark .user-chip { color: var(--text); }
html.dark .mobile-menu { background: var(--bg-raise); }
html.dark .mobile-menu a { color: var(--text); }
html.dark .mobile-menu a:hover, html.dark .mobile-menu a.active { background: var(--primary-soft); color: var(--primary); }
html.dark .mm-search input { background: var(--bg-soft); color: var(--text); border-color: var(--border); }
html.dark .btn { background: var(--bg-raise); color: var(--text); border-color: var(--border); }
html.dark .btn:hover { border-color: var(--primary); color: var(--primary); }
html.dark .btn-primary { background: var(--primary); border-color: var(--primary); color: #06281a; }
html.dark .btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #06281a; }
html.dark .btn-ghost { background: transparent; color: var(--primary); }
html.dark .btn-ghost:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
html.dark .btn-danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .35); color: var(--red); }
html.dark .btn-danger:hover { background: rgba(248, 113, 113, .2); border-color: var(--red); color: var(--red); }
html.dark .panel { background: var(--bg-raise); border-color: var(--border-soft); box-shadow: var(--shadow-sm); }
html.dark .panel h2, html.dark .panel h3 { color: var(--text); }
html.dark .site-footer { background: linear-gradient(180deg, #0d1428 0%, #080d1a 100%); }
html.dark .footer-col ul a { color: #b3bdd8; }
html.dark .footer-col ul a:hover { color: var(--primary); }
html.dark .footer-col p { color: var(--text-dim); }
html.dark .newsletter input { background: var(--bg-soft); color: var(--text); border-color: var(--border); }
html.dark .footer-bottom { color: var(--text-faint); }
html.dark .footer-links a { color: var(--text-dim); }
html.dark .footer-links a:hover { color: var(--primary); }
html.dark .hero-badge { background: var(--primary-soft); border-color: rgba(52, 211, 153, .25); color: #6ee7a8; }
html.dark .hero h1 { color: var(--text); }
html.dark .hero p { color: var(--text-dim); }
html.dark .hero-stats .stat b { color: var(--text); }
html.dark .hero-stats .stat span { color: var(--text-dim); }
html.dark .alert { background: var(--bg-raise); border-color: var(--border); }
html.dark .alert-success { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .35); color: var(--green); }
html.dark .alert-error { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .35); color: var(--red); }
html.dark .badge-on { background: rgba(52, 211, 153, .14); color: var(--green); }
html.dark .badge-pending { background: rgba(251, 191, 36, .14); color: var(--amber); }
html.dark .badge-off { background: rgba(148, 163, 184, .14); color: var(--text-dim); }
html.dark .empty-state h3 { color: var(--text); }
html.dark .breadcrumb a { color: var(--text-dim); }
html.dark .breadcrumb a:hover { color: var(--primary); }
html.dark .earn-card { background: var(--bg-raise); border-color: var(--border-soft); }
html.dark .earn-card h2 { color: var(--text); }
html.dark .earn-stat b { color: var(--primary); }
html.dark .earn-stat span { color: #a5b4d8; font-weight: 700; letter-spacing: .04em; }
html.dark .auth-card { background: var(--bg-raise); border-color: var(--border); box-shadow: var(--shadow); }
html.dark .auth-card h1 { color: var(--text); }
html.dark .task-card { background: var(--card); border-color: var(--border-soft); }
html.dark .task-card:hover { border-color: rgba(52, 211, 153, .5); box-shadow: var(--glow); }
html.dark .task-card h3 { color: var(--text); }
html.dark .task-card p { color: var(--text-dim); }
html.dark .tasks-hero h1 { color: var(--text); }
html.dark .task-detail-head h1 { color: var(--text); }
html.dark .task-budget b { color: var(--primary); }
html.dark .task-desc { color: var(--text); }
html.dark .tabs .tab { background: var(--bg-soft); border-color: var(--border); color: var(--text-dim); }
html.dark .tabs .tab.active { background: var(--primary); border-color: var(--primary); color: #06281a; }
html.dark .completions-box { background: var(--bg-soft); border-color: var(--border-soft); }
html.dark .balance-strip { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .3); }
html.dark .balance-strip b { color: var(--green); }
html.dark #toast { background: #1a2340; color: var(--text); border-color: var(--border); }
html.dark .premium-note { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .3); color: var(--amber); }
html.dark .premium-note a:not(.btn) { color: var(--primary); }
html.dark .premium-note a.btn { color: var(--text); }
html.dark .premium-note a.btn-primary { color: #06281a; }
html.dark .admin-table th { color: var(--text-dim); }
html.dark .admin-table td { color: var(--text); }
html.dark .admin-table tbody tr:nth-child(even) { background: var(--bg-soft); }
html.dark .admin-table tbody tr:hover { background: var(--primary-soft); }
html.dark .switch-row { color: var(--text); }
html.dark .switch-mini { background: var(--border); }
html.dark .growth-chip { background: var(--bg-raise); border-color: var(--border-soft); color: var(--text); }
html.dark .growth-chip:hover { border-color: var(--primary); color: var(--primary); }
html.dark .ad-placeholder { background: repeating-linear-gradient(45deg, var(--bg-soft), var(--bg-soft) 12px, var(--bg-raise) 12px, var(--bg-raise) 24px); border-color: var(--border); }
html.dark .ad-placeholder-txt { color: var(--text-dim); }
html.dark .field input, html.dark .field textarea, html.dark .field select,
html.dark input[type="text"], html.dark input[type="search"], html.dark input[type="email"],
html.dark input[type="password"], html.dark input[type="number"], html.dark input[type="url"],
html.dark input[type="date"], html.dark textarea, html.dark select {
  background: var(--bg-soft); border-color: var(--border); color: var(--text);
}
html.dark .field input:focus, html.dark .field textarea:focus, html.dark .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
html.dark .search-field input { background: var(--bg-soft); color: var(--text); }
html.dark .search-field { background: var(--bg-raise); border-color: var(--border); }
html.dark .chip { background: var(--bg-raise); border-color: var(--border-soft); color: var(--text-dim); }
html.dark .chip:hover { border-color: var(--primary); color: var(--primary); }
html.dark .chip.active { background: var(--primary); border-color: var(--primary); color: #06281a; }
html.dark .tool-count { color: var(--text-dim); }
html.dark .how-card, html.dark .testimonial-card, html.dark .premium-dash-card { background: var(--bg-raise); border-color: var(--border-soft); }
html.dark .how-card b, html.dark .testimonial-card b, html.dark .premium-dash-card b { color: var(--text); }
html.dark .bell-menu { background: var(--bg-raise); border-color: var(--border); }
html.dark .bell-item b { color: var(--text); }
html.dark .bell-empty { color: var(--text-dim); }
html.dark .slots-badge, html.dark .countdown-badge { background: var(--bg-soft); border-color: var(--border); color: var(--text-dim); }
html.dark .pagination .page-btn { background: var(--bg-raise); border-color: var(--border-soft); color: var(--text-dim); }
html.dark .pagination .page-btn.active { background: var(--primary); border-color: var(--primary); color: #06281a; }
html.dark .bonus-card { background: var(--bg-raise); border-color: var(--border-soft); }
html.dark .dash-head h1 { color: var(--text); }
html.dark .muted { color: var(--text-dim); }
html.dark .progress-bar { background: var(--bg-soft); }
html.dark .progress-bar i { background: var(--grad); }
html.dark .earn-tx li { border-color: var(--border-soft); }
html.dark .hist-item { background: var(--bg-soft); border-color: var(--border-soft); }
html.dark .search-suggest { background: var(--bg-raise); border-color: var(--border); }
html.dark .ss-name { color: var(--text); }
html.dark .ss-cat { color: var(--text-faint); }
html.dark .auth-link { color: var(--text-dim); }
html.dark .auth-link:hover { color: var(--primary); }

/* ---------- Theme toggle button ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--bg-raise);
  color: var(--text-dim); cursor: pointer; transition: all .18s; flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .theme-sun { display: none; }

/* ---------- Enhanced toast (success / error / info) ---------- */
#toast.toast-success { background: #15803d; color: #fff; border-color: rgba(255,255,255,.25); }
#toast.toast-error { background: #b91c1c; color: #fff; border-color: rgba(255,255,255,.25); }
#toast.toast-info { background: rgba(29, 39, 73, .95); color: #fff; border-color: var(--border); }
html.dark #toast.toast-success { background: #166534; }
html.dark #toast.toast-error { background: #7f1d1d; }
html.dark #toast.toast-info { background: #1a2340; }

/* ---------- Back to top ---------- */
#backToTop {
  position: fixed; right: 22px; bottom: 84px; z-index: 90;
  width: 44px; height: 44px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-raise); color: var(--primary);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  cursor: pointer; opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .22s, transform .22s, border-color .18s;
}
#backToTop.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
#backToTop:hover { border-color: var(--primary); }
#backToTop svg { width: 20px; height: 20px; }

/* ---------- Page fade-in ---------- */
body { opacity: 0; }
body.page-loaded { opacity: 1; transition: opacity .25s ease; }
@media (prefers-reduced-motion: reduce) { body { opacity: 1; transition: none; } }

/* ---------- Skeleton placeholders ---------- */
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg-raise) 50%, var(--bg-soft) 75%); background-size: 200% 100%; animation: skeletonShine 1.4s infinite; }
@keyframes skeletonShine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Favorites star ---------- */
.fav-btn {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(10, 14, 26, .55); border: 1px solid var(--border-soft);
  color: #cbd5e1; cursor: pointer; backdrop-filter: blur(4px);
  transition: all .18s;
}
.fav-btn:hover { border-color: var(--amber); color: var(--amber); transform: scale(1.08); }
.fav-btn.active { background: rgba(251, 191, 36, .18); border-color: rgba(251, 191, 36, .5); color: #fbbf24; }
.fav-btn svg { width: 16px; height: 16px; }
.fav-btn .fav-fill { display: none; }
.fav-btn.active .fav-fill { display: block; }
.fav-btn.active .fav-line { display: none; }

/* ---------- Activity timeline ---------- */
.timeline { position: relative; margin: 22px 0 6px; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(180deg, var(--primary-soft), var(--border));
  border-radius: 999px;
}
.tl-item { position: relative; padding: 0 0 26px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -34px; top: 2px; width: 24px; height: 24px;
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-raise); border: 1px solid var(--border);
  font-size: .8rem; box-shadow: var(--shadow-sm);
}
.tl-body { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.tl-title { font-weight: 700; color: var(--text); font-size: .93rem; }
.tl-label { display: block; font-size: .76rem; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tl-date { font-size: .78rem; color: var(--text-faint); }
.tl-pts {
  font-weight: 800; font-size: .92rem; padding: 4px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
}
.tl-pts.neg { background: rgba(248, 113, 113, .12); color: var(--red); }
.tl-link { font-size: .78rem; color: var(--primary); font-weight: 600; }
.activity-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 18px 0;
}
.activity-summary .stat { background: var(--bg-raise); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px; text-align: center; }
.activity-summary .stat b { display: block; font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.activity-summary .stat span { font-size: .78rem; color: var(--text-dim); }

/* ---------- Dashboard quick stat cards ---------- */
.quick-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin: 20px 0;
}
.qstat {
  display: flex; align-items: center; gap: 13px;
  background: var(--bg-raise); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 16px 18px; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.qstat:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--glow); }
.qstat-ico {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-soft); color: var(--primary); border: 1px solid var(--border-soft);
  font-size: 1.25rem;
}
.qstat b { display: block; font-size: 1.28rem; font-weight: 800; color: var(--text); line-height: 1.15; }
.qstat span { font-size: .76rem; color: var(--text-dim); font-weight: 600; }

/* ---------- Mini activity chart (dashboard) ---------- */
.mini-chart {
  display: flex; align-items: flex-end; gap: 6px; height: 74px; padding: 6px 2px 0;
}
.mini-chart .bar {
  flex: 1; border-radius: 6px 6px 3px 3px; min-height: 4px;
  background: linear-gradient(180deg, var(--primary), var(--primary-soft));
  transition: height .5s ease; position: relative;
}
.mini-chart .bar:hover { background: var(--primary-strong); }
.chart-labels { display: flex; gap: 6px; margin-top: 6px; }
.chart-labels span { flex: 1; text-align: center; font-size: .66rem; color: var(--text-faint); }

/* ---------- Responsive tables: sticky header + scroll hint ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
.admin-table { border-collapse: separate; border-spacing: 0; min-width: 640px; width: 100%; }
.admin-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
}
html.dark .admin-table thead th { background: #141b30; }
.table-scroll-hint {
  display: none; align-items: center; gap: 6px;
  font-size: .72rem; color: var(--text-faint); margin: 6px 2px 10px;
}
.table-scroll-hint.show { display: flex; }
@media (max-width: 640px) {
  .table-scroll-hint { display: flex; }
  .admin-table { min-width: 560px; }
}

/* ---------- Favorites page ---------- */
.favs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 20px; }

/* ---------- Enhanced empty states ---------- */
.empty-state {
  text-align: center; padding: 56px 24px;
  background: var(--bg-raise); border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-ico {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; background: var(--grad-soft); border: 1px solid var(--border-soft);
}
.empty-state h3 { font-size: 1.1rem; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.empty-state p { color: var(--text-dim); max-width: 380px; margin: 0 auto; }
.empty-state .btn { margin-top: 18px; }

/* ---------- Fav star inside tool card (positioning fix) ---------- */
.tool-card { padding-top: 34px; }
.tool-card .cat-tag { top: 13px; right: 12px; }

/* ---------- v17b: mobile header squeeze (must come LAST to win the cascade) ---------- */
@media (max-width: 860px) {
  .nav-right { gap: 7px; }
  .theme-toggle { width: 34px; height: 34px; }
  .theme-toggle svg { width: 16px; height: 16px; }
  .bell-btn { width: 34px; height: 34px; }
  .bell-btn svg { width: 17px; height: 17px; }
  .user-chip { padding: 4px 6px 4px 4px; }
  .user-chip .chip-name { display: none; }
  .user-avatar { width: 26px; height: 26px; font-size: .78rem; }
  .hamburger { width: 34px; height: 34px; }
  .hamburger svg { width: 18px; height: 18px; }
}
/* Make sure the fav-btn on cards never exceeds card bounds on tiny screens */
@media (max-width: 480px) {
  .fav-btn { width: 28px; height: 28px; top: 10px; left: 10px; }
  .tool-card { padding-top: 30px; }
}