/* ============================================
   TextPlayground — Master Stylesheet
   Dark Obsidian + Electric Violet
   ============================================ */

/* RESET & TOKENS */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[x-cloak] { display: none !important; }

:root {
  --bg:       #F1F5F9;    /* slightly darker background (5-10% darker) */
  --surface:  #FFFFFF;    /* pure white cards (pops against bg) */
  --surface2: #E2E8F0;    /* secondary subtle panels */
  --border:   rgba(15,23,42,0.08); /* subtle dark border */
  --bv:       rgba(99,102,241,0.4);   /* border hover — indigo */
  --accent:   #6366F1;    /* indigo-500 */
  --acl:      #4F46E5;    /* indigo-600 — darker for hover in light mode */
  --glow:     rgba(99,102,241,0.15);
  --t1:       #0F172A;    /* slate-900 heading text */
  --t2:       #334155;    /* slate-700 darker body text */
  --t3:       #64748B;    /* slate-500 darker muted text */
}

html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }

body {
  background: var(--bg) !important;
  color: var(--t1) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  overflow-x: hidden;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
::selection { background: var(--accent); color: #fff; }

/* ── HEADER ── */
#tp-header-outer {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 1.25rem 0;
  pointer-events: none;
}
#tp-header-outer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 80px;
  background: linear-gradient(to bottom, var(--bg) 30%, transparent);
  pointer-events: none;
  z-index: -1;
}
#tp-header {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
  pointer-events: all;
}
#tp-header.scrolled {
  background: rgba(255,255,255,0.95);
  border-color: rgba(99,102,241,0.35);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 0 0 1px rgba(99,102,241,0.12);
}
.tp-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.tp-logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px; color: #fff;
  flex-shrink: 0;
  transition: box-shadow 0.2s;
}
.tp-logo:hover .tp-logo-mark { box-shadow: 0 0 16px rgba(99,102,241,0.7); }
.tp-logo-name {
  font-weight: 700; font-size: 1rem; color: var(--t1);
  letter-spacing: -0.01em;
}
.tp-nav { display: flex; align-items: center; gap: 1.5rem; }
.tp-nav a {
  position: relative;
  color: var(--t2);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.2s;
}
.tp-nav a::after {
  content: '';
  position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--acl);
  transition: width 0.25s cubic-bezier(0.16,1,0.3,1);
}
.tp-nav a:hover { color: var(--t1); }
.tp-nav a:hover::after { width: 100%; }

/* Dropdown */
.tp-dropdown {
  position: relative;
}
.tp-dropdown-trigger {
  display: flex; align-items: center; gap: 5px;
  position: relative;
  color: var(--t2);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  padding: 4px 0;
  cursor: pointer;
  background: none; border: none; font-family: inherit;
  transition: color 0.2s;
}
.tp-dropdown-trigger::after {
  content: '';
  position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--acl);
  transition: width 0.25s cubic-bezier(0.16,1,0.3,1);
}
.tp-dropdown:hover .tp-dropdown-trigger { color: var(--t1); }
.tp-dropdown:hover .tp-dropdown-trigger::after { width: 100%; }
.tp-dropdown-trigger svg {
  width: 12px; height: 12px; flex-shrink: 0;
  transition: transform 0.2s;
}
.tp-dropdown:hover .tp-dropdown-trigger svg { transform: rotate(180deg); }

.tp-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  background: rgba(255,255,255,0.98);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.6rem;
  box-shadow: 0 16px 32px rgba(0,0,0,0.08), 0 0 0 1px rgba(99,102,241,0.10);
  backdrop-filter: blur(24px);
  z-index: 200;
  /* Pointer arrow */
  animation: dropIn 0.18s cubic-bezier(0.16,1,0.3,1);
}
@keyframes dropIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* Bridge gap so hover doesn't break on mouse move */
.tp-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -24px; left: -20px; right: -20px;
  height: 24px;
}
.tp-dropdown:hover .tp-dropdown-menu { display: block; }

