/* ============================================================
   AI Platform — Design System v2
   Matching reference images: pastel hero gradient, pill buttons,
   icon category cards, article cards with top image, split-view
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --bg:        #eef2ff;
  --surface:   #ffffff;
  --surface-2: #f8faff;
  --border:    rgba(0,0,0,0.07);
  --border-md: rgba(0,0,0,0.12);

  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;

  --accent:   #4f46e5;
  --accent-h: #4338ca;
  --accent-s: rgba(79,70,229,0.10);

  --cat-bg:   #e0eaff;

  --free-bg: #dcfce7; --free-fg: #166534;
  --frem-bg: #fef9c3; --frem-fg: #854d0e;
  --paid-bg: #ede9fe; --paid-fg: #5b21b6;

  --green: #10b981;
  --red:   #ef4444;

  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-pill: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.09);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.11);

  --t: 150ms ease;
}

[data-theme="dark"] {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface-2: #1c2128;
  --border:    rgba(255,255,255,0.07);
  --border-md: rgba(255,255,255,0.13);
  --text-1:    #f0f6fc;
  --text-2:    #8b949e;
  --text-3:    #484f58;
  --cat-bg:    #1a1f35;
  --accent-s:  rgba(79,70,229,0.18);
  --free-bg: #064e3b; --free-fg: #6ee7b7;
  --frem-bg: #451a03; --frem-fg: #fde68a;
  --paid-bg: #2e1065; --paid-fg: #c4b5fd;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
}

/* ============================================================
   BASE
   ============================================================ */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 0.9375rem; font-weight: 600; }
p  { color: var(--text-2); line-height: 1.75; }

.container        { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 860px;  margin: 0 auto; padding: 0 24px; }
.section    { padding: 72px 0; }
.section-sm { padding: 48px 0; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}
[data-theme="dark"] .navbar { background: rgba(13,17,23,0.88); }

.navbar-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 6px;
}

.navbar-logo {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-1);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  margin-right: 16px;
  letter-spacing: -0.02em;
}
.navbar-logo:hover { text-decoration: none; color: var(--text-1); }
.logo-box {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 800;
  flex-shrink: 0;
}
.logo-accent { color: var(--accent); }

.navbar-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.navbar-nav a {
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: all var(--t);
  white-space: nowrap;
}
.navbar-nav a:hover  { color: var(--text-1); background: var(--border); }
.navbar-nav a.active { color: var(--accent); background: var(--accent-s); font-weight: 600; }

.navbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.nav-search {
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1.5px solid var(--border-md);
  border-radius: var(--r-pill);
  padding: 0 14px;
  gap: 8px; height: 38px;
  transition: border-color var(--t), box-shadow var(--t);
}
.nav-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-s); }
.nav-search input {
  background: none; border: none; outline: none;
  font: 500 0.875rem var(--font);
  color: var(--text-1); width: 150px;
}
.nav-search input::placeholder { color: var(--text-3); }
.nav-search svg { color: var(--text-3); width: 15px; height: 15px; flex-shrink: 0; }

.theme-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border-md);
  background: none; color: var(--text-2);
  cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.theme-btn:hover { background: var(--border); color: var(--text-1); }

