@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,300..700,0..1,-50..200');

:root {
  --bg: #0b0d10;
  --surface: #12141a;
  --surface2: #191c24;
  --border: #232734;
  --accent: #2dd4bf;
  --accent2: #fb923c;
  --accent3: #8b5cf6;
  --text: #e6e9ef;
  --muted: #9aa4b2;
  --danger: #ff4d6d;
  --warning: #ffb930;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(45,212,191,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,212,191,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none; z-index: 0;
}

/* ── LAYOUT ── */
.page-wrap {
  position: relative; z-index: 10;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* ── NAV ── */
nav.topnav {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 1.5rem;
  max-width: 860px;
  margin: 0 auto;
}

.logo {
  font-family: 'Inter', sans-serif;
  font-weight: 800; font-size: 1.2rem;
  letter-spacing: -0.02em; color: var(--text);
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none;
}

.back-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem; color: var(--muted);
  text-decoration: none; letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 0.4rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* ── ICONS ── */
.icon {
  font-family: 'Material Symbols Rounded';
  font-weight: 500;
  font-style: normal;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  vertical-align: -0.15em;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.icon.sm { font-size: 1rem; font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 20; }
.icon.lg { font-size: 1.25rem; font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 28; }

/* ── TOOL HERO ── */
.tool-hero {
  padding: 2.5rem 0 2rem;
}
.tool-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(45,212,191,0.07);
  border: 1px solid rgba(45,212,191,0.18);
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem; padding: 0.28rem 0.75rem;
  border-radius: 100px; margin-bottom: 1rem;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.tool-hero h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.05; letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}
.tool-hero h1 em { font-style: normal; color: var(--accent); }
.tool-hero p {
  color: var(--muted); font-size: 0.95rem;
  max-width: 520px; line-height: 1.6;
}

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

/* ── FORM ELEMENTS ── */
.field { margin-bottom: 1rem; }
label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem; color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 0.4rem;
}
textarea, input[type="text"], input[type="url"],
input[type="tel"], select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem; padding: 0.75rem 1rem;
  outline: none; transition: border-color 0.2s;
  resize: vertical;
}
textarea:focus, input:focus, select:focus { border-color: var(--accent); }
select { resize: none; cursor: pointer; }

.char-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem; text-align: right;
  margin-top: 0.3rem; color: var(--muted);
}
.char-count.warn { color: var(--warning); }
.char-count.danger { color: var(--danger); }

/* ── BUTTONS ── */
.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600; font-size: 0.88rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px; border: none;
  cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: #3be7cf; transform: translateY(-1px); box-shadow: 0 4px 18px rgba(45,212,191,0.28); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-orange { background: var(--accent2); color: #fff; }
.btn-orange:hover { background: #fd9b4c; transform: translateY(-1px); }
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

/* ── RESULT BOX ── */
.result-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 1rem;
  font-family: 'DM Mono', monospace; font-size: 0.8rem;
  color: var(--text); min-height: 48px;
  white-space: pre-wrap; word-break: break-word;
}
.result-box.success { border-color: var(--accent); }
.result-box.error { border-color: var(--danger); color: var(--danger); }

/* ── DIVIDER ── */
hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

/* ── LOADING DOTS ── */
.dots {
  display: flex; gap: 6px; justify-content: center;
  padding: 1.5rem 0 0.5rem;
}
.dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: dot-p 1.2s ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-p {
  0%,80%,100% { transform: scale(0.55); opacity: 0.35; }
  40% { transform: scale(1); opacity: 1; }
}
.dots-label {
  text-align: center; font-family: 'DM Mono', monospace;
  font-size: 0.75rem; color: var(--muted);
  padding-bottom: 1rem;
}

/* ── STAT BLOCKS ── */
.stats-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stat-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.6rem 1rem;
  font-family: 'DM Mono', monospace; font-size: 0.7rem;
  color: var(--muted); text-align: center; flex: 1; min-width: 80px;
}
.stat-box strong {
  display: block; font-size: 1.5rem;
  font-family: 'Inter', sans-serif; font-weight: 700;
  color: var(--text); line-height: 1.1; margin-bottom: 0.1rem;
}
.stat-box.ok strong { color: var(--accent); }
.stat-box.bad strong { color: var(--danger); }