.tp-dropdown-menu a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  color: var(--t2); font-size: 0.84rem; font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.tp-dropdown-menu a:hover { background: var(--surface2); color: var(--t1); }
.tp-dropdown-menu a:hover::after { display: none; }
.tp-dropdown-sep {
  height: 1px; background: var(--border);
  margin: 0.4rem 0.6rem;
}
.tp-dropdown-footer {
  padding: 0.5rem 0.9rem 0.3rem;
}
.tp-dropdown-footer a {
  display: flex; align-items: center; gap: 6px;
  color: var(--acl) !important; font-size: 0.8rem; font-weight: 600;
  justify-content: flex-start;
}
.tp-dropdown-footer a:hover { background: transparent !important; }

/* Mobile */
.tp-hamburger {
  display: none;
  background: transparent; border: none;
  border-radius: 8px; padding: 6px; cursor: pointer; color: var(--t2);
}
@media(max-width: 640px) {
  .tp-nav { display: none; }
  .tp-hamburger { display: flex; align-items: center; }
}
.tp-mobile-menu {
  display: none;
  position: fixed; top: 80px; left: 1.25rem; right: 1.25rem;
  background: rgba(255,255,255,0.98); border: 1px solid var(--border);
  border-radius: 18px; padding: 0.75rem;
  flex-direction: column; gap: 4px;
  backdrop-filter: blur(24px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  z-index: 99;
}
.tp-mobile-menu.open { display: flex; }
.tp-mobile-menu a {
  color: var(--t2); text-decoration: none;
  padding: 0.75rem 1rem; border-radius: 10px;
  font-size: 0.9rem; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.tp-mobile-menu a:hover { background: var(--surface2); color: var(--t1); }

/* ── MARQUEE ── */
.tp-marquee-wrap {
  overflow: hidden;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0;
}
.tp-marquee-track {
  display: flex; white-space: nowrap; width: max-content; gap: 4rem;
  animation: marquee 30s linear infinite;
}
.tp-marquee-track:hover { animation-play-state: paused; cursor: default; }
@keyframes marquee { from{transform:translateX(0)} to{transform:translateX(-50%)} }
.tp-marquee-track span { color: var(--t3); font-size: 0.8rem; letter-spacing: 0.03em; }

/* ── HERO ── */
.tp-hero {
  min-height: calc(100dvh - 38px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 3rem;
  padding: 4rem 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow: clip;
}
.tp-hero-left {
  display: flex; flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.tp-hero-right {
  display: flex; justify-content: center; align-items: center;
}
.tp-hero-img {
  width: 100%; max-width: 500px; height: auto;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.06));
}
.tp-hero-glow {
  position: absolute;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 68%);
  top: 50%; left: 0%; transform: translate(-30%,-50%);
  pointer-events: none;
}

.tp-h1 {
  font-size: clamp(2rem, 8vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--t1);
  margin-bottom: 1.25rem;
  word-break: break-word;
  overflow-wrap: break-word;
}
.tp-h1 .tp-blue { color: var(--accent); }
.tp-subhead {
  font-size: 1.1rem; color: var(--t2);
  line-height: 1.6; max-width: 500px; margin-bottom: 2.5rem;
}

/* Search */
.tp-search-wrap { width: 100%; max-width: 540px; margin: 0; box-sizing: border-box; }
.tp-search-box {
  display: flex; align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.tp-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}
.tp-search-box svg { margin: 0 14px; flex-shrink: 0; color: var(--t3); }
.tp-search-box input {
  flex: 1; padding: 0.85rem 1rem 0.85rem 0;
  background: transparent; border: none; outline: none;
  font-size: 0.95rem; color: var(--t1);
  font-family: inherit;
  width: 100%;
}
.tp-search-box input::placeholder { color: var(--t3); }

.tp-search-box-large {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tp-search-box-large:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow);
}
.tp-search-box-large input {
  flex: 1; padding: 0 1.5rem;
  background: transparent; border: none; outline: none;
  font-size: 1.05rem; color: var(--t1);
  font-family: inherit;
}
.tp-search-box-large input::placeholder { color: var(--t3); }
.tp-search-btn {
  background: #10B981;
  color: #fff; border: none; border-radius: 99px;
  padding: 0.8rem 1.8rem; font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: opacity 0.2s;
}
.tp-search-btn:hover { opacity: 0.9; }