/* ============================================================
   HERO — pastel gradient, large search in hero
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #a5b4f1 0%, #dbeafe 40%, #93cfc9 100%);
  padding: 84px 0 76px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #778fef 0%, #0f2744 50%, #064e3b 100%);
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.35) 0%, transparent 70%);
  top: -150px; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(79,70,229,0.2);
  color: var(--accent);
  font-size: 0.75rem; font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 22px;
  letter-spacing: 0.06em; text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.hero h1 { margin-bottom: 16px; color: #0f172a; }
[data-theme="dark"] .hero h1 { color: #f0f6fc; }
.hero h1 .hi { color: var(--accent); }

.hero-sub {
  font-size: 1.125rem; color: #475569;
  max-width: 520px; margin: 0 auto 36px; line-height: 1.7;
}
[data-theme="dark"] .hero-sub { color: #8b949e; }

/* Big hero search bar — like Image 6 */
.hero-search-box {
  max-width: 600px; margin: 0 auto 20px;
  background: var(--surface);
  border: 1.5px solid var(--border-md);
  border-radius: var(--r-pill);
  display: flex; align-items: center;
  padding: 6px 6px 6px 22px;
  gap: 12px;
  box-shadow: var(--shadow-lg);
}
.hero-search-box svg { color: var(--text-3); flex-shrink: 0; width: 18px; height: 18px; }
.hero-search-box input {
  flex: 1; background: none; border: none; outline: none;
  font: 500 1.0625rem var(--font); color: var(--text-1);
}
.hero-search-box input::placeholder { color: var(--text-3); }
.hero-search-box button {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--r-pill);
  padding: 11px 24px;
  font: 700 0.9375rem var(--font);
  cursor: pointer; transition: background var(--t); flex-shrink: 0;
}
.hero-search-box button:hover { background: var(--accent-h); }