/* ── TABLES ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.data-table th {
  text-align: left; font-family: 'DM Mono', monospace;
  font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(42,42,56,0.5);
  font-family: 'DM Mono', monospace; font-size: 0.73rem;
  color: var(--text); word-break: break-all; vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255,255,255,0.015); }
.badge {
  font-size: 0.63rem; padding: 0.12rem 0.45rem;
  border-radius: 4px; font-family: 'DM Mono', monospace;
}
.badge-green { background: rgba(0,229,160,0.1); color: var(--accent); }
.badge-purple { background: rgba(124,92,252,0.1); color: var(--accent3); }
.badge-red { background: rgba(255,77,109,0.1); color: var(--danger); }
.badge-orange { background: rgba(255,107,53,0.1); color: var(--accent2); }
.badge-yellow { background: rgba(255,185,48,0.1); color: var(--warning); }
.c-ok { color: var(--accent); font-weight: 500; }
.c-bad { color: var(--danger); font-weight: 500; }
.c-warn { color: var(--warning); font-weight: 500; }
.c-muted { color: var(--muted); }

/* ── CHECK CHIPS ── */
.chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.64rem; font-family: 'DM Mono', monospace;
  padding: 0.15rem 0.5rem; border-radius: 4px; margin: 0.1rem;
}
.chip-pass { background: rgba(0,229,160,0.1); color: var(--accent); }
.chip-fail { background: rgba(255,77,109,0.1); color: var(--danger); }
.chip-warn { background: rgba(255,185,48,0.1); color: var(--warning); }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--surface); border: 1px solid var(--accent);
  color: var(--accent); font-family: 'DM Mono', monospace;
  font-size: 0.8rem; padding: 0.7rem 1.1rem;
  border-radius: 8px; z-index: 1000;
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 8px 28px rgba(45,212,191,0.12);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── FOOTER ── */
footer {
  position: relative; z-index: 10;
  max-width: 860px; margin: 0 auto;
  padding: 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 0.75rem;
}
footer p { font-family: 'DM Mono', monospace; font-size: 0.72rem; color: var(--muted); }
footer a { color: var(--accent); text-decoration: none; }