.tp-hero-badges { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.tp-pill-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #E0E7FF; color: #4338CA;
  padding: 6px 14px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600;
}
.tp-pill-badge svg { color: #4338CA; }

@media (max-width: 900px) {
  .tp-hero { grid-template-columns: 1fr; text-align: center; padding-top: 4rem; gap: 2rem; padding-left: 1rem; padding-right: 1rem; overflow: hidden; box-sizing: border-box; }
  .tp-hero-left { align-items: center; text-align: center; box-sizing: border-box; width: 100%; }
  .tp-subhead { max-width: 600px; padding: 0 10px; box-sizing: border-box; width: 100%; }
  .tp-hero-img { max-width: 400px; margin-top: 1rem; }
  .tp-hero-badges { justify-content: center; }
}

/* ── TOOL GRID ── */
.tp-grid-section { padding: 3.5rem 1.5rem; max-width: 1280px; margin: 0 auto; width: 100%; box-sizing: border-box; }

.tp-filter-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 2.5rem; }
.tp-pill {
  padding: 6px 18px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--t2);
  font-size: 0.8rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
.tp-pill:hover, .tp-pill.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

.tp-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}
.tp-tool-card {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
  min-height: 200px;
  position: relative;
}
.tp-tool-card:hover {
  border-color: var(--bv);
  background: var(--surface2);
  transform: translateY(-3px);
}
.tp-tool-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--acl);
}
.tp-tool-card-icon svg { width: 18px; height: 18px; }
.tp-card-body { margin-top: auto; padding-top: 1.5rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.tp-card-name { font-size: 1.05rem; font-weight: 700; color: var(--t1); margin-bottom: 4px; letter-spacing: -0.01em; }
.tp-card-desc { font-size: 0.8rem; color: var(--t2); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tp-card-arrow {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.tp-card-arrow svg { width: 14px; height: 14px; color: #fff; }
.tp-tool-card:hover .tp-card-arrow { opacity: 1; transform: translateX(0); }

/* ── MAIN CONTENT ── */
.tp-content {
  max-width: 1000px;
  margin: 6.5rem auto 4rem;
  padding: 0 1.5rem;
  display: flex; flex-direction: column; gap: 1.75rem;
}
.tp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  transition: border-color 0.25s;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}
@media (min-width: 768px) {
  .tp-card { padding: 2rem; }
}
.tp-card:hover { border-color: rgba(99,102,241,0.2); }
.tp-card h2, .tp-card h3 { color: var(--t1); letter-spacing: -0.02em; margin-bottom: 1.25rem; }
.tp-card h2 { font-size: 1.6rem; font-weight: 800; }
.tp-card h3 { font-size: 1.2rem; font-weight: 700; }
.tp-card p { color: var(--t2); line-height: 1.75; font-size: 0.9rem; margin-bottom: 0.9rem; }
.tp-card p:last-child { margin-bottom: 0; }

.tp-link { color: var(--acl); font-weight: 600; text-decoration: none; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 4px; transition: gap 0.2s; }
.tp-link:hover { gap: 8px; }

/* Intro 2-col */
.tp-intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
@media(max-width:720px){ .tp-intro-grid { grid-template-columns: 1fr; } }

.tp-style-preview { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.tp-style-preview-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--t3); margin-bottom: 0.25rem; }
.tp-style-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 0.85rem; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.tp-style-row:hover { border-color: var(--bv); }
.tp-style-row-text { font-size: 1rem; color: var(--t1); }
.tp-style-row-label { font-size: 0.68rem; color: var(--t3); }

blockquote.tp-quote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.25rem;
  color: var(--t2); font-style: italic;
  font-size: 0.925rem; line-height: 1.7;
  margin: 1.5rem 0;
}

/* 2-col card grid */
.tp-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
@media(max-width:720px){ .tp-2col { grid-template-columns: 1fr; } }

/* Steps list */
.tp-steps { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.5rem; }
.tp-step { display: flex; gap: 0.9rem; align-items: flex-start; }
.tp-step-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; color: #fff; margin-top: 2px;
}
.tp-step-title { font-size: 0.875rem; font-weight: 700; color: var(--t1); display: block; margin-bottom: 3px; }
.tp-step-body { font-size: 0.8rem; color: var(--t2); line-height: 1.6; }