.hero-tags { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.hero-tag-label { font-size: 0.8125rem; color: #64748b; font-weight: 500; }
.hero-tag {
  background: rgba(255,255,255,0.75); border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--r-pill); padding: 4px 12px;
  font-size: 0.8125rem; color: #334155; font-weight: 500;
  text-decoration: none; transition: all var(--t);
  backdrop-filter: blur(4px);
}
.hero-tag:hover { background: #fff; color: var(--accent); text-decoration: none; }

.hero-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }

.hero-trust { margin-top: 40px; }
.hero-trust p { font-size: 0.8125rem; color: #64748b; font-weight: 500; margin-bottom: 12px; }
[data-theme="dark"] .hero-trust p { color: var(--text-3); }
.trust-logos { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; }
.trust-logos span { font-size: 0.9rem; font-weight: 800; color: #94a3b8; letter-spacing: -0.01em; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 24px;
  border-radius: var(--r-pill);
  font: 600 0.9375rem var(--font);
  cursor: pointer; border: none;
  text-decoration: none; transition: all var(--t);
  line-height: 1; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); color: #fff; text-decoration: none; box-shadow: 0 4px 14px rgba(79,70,229,0.35); }
.btn-outline { background: transparent; color: var(--text-1); border: 1.5px solid var(--border-md); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-white { background: #fff; color: var(--accent); border: 1.5px solid rgba(255,255,255,0.6); }
.btn-white:hover { background: rgba(255,255,255,0.9); text-decoration: none; color: var(--accent); }
.btn-sm  { padding: 7px 16px; font-size: 0.8125rem; }
.btn-lg  { padding: 14px 30px; font-size: 1rem; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; text-decoration: none; }

/* Icon-circle play button like Image 2 */
.btn-play {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer;
  font: 600 0.9375rem var(--font); color: var(--text-1);
  text-decoration: none; transition: color var(--t);
}
.btn-play:hover { color: var(--accent); text-decoration: none; }
.btn-play .pc {
  width: 42px; height: 42px;
  border: 1.5px solid var(--border-md);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all var(--t);
}
.btn-play:hover .pc { border-color: var(--accent); background: var(--accent-s); }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 28px; gap: 12px;
}
.section-header h2 { margin-bottom: 4px; }
.section-header p  { color: var(--text-2); font-size: 0.9375rem; margin-top: 4px; }
.view-all {
  font-size: 0.875rem; font-weight: 600; color: var(--accent);
  white-space: nowrap; display: flex; align-items: center; gap: 4px;
}
.view-all:hover { text-decoration: underline; }

/* ============================================================
   CATEGORY CARDS (Image 7 + 8)
   ============================================================ */
.cats-section { background: var(--cat-bg); padding: 64px 0; }

/* Horizontal style — icon left, text right (Image 8 grid) */
.cat-grid-h {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.cat-card-h {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  text-decoration: none; color: inherit;
  transition: all var(--t); cursor: pointer;
}
.cat-card-h:hover {
  border-color: var(--accent); box-shadow: var(--shadow-md);
  text-decoration: none; color: inherit; transform: translateY(-1px);
}

/* Vertical style — icon top, text center (Image 7 carousel) */
.cat-grid-v {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.cat-card-v {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 16px 22px;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; text-align: center;
  text-decoration: none; color: inherit;
  transition: all var(--t); cursor: pointer;
}
.cat-card-v:hover {
  border-color: var(--accent); box-shadow: var(--shadow-md);
  text-decoration: none; color: inherit; transform: translateY(-2px);
}

.cat-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--cat-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
  transition: background var(--t);
}
.cat-card-h:hover .cat-icon,
.cat-card-v:hover .cat-icon { background: var(--accent-s); }
.cat-icon-sm { width: 40px; height: 40px; font-size: 18px; }

.cat-name  { font-size: 0.9375rem; font-weight: 600; color: var(--text-1); line-height: 1.3; }
.cat-count { font-size: 0.8125rem; color: var(--text-3); margin-top: 2px; }

/* ============================================================
   TOOL CARDS — grid view
   ============================================================ */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.tool-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: all var(--t); cursor: pointer;
}
.tool-card:hover {
  border-color: rgba(79,70,229,0.3); box-shadow: var(--shadow-md);
  transform: translateY(-2px); text-decoration: none; color: inherit;
}

.tool-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }

.tlogo {
  width: 48px; height: 48px; border-radius: var(--r-md);
  object-fit: cover; border: 1px solid var(--border); flex-shrink: 0;
}
.tlogo-ph {
  width: 48px; height: 48px; border-radius: var(--r-md);
  background: var(--accent-s);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: var(--accent);
  flex-shrink: 0; letter-spacing: -0.05em;
}
.tool-card-name { font-size: 1rem; font-weight: 700; color: var(--text-1); line-height: 1.3; }
.tool-card-cat  { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; font-weight: 500; }

.tool-card-desc {
  font-size: 0.875rem; color: var(--text-2); line-height: 1.65;
  flex: 1; margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tool-card-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }

/* ============================================================
   TOOL LIST ITEM (split layout, Image 4 left panel)
   ============================================================ */
.split-layout {
  display: grid; grid-template-columns: 360px 1fr;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden; min-height: 600px;
}
.split-list { border-right: 1px solid var(--border); padding: 14px; overflow-y: auto; max-height: 780px; }
.split-detail { padding: 36px; overflow-y: auto; max-height: 780px; }

.tli {
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 18px;
  cursor: pointer; transition: all var(--t);
  text-decoration: none; color: inherit; display: block; margin-bottom: 8px;
}
.tli:hover, .tli.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  text-decoration: none; color: inherit;
}
.tli-inner { display: flex; align-items: flex-start; gap: 12px; }
.tli-body  { flex: 1; min-width: 0; }
.tli-name  { font-size: 0.9375rem; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.tli-cat   { font-size: 0.8125rem; color: var(--text-3); }
.tli-meta  { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-3); }
.tli-actions { display: flex; gap: 4px; flex-shrink: 0; margin-left: auto; }

.icon-btn {
  width: 30px; height: 30px; border: none; background: none;
  cursor: pointer; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 14px; transition: all var(--t);
}
.icon-btn:hover { color: var(--accent); background: var(--accent-s); }

/* ============================================================
   ARTICLE CARDS (Image 1 style)
   ============================================================ */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.article-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: all var(--t); text-decoration: none; color: inherit;
}
.article-card:hover {
  border-color: var(--border-md); box-shadow: var(--shadow-md);
  text-decoration: none; color: inherit;
}