/* ── SERP PREVIEW ── */
.serp-box {
  background: #fff; border-radius: 10px;
  padding: 1.25rem 1.5rem; margin-top: 1rem;
  max-width: 600px;
}
.serp-box.mobile { max-width: 360px; }
.serp-site { font-family: Arial, sans-serif; font-size: 12px; color: #202124; margin-bottom: 3px; }
.serp-dot { width: 18px; height: 18px; border-radius: 50%; background: #4285f4; display: inline-block; vertical-align: middle; margin-right: 5px; }
.serp-title { font-family: Arial, sans-serif; font-size: 20px; color: #1a0dab; line-height: 1.3; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.serp-box.mobile .serp-title { font-size: 18px; }
.serp-desc { font-family: Arial, sans-serif; font-size: 14px; color: #4d5156; line-height: 1.58; }
.serp-box.mobile .serp-desc { font-size: 13px; }

/* ── DEVICE TABS ── */
.device-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.device-tab {
  font-family: 'DM Mono', monospace; font-size: 0.73rem;
  padding: 0.4rem 0.8rem; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--muted); cursor: pointer; transition: all 0.2s;
}
.device-tab.active { border-color: var(--accent3); color: var(--accent3); background: rgba(124,92,252,0.08); }

/* ── META OUTPUT (syntax) ── */
.meta-out {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 1rem;
  font-family: 'DM Mono', monospace; font-size: 0.76rem;
  line-height: 1.9; overflow-x: auto; margin-top: 1rem;
}
.mt-tag { color: #ff6b9d; }
.mt-attr { color: var(--accent3); }
.mt-val { color: var(--accent2); }
.mt-bracket { color: var(--muted); }

/* ── WA PREVIEW ── */
.wa-output {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.9rem 1rem; margin-top: 1rem;
  font-family: 'DM Mono', monospace; font-size: 0.78rem;
  color: var(--accent); word-break: break-all; min-height: 42px;
}
.wa-bubble-wrap {
  background: #e5ddd5; border-radius: 10px;
  padding: 1rem 1.25rem; margin-top: 1rem;
}
.wa-bubble {
  background: #fff; border-radius: 0 8px 8px 8px;
  padding: 0.6rem 0.8rem; max-width: 280px;
  font-family: 'Inter', sans-serif; font-size: 0.88rem;
  color: #111; line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.wa-time { font-size: 0.65rem; color: #999; text-align: right; margin-top: 3px; }

/* ── ROBOTS HIGHLIGHT ── */
.rb-output {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 1rem;
  font-family: 'DM Mono', monospace; font-size: 0.77rem;
  line-height: 1.8; max-height: 280px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word; margin-top: 1rem;
}
.rb-ua { color: var(--accent3); }
.rb-allow { color: var(--accent); }
.rb-disallow { color: var(--danger); }
.rb-sitemap { color: var(--warning); }
.rb-comment { color: var(--muted); font-style: italic; }

/* ── SITEMAP URLS ── */
.url-list { display: grid; gap: 0.35rem; max-height: 320px; overflow-y: auto; margin-top: 1rem; }
.url-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.45rem 0.75rem;
  font-family: 'DM Mono', monospace; font-size: 0.71rem;
  color: var(--text); display: flex;
  justify-content: space-between; align-items: center;
  gap: 0.5rem;
}
.url-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ── META CHECK ROWS ── */
.mc-section-title {
  font-family: 'DM Mono', monospace; font-size: 0.68rem;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin: 1.25rem 0 0.5rem;
}
.mc-row {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.7rem 1rem; margin-bottom: 0.5rem;
}
.mc-label {
  font-family: 'DM Mono', monospace; font-size: 0.68rem;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem;
}
.mc-value { font-size: 0.84rem; color: var(--text); word-break: break-word; line-height: 1.4; }
.mc-value.missing { color: var(--danger); font-style: italic; }
.mc-hint { font-family: 'DM Mono', monospace; font-size: 0.67rem; color: var(--muted); margin-top: 0.25rem; }
.mc-hint.ok { color: var(--accent); }
.mc-hint.warn { color: var(--warning); }
.mc-hint.bad { color: var(--danger); }
.og-card {
  background: #fff; border-radius: 10px; overflow: hidden;
  max-width: 500px; margin-top: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.og-img { width: 100%; height: 200px; object-fit: cover; background: #eee; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.og-body { padding: 0.75rem 1rem; }
.og-site { font-family: Arial, sans-serif; font-size: 11px; color: #65676b; text-transform: uppercase; margin-bottom: 2px; }
.og-title { font-family: Arial, sans-serif; font-size: 15px; font-weight: 700; color: #1c1e21; line-height: 1.3; margin-bottom: 2px; }
.og-desc { font-family: Arial, sans-serif; font-size: 13px; color: #65676b; }

/* ── EXTRACT TABS ── */
.ex-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ex-tab {
  font-family: 'DM Mono', monospace; font-size: 0.71rem;
  padding: 0.38rem 0.75rem; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--muted); cursor: pointer; transition: all 0.2s;
}
.ex-tab.active { border-color: var(--accent2); color: var(--accent2); background: rgba(255,107,53,0.07); }
.ex-section { display: none; }
.ex-section.active { display: block; }
.ex-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.5rem 0.75rem;
  margin-bottom: 0.35rem; font-size: 0.82rem;
  color: var(--text); line-height: 1.4;
  display: flex; gap: 0.5rem; align-items: flex-start;
}
.ex-prefix {
  font-family: 'DM Mono', monospace; font-size: 0.63rem;
  color: var(--muted); flex-shrink: 0; padding-top: 2px;
}
.h-h1 { border-left: 3px solid var(--accent); }
.h-h2 { border-left: 3px solid var(--accent3); }
.h-h3 { border-left: 3px solid var(--warning); }
.h-h4, .h-h5, .h-h6 { border-left: 3px solid var(--border); }

/* ── KW ITEMS ── */
.kw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.5rem; margin-top: 1rem; }
.kw-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.55rem 0.8rem;
  display: flex; justify-content: space-between;
  align-items: center; gap: 0.5rem;
}
.kw-word { font-family: 'DM Mono', monospace; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-bar-wrap { height: 3px; background: var(--border); border-radius: 100px; margin-top: 3px; }
.kw-bar { height: 100%; border-radius: 100px; background: var(--accent); transition: width 0.5s; }
.kw-badge { font-family: 'DM Mono', monospace; font-size: 0.68rem; padding: 0.12rem 0.4rem; border-radius: 100px; flex-shrink: 0; }
.kh1 { background: rgba(0,229,160,0.07); color: var(--accent); border: 1px solid rgba(0,229,160,0.2); }
.kh2 { background: rgba(45,212,191,0.12); color: var(--accent); border: 1px solid rgba(45,212,191,0.28); }
.kh3 { background: rgba(45,212,191,0.2); color: var(--accent); border: 1px solid rgba(45,212,191,0.35); }
.kh4 { background: rgba(255,185,48,0.15); color: var(--warning); border: 1px solid rgba(255,185,48,0.35); }
.kh5 { background: rgba(255,107,53,0.15); color: var(--accent2); border: 1px solid rgba(255,107,53,0.35); }

/* ── IMG CARDS ── */
.img-grid { display: grid; gap: 0.7rem; margin-top: 1rem; }
.img-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.75rem 1rem;
  display: grid; grid-template-columns: 48px 1fr;
  gap: 0.75rem; align-items: start;
}
.img-icon { font-size: 1.4rem; padding-top: 3px; }
.img-url { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 0.25rem; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .page-wrap { padding: 0 1rem 4rem; }
  nav.topnav { padding: 1.25rem 1rem; }
  .tool-hero { padding: 2rem 0 1.5rem; }
  footer { padding: 1.25rem 1rem; }
  .kw-grid { grid-template-columns: 1fr; }
}