/* Feature tiles */
.tp-feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 1.25rem; }
.tp-feature-tile {
  padding: 1.5rem; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  display: flex; flex-direction: column; align-items: flex-start;
}
.tp-feature-tile:hover { 
  border-color: rgba(99,102,241,0.3); 
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.tp-feature-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(99,102,241,0.08); color: var(--acl);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.tp-feature-tile strong { display: block; font-size: 0.95rem; font-weight: 700; color: var(--t1); margin-bottom: 6px; }
.tp-feature-tile p { font-size: 0.85rem; color: var(--t2); line-height: 1.6; margin: 0; }

/* Tools list cards */
.tp-tools-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.tp-tool-list-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: border-color 0.2s;
}
.tp-tool-list-card:hover { border-color: var(--bv); }
.tp-tool-list-card img { width: 100%; height: 110px; object-fit: cover; display: block; }
.tp-tool-list-card-body { padding: 1rem; }
.tp-tool-list-card h4 { font-size: 0.875rem; font-weight: 700; color: var(--t1); margin-bottom: 5px; }
.tp-tool-list-card p { font-size: 0.775rem; color: var(--t2); line-height: 1.6; margin-bottom: 0.65rem; }

/* Who uses */
.tp-user-row {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 1.25rem; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  transition: border-color 0.2s; margin-bottom: 0.75rem;
}
.tp-user-row:last-child { margin-bottom: 0; }
.tp-user-row:hover { border-color: var(--bv); }
.tp-user-icon {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px;
  background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.2);
  display: flex; align-items: center; justify-content: center;
}
.tp-user-icon svg { width: 16px; height: 16px; color: var(--acl); }
.tp-user-row h4 { font-size: 0.875rem; font-weight: 700; color: var(--t1); margin-bottom: 3px; }
.tp-user-row p { font-size: 0.8rem; color: var(--t2); line-height: 1.6; margin: 0; }

/* FAQ */
.tp-faq-list { display: flex; flex-direction: column; gap: 0.6rem; max-width: 740px; margin: 0 auto; }
.tp-faq-item {
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.tp-faq-item.open { border-color: rgba(99,102,241,0.4); }
.tp-faq-btn {
  width: 100%; padding: 1.1rem 1.4rem;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface2); cursor: pointer;
  border: none; text-align: left; gap: 1rem;
  font-family: inherit;
}
.tp-faq-q { font-weight: 600; font-size: 0.9rem; color: var(--t1); }
.tp-faq-icon { flex-shrink: 0; width: 16px; height: 16px; color: var(--t3); transition: transform 0.3s; }
.tp-faq-item.open .tp-faq-icon { transform: rotate(180deg); color: var(--acl); }
.tp-faq-body { display: none; padding: 1.1rem 1.4rem; color: var(--t2); font-size: 0.875rem; line-height: 1.75; background: var(--surface); }
.tp-faq-item.open .tp-faq-body { display: block; }

/* CTA */
.tp-cta {
  text-align: center; padding: 2rem 1.5rem 1rem;
  position: relative; overflow: hidden;
}
.tp-cta-glow {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 600px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.12), transparent 70%);
  pointer-events: none;
}
.tp-cta h3 { font-size: 2rem; font-weight: 900; color: var(--t1); letter-spacing: -0.03em; margin-bottom: 0.9rem; position: relative; }
.tp-cta p { color: var(--t2); max-width: 450px; margin: 0 auto 2.25rem; line-height: 1.7; font-size: 0.95rem; position: relative; }

