/* ============================================================
   SEO Tool Master — design system
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-soft: #eef2ff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .12);
  --sidebar-w: 264px;
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #9333ea 100%);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }

p { margin: 0 0 1em; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 12px; text-decoration: none;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(79, 70, 229, .35); }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(79, 70, 229, .45); text-decoration: none; }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: rgba(15,23,42,.05); text-decoration: none; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 15px 30px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }

/* ---------- Landing page ---------- */
.landing-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 23, 42, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.landing-nav .container { display: flex; align-items: center; gap: 28px; height: 68px; }
.landing-nav .nav-links { display: flex; gap: 22px; margin-left: 10px; }
.landing-nav .nav-links a { color: #cbd5e1; font-weight: 500; }
.landing-nav .nav-links a:hover { color: #fff; text-decoration: none; }
.landing-nav .nav-cta { margin-left: auto; display: flex; gap: 12px; align-items: center; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.01em; color: #fff; }
.brand:hover { text-decoration: none; }
.brand .logo-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; box-shadow: 0 4px 12px rgba(124,58,237,.4);
}

.hero {
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(124,58,237,.45), transparent 60%),
    radial-gradient(800px 400px at 10% 0%, rgba(79,70,229,.4), transparent 55%),
    linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  color: #fff; padding: 96px 0 110px; text-align: center; position: relative; overflow: hidden;
}
.hero .container { position: relative; z-index: 2; max-width: 860px; }
.hero .badge {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18); padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #e0e7ff; margin-bottom: 26px;
}
.hero h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 18px; }
.hero h1 .grad-text {
  background: linear-gradient(90deg, #a5b4fc, #c4b5fd, #f0abfc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { font-size: clamp(16px, 2vw, 19px); color: #cbd5e1; max-width: 640px; margin: 0 auto 34px; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .stats-row { display: flex; gap: 44px; justify-content: center; margin-top: 56px; flex-wrap: wrap; }
.hero .stat { text-align: center; }
.hero .stat .num { font-size: 26px; font-weight: 800; color: #fff; }
.hero .stat .lbl { font-size: 13px; color: #94a3b8; margin-top: 2px; }
.hero-glow {
  position: absolute; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.35), transparent 70%);
  top: -250px; left: 50%; transform: translateX(-50%); pointer-events: none;
}

.section { padding: 84px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.section-head .kicker { color: var(--primary); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.02em; margin: 10px 0 12px; }
.section-head p { color: var(--muted); font-size: 16px; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.tool-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c7d2fe; }
.tool-card .t-icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 16px;
}
.tool-card h3 { font-size: 17px; margin-bottom: 6px; }
.tool-card p { color: var(--muted); font-size: 14px; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.step { text-align: center; padding: 10px; }
.step .s-num {
  width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(79,70,229,.3);
}
.step h3 { font-size: 17px; }
.step p { color: var(--muted); font-size: 14px; max-width: 260px; margin: 0 auto; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; max-width: 780px; margin: 0 auto; }
.price-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 34px 30px;
  display: flex; flex-direction: column; position: relative;
}
.price-card.featured { border: 0; background: var(--grad); color: #fff; box-shadow: var(--shadow-lg); }
.price-card.featured .price-num { color: #fff; }
.price-card.featured ul li { color: #e0e7ff; }
.price-card.featured .btn-outline { background: #fff; color: var(--primary); border: 0; }
.price-card .plan-name { font-weight: 700; font-size: 15px; opacity: .85; }
.price-card .price-num { font-size: 44px; font-weight: 800; margin: 10px 0 4px; }
.price-card .price-num small { font-size: 15px; font-weight: 500; opacity: .7; }
.price-card .plan-blurb { font-size: 13.5px; opacity: .85; margin-bottom: 18px; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.price-card ul li { padding: 7px 0; font-size: 14.5px; }
.price-card ul li::before { content: "✓"; margin-right: 9px; font-weight: 800; color: var(--ok); }
.price-card.featured ul li::before { color: #86efac; }

.faq-list { max-width: 720px; margin: 0 auto; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.faq-item summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 20px; color: var(--primary); font-weight: 700; }
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-a { padding: 0 20px 16px; color: var(--muted); }

.landing-footer { background: #0f172a; color: #94a3b8; padding: 40px 0; }
.landing-footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.landing-footer .brand { color: #fff; }
.landing-footer small { display: block; margin-top: 8px; }

/* ---------- App shell ---------- */
.app-body { display: block; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: #0f172a; color: #cbd5e1; display: flex; flex-direction: column;
  padding: 20px 16px; overflow-y: auto; z-index: 40;
}
.sidebar .brand { margin: 2px 8px 22px; }
.nav-group { margin-bottom: 18px; }
.nav-group .nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #64748b; font-weight: 700; padding: 0 10px; margin-bottom: 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  color: #cbd5e1; font-weight: 500; font-size: 14.5px; margin-bottom: 2px;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,.35); }
.nav-link .n-icon { width: 22px; text-align: center; font-size: 16px; }
.sidebar .upgrade-box {
  margin-top: auto; background: linear-gradient(135deg, rgba(79,70,229,.25), rgba(124,58,237,.2));
  border: 1px solid rgba(124,58,237,.4); border-radius: 14px; padding: 16px; text-align: center;
}
.sidebar .upgrade-box h4 { color: #fff; margin: 0 0 4px; font-size: 15px; }
.sidebar .upgrade-box p { font-size: 12.5px; color: #94a3b8; margin: 0 0 12px; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  padding: 14px 28px; display: flex; align-items: center; gap: 16px;
}
.topbar .page-title { font-size: 18px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.credits-pill {
  display: inline-flex; align-items: center; gap: 7px; background: var(--primary-soft);
  color: var(--primary); font-weight: 700; font-size: 13px; padding: 6px 13px; border-radius: 999px;
}
.credits-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.user-chip { display: inline-flex; align-items: center; gap: 9px; }
.user-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.user-chip .u-name { font-weight: 600; font-size: 14px; }
.user-chip .u-plan { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.user-chip .u-plan.premium { color: #7c3aed; font-weight: 700; }

.page { padding: 30px 28px 60px; flex: 1; }
.page-narrow { max-width: 860px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 26px; }
.card h3 { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.field .label .req { color: var(--bad); }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 11px;
  font-size: 14.5px; font-family: inherit; color: var(--ink); background: #fff; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ---------- Tool page ---------- */
.tool-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.tool-head .big-icon { width: 54px; height: 54px; border-radius: 14px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.tool-head h1 { font-size: 24px; margin: 0 0 4px; }
.tool-head p { color: var(--muted); margin: 0; font-size: 14.5px; max-width: 560px; }
.tool-head .cost-chip { margin-left: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; }
.chip-primary { background: var(--primary-soft); color: var(--primary); }
.chip-amber { background: var(--warn-bg); color: var(--warn); }
.chip-green { background: var(--ok-bg); color: var(--ok); }
.chip-blue { background: var(--info-bg); color: var(--info); }
.chip-gray { background: #f1f5f9; color: var(--ink-2); }

.tool-layout { display: grid; grid-template-columns: 400px 1fr; gap: 24px; align-items: start; }
.tool-form-card { position: sticky; top: 86px; }
.result-panel { min-height: 320px; }
.result-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 70px 30px; color: var(--muted);
}
.result-empty .re-icon { font-size: 44px; margin-bottom: 14px; opacity: .7; }

.result-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 18px;
}
.result-head h3 { margin: 0; font-size: 17px; flex: 1; min-width: 180px; }
.result-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 70px 20px; gap: 18px; color: var(--muted);
}
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid var(--primary-soft); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading .steps { font-size: 13px; display: flex; gap: 16px; color: var(--muted); flex-wrap: wrap; justify-content: center; }
.loading .steps .on { color: var(--primary); font-weight: 600; }

/* ---------- Result components ---------- */
.meta-card { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 20px; }
.meta-card .meta-row { display: flex; gap: 12px; padding: 5px 0; font-size: 13.5px; }
.meta-card .meta-row .m-label { color: var(--muted); font-weight: 600; min-width: 118px; flex-shrink: 0; }
.meta-card code { background: #eef2ff; color: var(--primary); padding: 1px 7px; border-radius: 6px; font-size: 12.5px; word-break: break-all; }
.meta-card .chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }

.md-body { font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.md-body h1 { font-size: 26px; }
.md-body h2 { font-size: 21px; margin-top: 1.6em; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.md-body h3 { font-size: 17.5px; margin-top: 1.4em; color: var(--ink); }
.md-body p { margin: 0 0 1em; }
.md-body ul, .md-body ol { margin: 0 0 1em; padding-left: 26px; }
.md-body li { margin-bottom: 5px; }
.md-body strong { color: var(--ink); }
.md-body blockquote { border-left: 4px solid #c7d2fe; margin: 1em 0; padding: 8px 18px; background: var(--primary-soft); border-radius: 0 10px 10px 0; color: var(--ink-2); }
.md-body pre { background: #0f172a; color: #e2e8f0; padding: 14px 18px; border-radius: 12px; overflow-x: auto; font-size: 13px; }
.md-body code { background: #f1f5f9; padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.md-body pre code { background: transparent; padding: 0; }
.md-body a { text-decoration: underline; }
.md-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }

/* keyword table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #f8fafc; }
.table .kw { font-weight: 600; }
.kw-suggestion { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 340px; }
.bar-track { width: 120px; height: 7px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; }
.bar-green { background: var(--ok); }
.bar-orange { background: var(--warn); }
.bar-red { background: var(--bad); }
.bar-violet { background: var(--primary-2); }
.diff-label { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* titles list */
.title-list { counter-reset: t; list-style: none; padding: 0; margin: 0; }
.title-list li {
  counter-increment: t; display: flex; align-items: center; gap: 14px;
  padding: 13px 6px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 500;
}
.title-list li::before { content: counter(t); width: 28px; height: 28px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.title-list li .spacer { flex: 1; }

/* meta cards */
.meta-list { display: flex; flex-direction: column; gap: 14px; }
.meta-option { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff; }
.meta-option .m-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.meta-option .m-text { font-size: 14.5px; }

/* humanizer */
.human-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.human-panel { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.human-panel .h-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; background: #f8fafc; }
.human-panel .h-body { padding: 16px; font-size: 14px; max-height: 420px; overflow-y: auto; white-space: pre-wrap; }
.ai-meter { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; }
.ai-meter .meter-track { width: 74px; height: 7px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.ai-meter .meter-fill { height: 100%; }
.meter-high { background: var(--bad); }
.meter-mid { background: var(--warn); }
.meter-low { background: var(--ok); }
.human-notes { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 12px 16px; font-size: 13.5px; margin-top: 14px; }

/* score ring */
.score-grid { display: grid; grid-template-columns: 240px 1fr; gap: 26px; align-items: center; }
.score-ring-wrap { text-align: center; }
.score-ring {
  width: 190px; height: 190px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; position: relative;
  background: conic-gradient(var(--ring-color, var(--ok)) calc(var(--score, 0) * 1%), #e2e8f0 0);
}
.score-ring::before { content: ""; position: absolute; inset: 14px; background: #fff; border-radius: 50%; }
.score-ring .score-num { position: relative; z-index: 1; font-size: 44px; font-weight: 800; }
.score-ring .score-out { position: relative; z-index: 1; font-size: 13px; color: var(--muted); margin-top: 34px; position: absolute; bottom: 40px; }
.score-stats { display: flex; gap: 26px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.score-stat { text-align: center; }
.score-stat .num { font-size: 20px; font-weight: 800; }
.score-stat .lbl { font-size: 12px; color: var(--muted); }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-radius: 11px; font-size: 14px; border: 1px solid var(--line); }
.check-item .c-icon { flex-shrink: 0; font-weight: 800; width: 20px; text-align: center; }
.check-item.pass { background: var(--ok-bg); border-color: #a7f3d0; }
.check-item.pass .c-icon { color: var(--ok); }
.check-item.warn { background: var(--warn-bg); border-color: #fde68a; }
.check-item.warn .c-icon { color: var(--warn); }
.check-item.fail { background: var(--bad-bg); border-color: #fecaca; }
.check-item.fail .c-icon { color: var(--bad); }
.check-item .c-detail { display: block; font-size: 12.5px; color: var(--muted); }
.suggestions-card { background: var(--info-bg); border: 1px solid #bae6fd; border-radius: 12px; padding: 16px 18px; margin-top: 18px; }
.suggestions-card h4 { margin: 0 0 8px; color: var(--info); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.suggestions-card ul { margin: 0; padding-left: 20px; }
.suggestions-card li { font-size: 13.5px; margin-bottom: 5px; color: var(--ink-2); }

/* image ideas */
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.idea-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.idea-card .i-prompt { font-size: 13.5px; color: var(--ink-2); flex: 1; }
.idea-card .i-use { font-size: 11.5px; color: var(--muted); }
.idea-card .i-foot { display: flex; justify-content: space-between; align-items: center; }

/* ---------- Dashboard ---------- */
.welcome-banner { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; border-radius: var(--radius); padding: 28px; margin-bottom: 24px; position: relative; overflow: hidden; }
.welcome-banner::after { content: "🚀"; position: absolute; right: 26px; bottom: -14px; font-size: 90px; opacity: .18; }
.welcome-banner h1 { margin: 0 0 6px; font-size: 26px; }
.welcome-banner p { margin: 0; opacity: .9; font-size: 14.5px; max-width: 560px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 30px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.stat-card .s-icon { font-size: 22px; margin-bottom: 8px; }
.stat-card .s-num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-card .s-lbl { font-size: 13px; color: var(--muted); margin-top: 3px; }
.quick-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.quick-tool { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; gap: 14px; align-items: flex-start; transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease; }
.quick-tool:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #c7d2fe; text-decoration: none; }
.quick-tool .q-icon { font-size: 24px; width: 42px; height: 42px; background: var(--primary-soft); border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-tool .q-name { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.quick-tool .q-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.quick-tool .q-cost { margin-top: 8px; }

/* ---------- Docs list ---------- */
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-row { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 16px 18px; }
.doc-row .d-icon { font-size: 22px; width: 40px; height: 40px; background: var(--primary-soft); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-row .d-title { font-weight: 600; font-size: 15px; }
.doc-row .d-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.doc-row .spacer { flex: 1; }
.doc-row .d-actions { display: flex; gap: 8px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .es-icon { font-size: 46px; margin-bottom: 14px; opacity: .6; }

/* ---------- Demo banner ---------- */
.demo-banner {
  display: flex; gap: 12px; align-items: flex-start; background: var(--warn-bg);
  border: 1px solid #fde68a; color: #92400e; border-radius: 12px; padding: 14px 18px;
  font-size: 13.5px; margin-bottom: 22px;
}
.demo-banner .db-icon { font-size: 18px; }
.demo-banner code { background: rgba(217,119,6,.12); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* ---------- Toasts ---------- */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; max-width: 340px;
  display: flex; gap: 10px; align-items: flex-start; animation: toast-in .25s ease;
}
.toast.success { background: #065f46; }
.toast.error { background: #7f1d1d; }
.toast .t-close { cursor: pointer; opacity: .7; margin-left: 4px; }
@keyframes toast-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px; background: linear-gradient(135deg, #0f172a 0%, #312e81 100%); position: relative; }
.auth-body::before { content: ""; position: absolute; inset: 0; background: radial-gradient(700px 500px at 85% 10%, rgba(124,58,237,.4), transparent 60%), radial-gradient(600px 400px at 5% 90%, rgba(79,70,229,.35), transparent 55%); }
.auth-card { position: relative; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); display: grid; grid-template-columns: 1fr 1fr; max-width: 860px; width: 100%; overflow: hidden; }
.auth-brand { background: var(--grad); color: #fff; padding: 40px 36px; display: flex; flex-direction: column; }
.auth-brand h2 { font-size: 24px; margin: 6px 0 10px; }
.auth-brand p { opacity: .9; font-size: 14px; }
.auth-brand ul { list-style: none; padding: 0; margin: 22px 0 0; }
.auth-brand ul li { padding: 8px 0; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.auth-brand ul li::before { content: "✓"; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.2); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.auth-form { padding: 40px 38px; }
.auth-form h1 { font-size: 23px; margin: 0 0 6px; }
.auth-form .auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-switch { text-align: center; font-size: 13.5px; margin-top: 16px; color: var(--muted); }
.alert { border-radius: 11px; padding: 12px 15px; font-size: 13.5px; margin-bottom: 18px; }
.alert-error { background: var(--bad-bg); color: #991b1b; border: 1px solid #fecaca; }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; gap: 12px; }
.section-title { font-size: 19px; font-weight: 700; margin-bottom: 14px; }

.copied-flash { color: var(--ok); font-weight: 700; font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-form-card { position: static; }
  .human-panels { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: static; width: 100%; height: auto; flex-direction: column; padding: 14px; }
  .sidebar .nav-groups { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-group { margin-bottom: 0; margin-right: 14px; }
  .nav-group .nav-label { display: none; }
  .nav-link { padding: 7px 10px; font-size: 13.5px; }
  .sidebar .upgrade-box { display: none; }
  .main { margin-left: 0; }
  .page { padding: 20px 16px 50px; }
  .topbar { padding: 12px 16px; }
  .auth-card { grid-template-columns: 1fr; max-width: 440px; }
  .auth-brand { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   SEO Tool Master v2 — admin, payments, WordPress modal
   ============================================================ */

/* ---------- Logo in brand ---------- */
.brand .logo-img { height: 30px; width: auto; max-width: 140px; object-fit: contain; }

/* ---------- Admin ---------- */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.pay-detail { background: #f8fafc; border: 1px dashed #c7d2fe; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.pay-detail .pay-detail-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.pay-detail .pay-detail-value { font-size: 17px; font-weight: 800; color: var(--ink); margin-top: 2px; word-break: break-all; }
.test-result { margin-left: 10px; display: inline-block; }
.wp-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #a7f3d0; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; }
.wp-bad { background: var(--bad-bg); color: #991b1b; border: 1px solid #fecaca; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px);
  z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-box {
  background: #fff; border-radius: 16px; max-width: 640px; width: 100%;
  box-shadow: var(--shadow-lg); animation: modal-in .18s ease; margin: auto 0;
}
@keyframes modal-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-x { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal-x:hover { color: var(--ink); }
.modal-body { padding: 20px; }
.wp-preview {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px;
  max-height: 220px; overflow-y: auto; background: #f8fafc; font-size: 13.5px; line-height: 1.6; color: var(--ink-2);
}
.wp-preview h2 { font-size: 16px; margin: 8px 0 4px; }
.wp-preview h3 { font-size: 14px; margin: 6px 0 3px; }
.wp-preview p { margin: 0 0 8px; }

/* ---------- Word count meta for admin settings ---------- */
@media (max-width: 1020px) { .modal-overlay { padding: 20px 12px; } }

/* ---------- AI provider picker (admin) ---------- */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.provider-card {
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer;
  padding: 14px; text-align: left; font-family: inherit; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.provider-card:hover { border-color: #c7d2fe; box-shadow: var(--shadow); }
.provider-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.provider-card .p-icon { font-size: 22px; }
.provider-card .p-name { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.provider-card .p-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.provider-card .p-badges .chip { font-size: 10px; padding: 2px 7px; }
.btn-danger input:checked + span, .cleared { text-decoration: line-through; opacity: .8; }

/* ---------- Blog (public + home) ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.blog-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c7d2fe; text-decoration: none; }
.blog-card .cover { height: 170px; overflow: hidden; background: var(--primary-soft); }
.blog-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card .cover .no-cover { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 46px; }
.blog-card .b-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.blog-card .b-meta { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.blog-card .b-title { font-size: 17px; font-weight: 700; color: var(--ink); margin: 8px 0 6px; line-height: 1.35; }
.blog-card .b-excerpt { font-size: 13.5px; color: var(--ink-2); margin: 0 0 12px; flex: 1; }
.blog-card .b-read { font-size: 13px; font-weight: 700; color: var(--primary); }
.blog-article { max-width: 780px; margin: 0 auto; }
.blog-article-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; margin-top: 10px; }
.blog-article .cover-img { width: 100%; border-radius: 16px; margin-top: 24px; box-shadow: var(--shadow); }
.blog-article .md-body h2 { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-top: 1.6em; }
.blog-article .md-body h3 { margin-top: 1.4em; }
