:root {
  --bg: #f7faf9;
  --surface: #ffffff;
  --text: #10201c;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #f59e0b;
  --line: #dbe7e3;
  --shadow: 0 18px 50px rgba(15, 23, 42, .08);
  --radius: 8px;
}

:root[data-theme="dark"] {
  --bg: #071311;
  --surface: #10201c;
  --text: #edf7f5;
  --muted: #a6b8b3;
  --primary: #5eead4;
  --primary-dark: #2dd4bf;
  --accent: #fbbf24;
  --line: #27433d;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] body { color-scheme: dark; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
label { display: grid; gap: 6px; width: 100%; font-weight: 700; font-size: .88rem; color: var(--text); }
.btn { border-radius: var(--radius); font-weight: 700; }
.btn-primary, .btn-success {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover, .btn-success:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

.site-header {
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid rgba(219,231,227,.8);
  backdrop-filter: blur(16px);
}
:root[data-theme="dark"] .site-header { background: rgba(7,19,17,.9); }
:root[data-theme="dark"] .navbar-brand,
:root[data-theme="dark"] .nav-link { color: var(--text); }
.theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.navbar { min-height: 72px; }
.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
  margin-right: 8px;
}

.hero {
  padding: 64px 0 44px;
  background:
    linear-gradient(120deg, rgba(15,118,110,.12), transparent 42%),
    linear-gradient(180deg, #fff, var(--bg));
}
:root[data-theme="dark"] .hero {
  background:
    linear-gradient(120deg, rgba(94,234,212,.13), transparent 42%),
    linear-gradient(180deg, #071311, var(--bg));
}
.eyebrow, .section-heading span, .tool-category, .blog-card span {
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: .76rem;
  letter-spacing: 0;
}
.hero h1, .tool-hero h1 {
  font-size: clamp(2.25rem, 6vw, 4.8rem);
  line-height: 1.02;
  max-width: 850px;
  margin: 14px 0 18px;
  letter-spacing: 0;
}
.hero-copy, .tool-hero p {
  font-size: 1.16rem;
  color: var(--muted);
  max-width: 720px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  margin-top: 28px;
}
:root[data-theme="dark"] .search-box {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}
.search-box i {
  color: var(--text);
  opacity: .85;
}
:root[data-theme="dark"] .search-box i {
  color: var(--primary);
  opacity: 1;
}
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select,
:root[data-theme="dark"] textarea {
  background: #0b1714;
  color: var(--text);
  border-color: var(--line);
}
.search-box input {
  border: 0;
  outline: 0;
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  background: transparent;
  color: var(--text);
}
.search-box input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.category-search {
  max-width: 100%;
  margin-top: 0;
}
.popular-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.popular-links a {
  background: #e8f4f1;
  color: #0f4f49;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 700;
}
:root[data-theme="dark"] .popular-links a {
  background: #123a34;
  color: #ccfbf1;
}
.hero-panel {
  background: #10201c;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mini-window {
  display: flex;
  gap: 8px;
  padding: 16px;
  background: #172c27;
}
.mini-window span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f97316;
}
.mini-window span:nth-child(2) { background: #facc15; }
.mini-window span:nth-child(3) { background: #22c55e; }
.hero-list { display: grid; gap: 16px; padding: 24px; }
.hero-list div {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 12px;
  align-items: center;
  padding: 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
}
.hero-list i { grid-row: span 2; font-size: 1.4rem; color: #5eead4; }
.hero-list small { color: #cbd5e1; }

.section { padding: 56px 0; }
.section.alt { background: #fff; }
:root[data-theme="dark"] .section.alt { background: #0b1714; }
.section-heading { max-width: 760px; margin-bottom: 28px; }
.section-heading h1, .section-heading h2 {
  margin-top: 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0;
}
.category-grid, .tool-grid, .blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.category-card, .tool-card, .blog-card, .tool-form, .document-preview, .chart-panel, .seo-checklist, .ad-slot, .admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(15,23,42,.05);
}
:root[data-theme="dark"] .category-card,
:root[data-theme="dark"] .tool-card,
:root[data-theme="dark"] .blog-card,
:root[data-theme="dark"] .tool-form,
:root[data-theme="dark"] .document-preview,
:root[data-theme="dark"] .chart-panel,
:root[data-theme="dark"] .seo-checklist,
:root[data-theme="dark"] .ad-slot,
:root[data-theme="dark"] .admin-card,
:root[data-theme="dark"] details {
  background: var(--surface);
  border-color: var(--line);
}
.category-card {
  padding: 24px;
  color: var(--text);
  display: block;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.category-card:hover {
  color: var(--text);
  border-color: rgba(15,118,110,.35);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.category-card i {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  background: var(--primary);
  border-radius: 8px;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
:root[data-theme="dark"] .category-card i { color: #08201c; }
.category-card h3, .tool-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.category-card p, .tool-card p, .blog-card p { color: var(--muted); margin: 0; }

.tool-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 20px;
  min-height: 270px;
}
.tool-card img { width: 72px; height: 72px; }
.tool-card .btn { align-self: end; justify-self: start; }
.ad-slot {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 18px;
  color: #64748b;
  background: repeating-linear-gradient(45deg, #fff, #fff 10px, #f4faf8 10px, #f4faf8 20px);
  text-align: center;
}
:root[data-theme="dark"] .ad-slot,
:root[data-theme="dark"] .side-ad {
  background: repeating-linear-gradient(45deg, #0b1714, #0b1714 10px, #10201c 10px, #10201c 20px);
}
.ad-slot span { font-size: .75rem; text-transform: uppercase; font-weight: 800; }
.ad-slot strong { color: var(--text); }
.side-ad {
  position: fixed;
  top: 112px;
  z-index: 20;
  width: 150px;
  min-height: 540px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 16px;
  color: #64748b;
  background: repeating-linear-gradient(45deg, #fff, #fff 10px, #f4faf8 10px, #f4faf8 20px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(15,23,42,.05);
  text-align: center;
}
.side-ad-left { left: max(14px, calc((100vw - 1320px) / 2 - 174px)); }
.side-ad-right { right: max(14px, calc((100vw - 1320px) / 2 - 174px)); }
.side-ad span {
  font-size: .72rem;
  text-transform: uppercase;
  font-weight: 800;
}
.side-ad strong {
  color: #233b35;
  font-size: 1.05rem;
}
.side-ad small { color: var(--muted); }

.seo-copy h2, .seo-article h2 { font-size: 1.8rem; margin-bottom: 14px; }
.seo-copy p, .seo-article p { color: var(--muted); line-height: 1.75; }
.seo-checklist { display: grid; gap: 12px; padding: 22px; }
.seo-checklist span { display: flex; gap: 9px; align-items: center; }
.seo-checklist i { color: var(--primary); }

.tool-hero {
  padding: 44px 0;
  background: linear-gradient(180deg, #fff, #eff8f5);
  border-bottom: 1px solid var(--line);
}
:root[data-theme="dark"] .tool-hero {
  background: linear-gradient(180deg, #071311, #0b1714);
}
.tool-hero h1 { font-size: clamp(2rem, 5vw, 4rem); }
.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.tool-form, .document-preview, .chart-panel {
  padding: 22px;
}
.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.form-header h2 { font-size: 1.22rem; margin: 0; }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.document-preview {
  min-height: 580px;
  background: #fff;
  overflow-wrap: anywhere;
}
:root[data-theme="dark"] .document-preview { background: #0f1f1b; }
.document-preview h1 { font-size: 2rem; }
.document-preview .doc-muted { color: var(--muted); }
.resume-head {
  display: flex;
  gap: 18px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 3px solid var(--primary);
  margin-bottom: 18px;
}
.resume-photo {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: #e2e8f0;
}
.resume-section { margin-top: 18px; }
.resume-section h2 {
  color: var(--primary);
  font-size: 1rem;
  text-transform: uppercase;
}
.pill-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill-list span {
  background: #e8f4f1;
  color: #0f4f49;
  padding: 7px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .86rem;
}
:root[data-theme="dark"] .pill-list span {
  background: #123a34;
  color: #ccfbf1;
}
.result-box {
  margin-top: 18px;
  padding: 16px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}
:root[data-theme="dark"] .result-box {
  background: #102d27;
  border-color: #1e5b50;
}
:root[data-theme="dark"] .result-box strong { color: #86efac; }
.result-box span { color: var(--muted); display: block; }
.result-box strong { font-size: 1.8rem; color: #166534; }
.chart-panel canvas { max-height: 320px; }

.seo-article {
  max-width: 860px;
  margin: 0 auto;
}
details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 10px 0;
}
summary { font-weight: 800; cursor: pointer; }
.content-ad { margin-bottom: 28px; }

.blog-card { padding: 24px; }
.blog-card h2 { font-size: 1.25rem; margin: 8px 0; }
.narrow { max-width: 760px; }
.blog-hero {
  padding: 56px 0;
  background:
    linear-gradient(120deg, rgba(15,118,110,.12), transparent 45%),
    linear-gradient(180deg, #fff, var(--bg));
}
:root[data-theme="dark"] .blog-hero {
  background:
    linear-gradient(120deg, rgba(94,234,212,.12), transparent 45%),
    linear-gradient(180deg, #071311, var(--bg));
}
.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  margin: 12px 0 16px;
}
.blog-hero p { color: var(--muted); font-size: 1.12rem; max-width: 780px; }
.blog-featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: stretch;
}
.featured-post, .blog-sidebar, .blog-cta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(15,23,42,.05);
}
.featured-post { padding: 28px; }
.featured-post span,
.blog-sidebar strong {
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: .76rem;
}
.featured-post h2 { font-size: clamp(1.7rem, 4vw, 3rem); margin: 10px 0 12px; }
.featured-post p { color: var(--muted); line-height: 1.75; }
.post-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  margin: 18px 0;
}
.blog-sidebar { padding: 22px; display: grid; gap: 12px; align-content: start; }
.blog-sidebar a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
}
.blog-sidebar a:hover { border-color: var(--primary); color: var(--primary); }
.blog-grid-wide .blog-card { min-height: 230px; }
.blog-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
}
.blog-cta h2 { margin: 8px 0; font-size: clamp(1.6rem, 4vw, 2.6rem); }
.blog-cta p { margin: 0; color: var(--muted); max-width: 760px; }
.blog-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.footer {
  background: #10201c;
  color: #fff;
  padding: 48px 0 24px;
}
:root[data-theme="dark"] .footer { background: #050c0b; }
.footer a { display: block; color: #cbd5e1; margin: 7px 0; }
.footer-description { color: #d9e7e3; }
.footer-title { font-weight: 800; margin-bottom: 10px; }
.footer-bottom {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.12);
  color: #cbd5e1;
  font-size: .9rem;
}

.admin-body { background: #eef6f3; }
.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.admin-card { width: min(420px, 100%); padding: 24px; display: grid; gap: 14px; }
.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-shell aside {
  background: #10201c;
  color: #fff;
  padding: 24px;
  display: grid;
  align-content: start;
  gap: 12px;
}
.admin-shell aside a { color: #d1fae5; }
.admin-shell section { padding: 28px; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 30px;
}
.admin-grid div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.admin-grid span { color: var(--muted); display: block; }
.admin-grid strong { font-size: 2rem; }

@media (max-width: 991px) {
  .hero { padding-top: 42px; }
  .category-grid, .tool-grid, .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-layout { grid-template-columns: 1fr; }
  .blog-featured { grid-template-columns: 1fr; }
  .blog-cta { align-items: stretch; flex-direction: column; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-shell aside { position: static; }
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1699px) {
  .side-ads { display: none; }
}

@media (max-width: 640px) {
  .section { padding: 38px 0; }
  .category-grid, .tool-grid, .blog-grid, .admin-grid { grid-template-columns: 1fr; }
  .form-header { align-items: stretch; flex-direction: column; }
  .actions .btn { width: 100%; }
  .document-preview { min-height: 420px; padding: 18px; }
  .resume-head { align-items: flex-start; flex-direction: column; }
}

@media print {
  .site-header, .footer, .tool-form, .tool-hero, .seo-article, .ad-slot, .side-ads { display: none !important; }
  .section, .tool-section { padding: 0; }
  .app-layout { display: block; }
  .document-preview { border: 0; box-shadow: none; min-height: auto; }
}