/* Buttons */
.tp-btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff;
  padding: 0.85rem 2rem; border-radius: 12px;
  font-weight: 700; font-size: 0.95rem;
  text-decoration: none; border: none; cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 24px rgba(99,102,241,0.4);
  position: relative;
}
.tp-btn-primary:hover { background: var(--acl); transform: translateY(-2px); box-shadow: 0 0 36px rgba(99,102,241,0.55); }

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s cubic-bezier(0.16,1,0.3,1), transform 0.65s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── TOOL PAGE ── */
.tp-tool-wrap { max-width: 1200px; margin: 0 auto; padding: 6.5rem 1.5rem 3rem; width: 100%; box-sizing: border-box; }
.tp-tool-header { margin-bottom: 2.5rem; }
.tp-breadcrumb {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  font-size: 0.85rem; font-weight: 500; color: var(--t2); margin-bottom: 1.5rem;
}
.tp-breadcrumb a { color: var(--t3); text-decoration: none; transition: color 0.2s; }
.tp-breadcrumb a:hover { color: var(--t1); }
.tp-breadcrumb span { color: var(--t2); font-size: 0.8rem; }
.tp-breadcrumb-sep { color: var(--t3); }
.tp-tool-title-row { display: flex; align-items: flex-start; gap: 1rem; }
.tp-tool-title-text { flex: 1; min-width: 0; }
.tp-tool-icon {
  flex-shrink: 0; width: 50px; height: 50px; border-radius: 13px;
  background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.35);
  display: flex; align-items: center; justify-content: center; color: var(--acl);
}
.tp-tool-icon svg, .tp-tool-icon div { width: 24px; height: 24px; }
.tp-tool-h1 { font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 900; color: var(--t1); letter-spacing: -0.03em; margin-bottom: 0.4rem; }
.tp-tool-sub { color: var(--t2); font-size: 0.975rem; line-height: 1.6; max-width: 560px; }

.tp-tool-layout { display: grid; grid-template-columns: 1fr 360px; gap: 1.5rem; }
@media(max-width: 1024px) { .tp-tool-layout { grid-template-columns: 1fr; } }

.tp-tool-main { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; overflow: hidden; }
.tp-tool-sidebar { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.tp-sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; }
.tp-sidebar-icon { width: 38px; height: 38px; border-radius: 10px; background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.2); display: flex; align-items: center; justify-content: center; margin-bottom: 0.9rem; }
.tp-sidebar-icon svg { width: 18px; height: 18px; color: var(--acl); }
.tp-sidebar-card h3 { font-size: 0.9rem; font-weight: 700; color: var(--t1); margin-bottom: 0.4rem; }
.tp-sidebar-card p { font-size: 0.8rem; color: var(--t2); line-height: 1.65; margin: 0; }

/* Tool internals — input/output */
.tp-input-block { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: border-color 0.2s; }
.tp-input-block:focus-within { border-color: rgba(99,102,241,0.4); }
.tp-input-header { padding: 0.8rem 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; border-bottom: 1px solid var(--border); }
.tp-input-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--t3); }
.tp-clear-btn { font-size: 0.75rem; color: var(--t3); background: transparent; border: none; cursor: pointer; font-family: inherit; transition: color 0.2s; padding: 2px 6px; border-radius: 4px; }
.tp-clear-btn:hover { color: var(--t1); }
textarea.tp-textarea, input.tp-input-field {
  width: 100%; background: transparent; border: none; outline: none;
  color: var(--t1); font-family: inherit; font-size: 1.05rem;
  padding: 1.1rem 1.25rem; resize: vertical;
  line-height: 1.6;
}
textarea.tp-textarea::placeholder, input.tp-input-field::placeholder { color: var(--t3); }

/* Hide spin buttons on number inputs */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
  -webkit-appearance: none; margin: 0; 
}
input[type="number"] { -moz-appearance: textfield; }

.tp-output-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.6rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 0; overflow: hidden;
}
.tp-output-row:hover { border-color: rgba(99,102,241,0.35); box-shadow: 0 2px 12px rgba(99,102,241,0.08); }
.tp-output-name { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--t3); margin-bottom: 5px; display: block; }
.tp-output-text { font-size: 1.15rem; color: var(--t1); word-break: break-all; white-space: pre-wrap; }
.tp-copy-btn {
  flex-shrink: 0; background: var(--accent); color: #fff;
  border: none; border-radius: 8px; padding: 0.5rem 1rem;
  font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background 0.2s;
}
.tp-copy-btn:hover { background: var(--acl); }
.tp-copy-btn.copied { background: #22c55e; }

/* Sidebar share btn */
.tp-share-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 0.75rem; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--t2); font-size: 0.85rem; font-weight: 600;
  text-decoration: none; font-family: inherit; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.tp-share-btn:hover { border-color: var(--bv); color: var(--t1); }