.ac-img {
  position: relative; aspect-ratio: 16/9;
  overflow: hidden; background: var(--surface-2);
}
.ac-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.article-card:hover .ac-img img { transform: scale(1.04); }

/* Bookmark button like Image 1 */
.ac-bm {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.92); border: none; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer; transition: all var(--t);
  backdrop-filter: blur(4px);
}
.ac-bm:hover { background: #fff; }

.ac-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.ac-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

.ac-title {
  font-size: 0.9375rem; font-weight: 700; color: var(--text-1);
  line-height: 1.45; margin-bottom: 0; flex: 1;
}

.ac-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.av {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; border: 1.5px solid var(--border); flex-shrink: 0;
}
.av-ph {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-s); display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--accent); flex-shrink: 0;
}
.ac-meta-text  { font-size: 0.78rem; color: var(--text-3); line-height: 1.3; }
.ac-meta-text b { font-weight: 600; color: var(--text-2); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 0.73rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
/* Varied category badge colors — like Image 1 */
.bc0 { background:#dcfce7; color:#166534; }
.bc1 { background:#fef9c3; color:#854d0e; }
.bc2 { background:#dbeafe; color:#1e40af; }
.bc3 { background:#fce7f3; color:#9d174d; }
.bc4 { background:#ede9fe; color:#5b21b6; }
.bc5 { background:#ffedd5; color:#9a3412; }
.bc6 { background:#cffafe; color:#155e75; }
.bc7 { background:#f0fdf4; color:#14532d; }

.badge-free     { background: var(--free-bg); color: var(--free-fg); }
.badge-freemium { background: var(--frem-bg); color: var(--frem-fg); }
.badge-paid     { background: var(--paid-bg); color: var(--paid-fg); }

.tag-chip {
  background: var(--border); color: var(--text-2);
  border-radius: var(--r-pill); padding: 3px 10px;
  font-size: 0.75rem; font-weight: 500;
  text-decoration: none; display: inline-flex;
  transition: all var(--t);
}
.tag-chip:hover { background: var(--accent-s); color: var(--accent); text-decoration: none; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 18px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.filter-lbl { font-size: 0.8125rem; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 14px; border-radius: var(--r-pill);
  font-size: 0.8125rem; font-weight: 500; cursor: pointer;
  border: 1.5px solid var(--border-md);
  background: none; color: var(--text-2);
  transition: all var(--t); text-decoration: none; display: inline-flex;
}
.chip:hover  { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fdivider { width: 1px; height: 22px; background: var(--border-md); }

/* ============================================================
   TAG CLOUD (Image 5 style — "Explore by Topics")
   ============================================================ */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tag-pill {
  background: var(--surface); border: 1.5px solid var(--border-md);
  border-radius: var(--r-pill); padding: 7px 18px;
  font-size: 0.875rem; font-weight: 500; color: var(--text-1);
  text-decoration: none; transition: all var(--t);
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-s); text-decoration: none; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 56px; }
.pg-link {
  min-width: 38px; height: 38px; padding: 0 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-md); border-radius: var(--r-pill);
  font: 500 0.875rem var(--font); color: var(--text-2);
  text-decoration: none; transition: all var(--t);
}
.pg-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pg-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pg-link.disabled { opacity: 0.4; pointer-events: none; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 22px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-1); margin-bottom: 7px; }
.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--surface); border: 1.5px solid var(--border-md);
  border-radius: var(--r-md); font: 400 0.9375rem var(--font);
  color: var(--text-1); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-s); }
.form-control::placeholder { color: var(--text-3); }
textarea.form-control { resize: vertical; min-height: 130px; line-height: 1.6; }
select.form-control    { cursor: pointer; }
.form-hint { font-size: 0.8125rem; color: var(--text-3); margin-top: 5px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.admin-side {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side-logo {
  padding: 22px 20px 18px; font: 700 1rem var(--font);
  color: var(--text-1); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.admin-nav-section { padding: 14px 12px 0; }
.admin-nav-lbl { font-size: 0.6875rem; font-weight: 700; color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; padding: 0 10px; margin-bottom: 4px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: all var(--t); margin-bottom: 2px;
}
.admin-nav a:hover  { color: var(--text-1); background: var(--border); text-decoration: none; }
.admin-nav a.active { color: var(--accent); background: var(--accent-s); font-weight: 600; }
.ni { font-size: 16px; flex-shrink: 0; }

.admin-main { padding: 36px; background: var(--bg); overflow-y: auto; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-title  { font-size: 1.5rem; font-weight: 800; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.stat-num  { font-size: 2.25rem; font-weight: 800; color: var(--text-1); letter-spacing: -0.03em; }
.stat-lbl  { font-size: 0.8125rem; color: var(--text-3); margin-top: 4px; font-weight: 500; }

.table-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.at { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.at thead { background: var(--surface-2); }
.at th { text-align: left; padding: 11px 18px; font-size: 0.8125rem; font-weight: 600; color: var(--text-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.at td { padding: 13px 18px; border-bottom: 1px solid var(--border); color: var(--text-1); vertical-align: middle; }
.at tr:last-child td { border-bottom: none; }
.at tbody tr:hover td { background: var(--bg); }
.td-act { display: flex; gap: 6px; align-items: center; }

/* ============================================================
   FLASH / ALERTS
   ============================================================ */
.flash { padding: 13px 18px; border-radius: var(--r-md); font-size: 0.875rem; font-weight: 500; border: 1.5px solid; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.flash-ok  { background: #f0fdf4; border-color: #86efac; color: #166534; }
.flash-err { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.flash-inf { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }

/* ============================================================
   SINGLE TOOL PAGE
   ============================================================ */
.tool-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 52px 0 44px; }
.tool-header-inner { display: flex; gap: 26px; align-items: flex-start; }
.tool-hlogo { width: 88px; height: 88px; border-radius: var(--r-lg); object-fit: cover; border: 1.5px solid var(--border); flex-shrink: 0; }
.tool-hlogo-ph { width: 88px; height: 88px; border-radius: var(--r-lg); background: var(--accent-s); display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.tool-header-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tool-header-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* Sidebar layout */
.layout-sidebar { display: grid; grid-template-columns: 1fr 280px; gap: 36px; align-items: start; }
.sidebar-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 22px; margin-bottom: 18px; }
.sidebar-card h4 { margin-bottom: 14px; }

/* ============================================================
   ARTICLE SINGLE
   ============================================================ */
.article-pg-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 56px 0 0; }
.article-pg-inner  { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.article-pg-header h1 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); margin-bottom: 18px; }
.article-pg-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.article-feat-img { width: 100%; max-height: 460px; object-fit: cover; display: block; margin-top: 36px; }

.article-body { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; font-size: 1.0625rem; line-height: 1.85; }
.article-body h2 { font-size: 1.5rem; font-weight: 700; margin: 2.2em 0 0.7em; }
.article-body h3 { font-size: 1.2rem; font-weight: 600; margin: 1.8em 0 0.5em; }
.article-body p  { color: var(--text-2); margin-bottom: 1.4em; }
.article-body a  { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body ul, .article-body ol { padding-left: 1.5em; margin-bottom: 1.4em; }
.article-body li { margin-bottom: 0.5em; color: var(--text-2); }
.article-body img { border-radius: var(--r-md); margin: 2em 0; border: 1px solid var(--border); }
.article-body blockquote { border-left: 3px solid var(--accent); padding: 0 0 0 24px; margin: 2em 0; color: var(--text-2); font-style: italic; font-size: 1.1em; }
.article-body code { font-family: 'Fira Code', 'Cascadia Code', monospace; font-size: 0.875em; background: var(--surface-2); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--border); }
.article-body pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 22px; overflow-x: auto; margin-bottom: 1.8em; }
.article-body pre code { background: none; border: none; padding: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--surface); border-top: 1px solid var(--border); padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2.5fr repeat(3, 1fr); gap: 48px; margin-bottom: 48px; }
.footer-brand-name { font-size: 1.1rem; font-weight: 800; color: var(--text-1); display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.footer-brand p { font-size: 0.875rem; color: var(--text-2); line-height: 1.7; max-width: 280px; }
.footer-col h5 { font-size: 0.875rem; font-weight: 700; color: var(--text-1); margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a  { font-size: 0.875rem; color: var(--text-2); text-decoration: none; transition: color var(--t); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 28px; border-top: 1px solid var(--border); font-size: 0.8125rem; color: var(--text-3); gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-3); text-decoration: none; transition: color var(--t); }
.footer-links a:hover { color: var(--text-2); }

/* ============================================================
   UTILS
   ============================================================ */
.flex            { display: flex; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-wrap       { flex-wrap: wrap; }
.gap-1  { gap: 4px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.gap-6  { gap: 24px; }
.col    { flex-direction: column; }
.w-full { width: 100%; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.8125rem; }
.text-muted { color: var(--text-2); }
.text-faint { color: var(--text-3); }
.text-accent{ color: var(--accent); }
.text-center{ text-align: center; }
.fw-700  { font-weight: 700; }
.fw-600  { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .split-layout  { grid-template-columns: 320px 1fr; }
  .footer-grid   { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .hero { padding: 56px 0 52px; }
  .section { padding: 48px 0; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .navbar-nav { display: none; }
  .nav-search input { width: 100px; }
  .split-layout { grid-template-columns: 1fr; }
  .split-list   { max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .split-detail { padding: 20px; }
  .layout-sidebar { grid-template-columns: 1fr; }
  .tools-grid  { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
  .cat-grid-h  { grid-template-columns: 1fr; }
  .cat-grid-v  { grid-template-columns: repeat(2, 1fr); }
  .form-row    { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side  { display: none; }
  .admin-main  { padding: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.35rem; }
}
@media (max-width: 480px) {
  .cat-grid-v { grid-template-columns: repeat(2, 1fr); }
  .stat-grid  { grid-template-columns: 1fr 1fr; }
  .hero-search-box { border-radius: var(--r-lg); }
}
/* ── Form polja - elegantna stilizacija ──────────────────── */
.form-input,
input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 13px 16px;
  font-size: .9375rem;
  font-family: var(--font);
  border: 1.5px solid var(--border2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--t1);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.form-input:focus,
input[type="text"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,95,199,.12), 0 1px 3px rgba(0,0,0,.04);
}

.form-input:hover:not(:focus),
input[type="text"]:hover:not(:focus),
input[type="url"]:hover:not(:focus),
input[type="email"]:hover:not(:focus),
textarea:hover:not(:focus) {
  border-color: rgba(91,95,199,.4);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239699b0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
}

.form-label {
  display: block;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--t2);
  margin-bottom: 7px;
  letter-spacing: .01em;
}

.form-hint {
  font-size: .8rem;
  color: var(--t3);
  margin-top: 5px;
}

.form-group {
  margin-bottom: 22px;
}

/* ── Nav search fix ── */
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: 24px;
  padding: 0 16px;
  height: 40px;
  width: 220px;
  transition: border-color .15s, width .2s;
}

.nav-search:focus-within {
  border-color: var(--accent);
  width: 260px;
}

.nav-search svg {
  flex-shrink: 0;
  color: var(--t3);
  width: 15px;
  height: 15px;
}

.nav-search input {
  border: none;
  background: none;
  outline: none;
  font-size: .875rem;
  font-family: var(--font);
  color: var(--t1);
  width: 100%;
  padding: 0;
}

.nav-search input::placeholder {
  color: var(--t3);
}

.navbar-end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}