.tp-more-tool-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 0.9rem; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--t2); font-size: 0.82rem; font-weight: 500;
  text-decoration: none; margin-bottom: 0.5rem;
  transition: border-color 0.2s, color 0.2s;
}
.tp-more-tool-link:hover { border-color: var(--bv); color: var(--t1); }
.tp-more-tool-link svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Dark prose for long desc */
.dark-prose h2, .dark-prose h3 { color: var(--t1); font-weight: 700; margin: 1.5rem 0 0.5rem; }
.dark-prose p { color: var(--t2); line-height: 1.75; margin-bottom: 1rem; font-size: 0.9rem; }
.dark-prose a { color: var(--acl); }
.dark-prose ul { color: var(--t2); list-style: disc; padding-left: 1.5rem; }
.dark-prose li { margin-bottom: 0.4rem; font-size: 0.9rem; }
.dark-prose strong { color: var(--t1); }

/* ── FOOTER ── */
#tp-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.tp-footer-grad { height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.tp-footer-inner { max-width: 1100px; margin: 0 auto; padding: 4rem 1.5rem 2.5rem; }
.tp-footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
@media(max-width:768px){ .tp-footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem 2rem; } }
@media(max-width:550px){
  .tp-footer-inner { padding: 3rem 1.25rem 2rem; }
  .tp-footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; margin-bottom: 2rem; }
  .tp-footer-brand-col { grid-column: span 2; margin-bottom: 0.5rem; }
}
.tp-footer-desc { color: var(--t2); font-size: 0.875rem; line-height: 1.6; max-width: 280px; margin: 1rem 0 0.75rem; }
.tp-footer-quote { color: var(--t3); font-size: 0.78rem; font-style: italic; }
.tp-footer-col h4 { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--t1); margin-bottom: 1.1rem; }
.tp-footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.tp-footer-col a { color: var(--t2); font-size: 0.85rem; text-decoration: none; transition: color 0.2s; }
.tp-footer-col a:hover { color: var(--t1); }
.tp-footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.tp-footer-copy { color: var(--t3); font-size: 0.78rem; }
.tp-status { display: flex; align-items: center; gap: 6px; color: var(--t3); font-size: 0.78rem; }
.tp-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }

/* 404 */
.tp-404 { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; padding: 4rem 1.5rem; }
.tp-404 h1 { font-size: 6rem; font-weight: 900; color: var(--accent); line-height: 1; margin-bottom: 1rem; }
.tp-404 p { color: var(--t2); font-size: 1.1rem; margin-bottom: 2rem; }

/* Toast */
.tp-toast-wrap { position: fixed; bottom: 2rem; right: 2rem; z-index: 1000; }
.tp-toast {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.875rem; font-weight: 500; color: var(--t1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  transform: translateY(20px); opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), opacity 0.3s;
}
.tp-toast.show { transform: translateY(0); opacity: 1; }
.tp-toast-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tp-toast-dot svg { width: 14px; height: 14px; }

/* ── GLOBAL MOBILE OVERFLOW FIX ── */
@media(max-width: 768px) {
  .tp-tool-wrap { padding: 5.5rem 1rem 2rem; }
  .tp-card { padding: 1rem !important; }
  .tp-tool-container { width: 100%; box-sizing: border-box; overflow: hidden; }
  .tp-output-row { min-width: 0; overflow: hidden; }
  .tp-hero { padding-left: 1rem; padding-right: 1rem; overflow: hidden; }
  .tp-grid-section { padding-left: 1rem; padding-right: 1rem; }
  .tp-footer-inner { padding-left: 1rem; padding-right: 1rem; }
  .tp-search-wrap { margin: 0 auto; width: 100%; box-sizing: border-box; }
  .tp-search-box-large { width: 100%; box-sizing: border-box; }
  .tp-search-box-large input { padding: 0 0.8rem; font-size: 0.95rem; }
  .tp-search-btn { padding: 0.7rem 1.2rem; font-size: 0.9rem; }
  .tp-h1 { font-size: clamp(1.8rem, 7vw, 2.8rem); }
}
