/* ==========================================================================
   کیوردر | Keyworder — White & Orange theme
   Pure CSS, no external fonts/frameworks (works offline, CSP-friendly)
   ========================================================================== */

:root {
  --orange: #ff7a18;
  --orange-600: #f26a05;
  --orange-700: #d45600;
  --orange-100: #ffe8d4;
  --orange-50: #fff6ee;
  --ink: #1f2430;
  --ink-2: #3d4555;
  --muted: #6b7280;
  --line: #ece7e1;
  --line-2: #f5f1ec;
  --bg: #ffffff;
  --bg-soft: #fffaf5;
  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --warn: #b45309;
  --warn-bg: #fff8e6;
  --bad: #b91c1c;
  --bad-bg: #fef2f2;
  --info: #1d4ed8;
  --info-bg: #eff4ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(31, 36, 48, .06), 0 4px 14px rgba(31, 36, 48, .05);
  --shadow-2: 0 8px 30px rgba(255, 122, 24, .14), 0 2px 8px rgba(31, 36, 48, .06);
  --font: "Vazirmatn", "Segoe UI", Tahoma, "Iranian Sans", "DejaVu Sans", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --maxw: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 90% -10%, #fff2e4 0%, rgba(255, 242, 228, 0) 60%),
    radial-gradient(900px 420px at -10% 0%, #fff8f1 0%, rgba(255, 248, 241, 0) 55%),
    var(--bg);
  min-height: 100vh;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
code, kbd, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--orange-50); color: var(--orange-700); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--orange-100); }
a { color: var(--orange-700); text-decoration: none; }
a:hover { color: var(--orange-600); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.5; margin: 0 0 .5rem; color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(22px, 3.4vw, 34px); }
h2 { font-size: clamp(18px, 2.4vw, 23px); }
h3 { font-size: 17px; }
p { margin: 0 0 .8rem; }
ul, ol { margin: .4rem 0 1rem; padding-inline-start: 1.3rem; }
ul.tight li, ol.tight li { margin-bottom: .35rem; }
.skip {
  position: absolute; inset-inline-start: -9999px; top: 0; background: var(--orange); color: #fff;
  padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 999;
}
.skip:focus { inset-inline-start: 0; }

/* ------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.logo { border-radius: 12px; box-shadow: var(--shadow-2); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 19px; font-weight: 900; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.main-nav { display: flex; gap: 4px; margin-inline-start: 12px; }
.main-nav a {
  padding: 8px 13px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.main-nav a:hover { background: var(--orange-50); color: var(--orange-700); text-decoration: none; }
.main-nav a.active { background: var(--orange); color: #fff; box-shadow: var(--shadow-2); }
.badge {
  background: rgba(255, 122, 24, .13); color: var(--orange-700); border-radius: 999px;
  padding: 1px 8px; font-size: 11.5px; font-weight: 800;
}
.main-nav a.active .badge { background: rgba(255, 255, 255, .25); color: #fff; }
.header-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; inset-inline-start: 12px; color: var(--muted); pointer-events: none; }
.search-box input {
  width: 320px; max-width: 46vw; padding: 9px 14px 9px 40px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; font-family: inherit; font-size: 13.5px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 122, 24, .14); }
.search-results {
  position: absolute; top: calc(100% + 8px); inset-inline-start: 0; width: min(460px, 90vw);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2);
  max-height: 60vh; overflow: auto; z-index: 80; padding: 6px;
}
.search-results a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--ink); }
.search-results a:hover, .search-results a:focus { background: var(--orange-50); text-decoration: none; }
.search-results strong { display: block; font-size: 14px; }
.search-results span { display: block; font-size: 12px; color: var(--muted); }
.search-results .empty { padding: 12px; color: var(--muted); font-size: 13px; }
.btn-ghost#navToggle { display: none; }
.mobile-nav { display: flex; gap: 8px; padding: 8px 20px 12px; border-top: 1px dashed var(--line); }
.mobile-nav a { padding: 6px 12px; border-radius: 999px; background: var(--orange-50); font-size: 13px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1.5px solid transparent;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .12s, box-shadow .18s, background .18s, color .18s;
  text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #ff9136, var(--orange-600)); color: #fff; box-shadow: var(--shadow-2); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange-700); background: var(--orange-50); }
.btn-lg { padding: 13px 26px; font-size: 15.5px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.loading .btn-label::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-inline-start: 8px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- hero */
main { padding-bottom: 60px; }
.hero { padding: 44px 0 8px; }
.hero-inner { max-width: 940px; }
.pill {
  display: inline-block; background: var(--orange-50); color: var(--orange-700);
  border: 1px solid var(--orange-100); padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(28px, 5vw, 46px); margin-bottom: .6rem; }
.grad {
  background: linear-gradient(100deg, var(--orange-700), var(--orange) 55%, #ffb066);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: 16px; color: var(--ink-2); max-width: 820px; }
.hero-search {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 999px; padding: 8px 8px 8px 20px; box-shadow: var(--shadow-1); margin: 20px 0 8px; max-width: 780px;
}
.hero-search svg { color: var(--muted); flex: none; }
.hero-search input { flex: 1; border: 0; outline: none; font-family: inherit; font-size: 15px; background: transparent; color: var(--ink); min-width: 0; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 24px; }
.hero-stats > div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 26px; color: var(--orange-700); font-weight: 900; line-height: 1.2; }
.hero-stats span { color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------ sections */
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.section-head .dot { color: var(--orange); display: inline-flex; }
.link-more { margin-inline-start: auto; font-size: 13px; font-weight: 700; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-1); transition: transform .16s, box-shadow .2s, border-color .2s;
  display: flex; gap: 12px; align-items: flex-start; position: relative;
}
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--orange-100); text-decoration: none; }
.tool-card .icon {
  width: 40px; height: 40px; border-radius: 12px; background: var(--orange-50); color: var(--orange-700);
  display: grid; place-items: center; flex: none; border: 1px solid var(--orange-100);
}
.card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-body strong { font-size: 15px; color: var(--ink); font-weight: 800; }
.card-body em { font-style: normal; font-size: 12.8px; color: var(--muted); line-height: 1.7; }
.tool-card.mini { padding: 12px 14px; }
.tool-card.mini .card-body strong { font-size: 13.5px; }
.tool-card.mini .card-body em { font-size: 11.5px; }
.cat-card { flex-direction: column; gap: 6px; }
.cat-head { display: flex; align-items: center; gap: 10px; width: 100%; }
.cat-head strong { font-size: 16px; }
.feature { flex-direction: column; gap: 6px; }
.feature strong { color: var(--orange-700); }

.tag { position: absolute; top: 10px; inset-inline-end: 10px; font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-row { position: static; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-row .tag { position: static; font-size: 11.5px; padding: 3px 10px; }
.tag-soft { background: var(--line-2); color: var(--muted); }
.tag-ok { background: var(--ok-bg); color: var(--ok); }

.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li {
  counter-increment: s; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 14px 16px; position: relative; padding-inline-start: 58px; box-shadow: var(--shadow-1);
}
.steps li::before {
  content: counter(s); position: absolute; inset-inline-start: 14px; top: 14px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff;
  display: grid; place-items: center; font-weight: 900; font-size: 14px;
}
.steps strong { display: block; margin-bottom: 2px; }
.steps span { color: var(--muted); font-size: 13px; }

.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(120deg, #fff5ec, #fff); border: 1px solid var(--orange-100);
  border-radius: 20px; padding: 24px 26px; box-shadow: var(--shadow-1);
}
.cta h2 { margin-bottom: 4px; }

/* --------------------------------------------------------- tools index */
.page-head { padding: 30px 0 6px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--orange-700); }
.filter-bar { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 6px; }
.filter-bar input {
  padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--line); font-family: inherit; font-size: 14px;
  background: #fff; color: var(--ink);
}
.filter-bar input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 122, 24, .12); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); padding: 6px 14px;
  border-radius: 999px; font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--orange); color: var(--orange-700); }
.chip.active { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: var(--shadow-2); }
.tool-grid .card.hidden, .section.hidden { display: none; }
.empty-state { text-align: center; padding: 40px 0; }

/* ------------------------------------------------------------ tool page */
.tool-head { padding-bottom: 12px; }
.tool-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tool-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-desc { color: var(--ink-2); max-width: 900px; }
.tool-layout { display: grid; grid-template-columns: minmax(320px, 430px) 1fr; gap: 18px; align-items: start; margin-top: 14px; }

.panel, .results {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-1);
}
.panel { position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow: auto; }
.form-fields { display: flex; flex-direction: column; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 13px; font-weight: 700; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.field .req { color: var(--orange); font-weight: 900; }
.field input[type=text], .field input[type=url], .field input[type=number], .field input[type=email],
.field input[type=search], .field select, .field textarea {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 11px;
  font-family: inherit; font-size: 13.8px; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.8; font-family: var(--mono); font-size: 12.8px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 122, 24, .12);
}
.field input[type=color] { width: 58px; height: 38px; padding: 2px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.field input[type=file] { font-size: 12.5px; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--bad); background: var(--bad-bg); }
.field .err { color: var(--bad); font-size: 11.5px; font-weight: 700; }
.check-row { display: flex; align-items: center; gap: 9px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--orange); }
.check-row label { font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.radio-row { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.radio-row input { accent-color: var(--orange); width: 16px; height: 16px; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.form-actions .btn { flex: 1; min-width: 170px; }
.form-hint { flex: 2; min-width: 200px; }

/* ------------------------------------------------------------- results */
.results { min-height: 260px; }
.placeholder { text-align: center; color: var(--muted); padding: 50px 16px; }
.placeholder svg { color: var(--orange-100); margin-bottom: 8px; }
.section-block { border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; background: #fff; }
.section-block > h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.section-block > h3 .count { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.score-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(var(--ring, var(--orange)) calc(var(--p) * 1%), #f4efe9 0); display: grid; place-items: center; }
.ring::before { content: ""; position: absolute; inset: 11px; background: #fff; border-radius: 50%; }
.ring b { position: relative; font-size: 30px; font-weight: 900; color: var(--ink); }
.ring span { position: relative; display: block; text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.ring.good { --ring: var(--ok); } .ring.mid { --ring: var(--orange); } .ring.bad { --ring: var(--bad); }
.score-summary { flex: 1; min-width: 240px; }
.score-summary p { color: var(--ink-2); margin: 0 0 10px; }
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 170px) 1fr 62px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-track { height: 8px; background: #f4efe9; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--orange); transition: width .6s ease; }
.bar-fill.ok { background: var(--ok); } .bar-fill.warn { background: #eab308; } .bar-fill.bad { background: var(--bad); }
.bar-val { text-align: end; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }

/* checks */
.group { margin-bottom: 14px; }
.group-head {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 9px 12px; background: var(--bg-soft);
  border: 1px solid var(--orange-100); border-radius: 11px; font-weight: 800; font-size: 14px; user-select: none;
}
.group-head .counts { margin-inline-start: auto; display: flex; gap: 6px; }
.mini-badge { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.mini-badge.pass { background: var(--ok-bg); color: var(--ok); }
.mini-badge.warn { background: var(--warn-bg); color: var(--warn); }
.mini-badge.fail { background: var(--bad-bg); color: var(--bad); }
.mini-badge.info { background: var(--info-bg); color: var(--info); }
.group-body { padding: 6px 2px 0; }
.group.closed .group-body { display: none; }
.check {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; padding: 10px 8px;
  border-bottom: 1px dashed var(--line); align-items: start;
}
.check:last-child { border-bottom: 0; }
.check .dotlevel { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 900; margin-top: 3px; }
.check.pass .dotlevel { background: var(--ok); }
.check.warn .dotlevel { background: #eab308; }
.check.fail .dotlevel { background: var(--bad); }
.check.info .dotlevel { background: var(--info); }
.check .body strong { display: block; font-size: 13.6px; font-weight: 700; }
.check .body p { margin: 2px 0 0; font-size: 12.6px; color: var(--muted); }
.check .body .fix { margin-top: 4px; font-size: 12.4px; color: var(--orange-700); background: var(--orange-50); padding: 5px 9px; border-radius: 8px; border: 1px solid var(--orange-100); }
.check .value { font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--line-2); padding: 2px 8px; border-radius: 8px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.check.fail { background: linear-gradient(90deg, rgba(254, 242, 242, .7), transparent 60%); }
.check.warn { background: linear-gradient(90deg, rgba(255, 248, 230, .7), transparent 60%); }

/* tables */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 460px; }
.table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: start; vertical-align: top; }
.table th { background: var(--orange-50); color: var(--orange-700); font-weight: 800; position: sticky; top: 0; z-index: 2; cursor: pointer; white-space: nowrap; }
.table tbody tr:hover { background: #fffaf5; }
.table td { color: var(--ink-2); word-break: break-word; }
.table td.num, .table th.num { text-align: start; font-variant-numeric: tabular-nums; }
.table tr.tone-pass td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.table tr.tone-warn td:first-child { box-shadow: inset 3px 0 0 #eab308; }
.table tr.tone-fail td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.table-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.table-tools input { padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 9px; font-family: inherit; font-size: 12.5px; min-width: 180px; }
.table-foot { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* kv */
.kv { display: grid; gap: 8px; }
.kv.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kv.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kv.cols-1 { grid-template-columns: 1fr; }
.kv-item { border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; background: var(--bg-soft); min-width: 0; }
.kv-item .k { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.kv-item .v { display: block; font-size: 13.2px; color: var(--ink); word-break: break-word; font-weight: 600; }
.kv-item .v.code { font-family: var(--mono); font-size: 12px; direction: ltr; text-align: left; }
.kv-item.ok .v { color: var(--ok); } .kv-item.warn .v { color: var(--warn); } .kv-item.bad .v { color: var(--bad); }
.copy-mini { float: left; font-size: 10.5px; color: var(--muted); cursor: pointer; border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; background: #fff; }
.copy-mini:hover { color: var(--orange-700); border-color: var(--orange); }

/* code */
.code-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.code-head .lang { font-family: var(--mono); font-size: 11px; background: var(--ink); color: #fff; padding: 2px 8px; border-radius: 6px; }
.code-head .spacer { flex: 1; }
pre.code {
  margin: 0; background: #1f2430; color: #f7f4ef; padding: 14px; border-radius: 12px; overflow: auto;
  font-family: var(--mono); font-size: 12.3px; line-height: 1.85; max-height: 420px; direction: ltr; text-align: left;
  white-space: pre-wrap; word-break: break-word; border: 1px solid #2b3242;
}
pre.code.nowrap { white-space: pre; }

/* notes */
.note { border-radius: 12px; padding: 11px 14px; font-size: 13px; margin-bottom: 14px; border: 1px solid; }
.note-info { background: var(--info-bg); border-color: #d6e2ff; color: #1e3a8a; }
.note-warn { background: var(--warn-bg); border-color: #ffe6b0; color: #7c4a03; }
.note-fail { background: var(--bad-bg); border-color: #fbd5d5; color: #7f1d1d; }
.note-pass { background: var(--ok-bg); border-color: #c9efd6; color: #14532d; }
.note ul { margin: 6px 0 0; }

/* tags */
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tagchip {
  background: var(--orange-50); border: 1px solid var(--orange-100); color: var(--orange-700);
  padding: 4px 11px; border-radius: 999px; font-size: 12.2px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center;
}
.tagchip .c { background: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; color: var(--muted); }
.tagchip.ok { background: var(--ok-bg); border-color: #c9efd6; color: var(--ok); }
.tagchip.warn { background: var(--warn-bg); border-color: #ffe6b0; color: var(--warn); }
.tagchip.bad { background: var(--bad-bg); border-color: #fbd5d5; color: var(--bad); }
.tagchip.info { background: var(--info-bg); border-color: #d6e2ff; color: var(--info); }

/* timing */
.timing { display: grid; gap: 10px; }
.timing-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 10px; align-items: center; font-size: 12.8px; }
.timing-track { height: 22px; background: #f6f2ec; border-radius: 8px; position: relative; overflow: hidden; }
.timing-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ffb066, var(--orange)); border-radius: 8px; }
.timing-fill.good { background: linear-gradient(90deg, #86efac, #22c55e); }
.timing-fill.bad { background: linear-gradient(90deg, #fca5a5, #ef4444); }
.timing-val { font-variant-numeric: tabular-nums; text-align: end; font-weight: 700; color: var(--ink-2); }

/* tree (headings) */
.tree { display: flex; flex-direction: column; gap: 4px; }
.tree-node { display: flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 9px; background: var(--bg-soft); border: 1px solid var(--line-2); }
.tree-node .lv { font-family: var(--mono); font-size: 11px; font-weight: 800; color: #fff; background: var(--orange); border-radius: 6px; padding: 1px 7px; flex: none; }
.tree-node[data-level="2"] .lv { background: #ff9a4d; } .tree-node[data-level="3"] .lv { background: #ffb37a; }
.tree-node[data-level="4"] .lv { background: #ffc79c; } .tree-node[data-level="5"] .lv { background: #d9a06b; }
.tree-node[data-level="6"] .lv { background: #b9b9b9; }
.tree-node .txt { font-size: 13px; min-width: 0; word-break: break-word; }
.tree-node.bad { background: var(--bad-bg); border-color: #fbd5d5; }

/* serp preview */
.serp-list { display: flex; flex-direction: column; gap: 12px; }
.serp-item { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.serp-item:hover { border-color: var(--orange-100); box-shadow: var(--shadow-1); }
.serp-item .top { display: flex; align-items: center; gap: 8px; }
.serp-item .pos { font-family: var(--mono); font-size: 11px; background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 7px; }
.serp-item .avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--orange-100); color: var(--orange-700); display: grid; place-items: center; font-size: 11px; font-weight: 900; flex: none; }
.serp-item .domain { font-size: 12px; color: var(--muted); }
.serp-item h4 { margin: 4px 0 2px; font-size: 15.5px; font-weight: 600; color: #1a0dab; }
.serp-item a:hover h4 { text-decoration: underline; }
.serp-item .url { font-size: 12px; color: #006621; direction: ltr; text-align: left; word-break: break-all; }
.serp-item .snip { font-size: 12.8px; color: var(--ink-2); margin-top: 3px; }
.serp-item.me { border-color: var(--orange); background: var(--orange-50); }
.serp-item.me::after { content: "سایت شما"; font-size: 10.5px; background: var(--orange); color: #fff; padding: 1px 8px; border-radius: 999px; margin-inline-start: 8px; }

/* preview cards (google serp / og / twitter) */
.preview { display: flex; flex-direction: column; gap: 10px; }
.g-result { max-width: 620px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-family: Arial, Tahoma, sans-serif; }
.g-result .g-url { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #202124; }
.g-result .g-fav { width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; display: grid; place-items: center; color: var(--orange-700); font-weight: 900; font-size: 12px; }
.g-result .g-path { color: #5f6368; font-size: 12px; direction: ltr; text-align: left; }
.g-result .g-title { color: #1a0dab; font-size: 19px; line-height: 1.4; margin: 4px 0; font-weight: 500; word-break: break-word; }
.g-result .g-desc { color: #4d5156; font-size: 13.5px; line-height: 1.7; }
.g-result.mobile { max-width: 400px; }
.g-result.mobile .g-title { font-size: 17px; }
.og-card { max-width: 520px; border: 1px solid #dcdcdc; border-radius: 10px; overflow: hidden; background: #fff; font-family: Arial, Tahoma, sans-serif; }
.og-card .og-img { height: 190px; background: linear-gradient(120deg, var(--orange-100), #fff) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.og-card .og-body { padding: 10px 12px; border-top: 1px solid #eee; }
.og-card .og-host { font-size: 11.5px; color: #606770; text-transform: uppercase; letter-spacing: .04em; }
.og-card .og-title { font-size: 15.5px; font-weight: 700; color: #050505; margin: 2px 0; }
.og-card .og-desc { font-size: 13px; color: #606770; }
.tw-card { max-width: 520px; border: 1px solid #e1e8ed; border-radius: 14px; overflow: hidden; background: #fff; }
.tw-card .tw-img { height: 200px; background: linear-gradient(120deg, #f1f5f9, #fff) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.tw-card .tw-body { padding: 10px 13px; }
.tw-card .tw-host { font-size: 12.5px; color: #536471; }
.tw-card .tw-title { font-size: 14.5px; font-weight: 700; color: #0f1419; }
.tw-card .tw-desc { font-size: 13px; color: #536471; }

/* links list */
.link-list { display: grid; gap: 6px; }
.link-list a { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 12.8px; }
.link-list a:hover { border-color: var(--orange-100); background: var(--orange-50); text-decoration: none; }
.link-list .lbl { font-weight: 700; }
.link-list .meta { color: var(--muted); font-size: 11.5px; margin-inline-start: auto; }

.imgbox { display: flex; gap: 12px; align-items: center; background: repeating-conic-gradient(#f7f7f7 0% 25%, #fff 0% 50%) 50% / 18px 18px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.imgbox img { max-width: 120px; max-height: 120px; image-rendering: auto; }
.imgbox .cap { font-size: 12px; color: var(--muted); word-break: break-all; }

/* frame preview (device simulator) */
.frame-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.frame-bar .size { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.frame-box { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #f6f6f6; padding: 8px; }
.frame-box iframe { border: 0; background: #fff; border-radius: 10px; box-shadow: var(--shadow-1); display: block; margin: 0 auto; }

/* diff */
.diff { font-family: var(--mono); font-size: 12.3px; border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 420px; direction: ltr; text-align: left; }
.diff div { padding: 2px 10px; white-space: pre-wrap; word-break: break-word; }
.diff .add { background: #ecfdf3; color: #14532d; }
.diff .del { background: #fef2f2; color: #7f1d1d; }
.diff .ctx { color: var(--muted); }
.diff .gutter { display: inline-block; width: 22px; color: #b0b0b0; }

/* color tools */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 108px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-align: center; }
.swatch .chipc { height: 54px; }
.swatch .meta { padding: 6px; font-size: 11px; font-family: var(--mono); color: var(--ink-2); }
.contrast-demo { padding: 16px; border-radius: 12px; border: 1px solid var(--line); font-size: 15px; font-weight: 700; text-align: center; }

/* toast */
.toast-host { position: fixed; bottom: 18px; inset-inline-start: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 13px;
  box-shadow: var(--shadow-2); max-width: min(420px, 88vw); animation: rise .25s ease;
}
.toast.ok { background: #166534; } .toast.err { background: #991b1b; } .toast.warn { background: #92400e; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* skeleton / progress */
.progress { height: 6px; background: var(--orange-100); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress i { display: block; height: 100%; width: 35%; background: linear-gradient(90deg, var(--orange), #ffb066); border-radius: 999px; animation: slide 1.1s infinite ease-in-out; }
@keyframes slide { 0% { transform: translateX(120%); } 100% { transform: translateX(-320%); } }
.running-note { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }

/* error page */
.error-page { text-align: center; padding: 60px 16px; }
.error-code { font-size: 90px; font-weight: 900; color: var(--orange-100); line-height: 1; }
.error-actions { display: flex; gap: 10px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.error-page .note { max-width: 520px; margin: 0 auto; text-align: start; }

/* docs */
.doc h2 { border-bottom: 2px solid var(--orange-100); padding-bottom: 8px; margin-top: 8px; }
.doc h3 { color: var(--orange-700); margin-top: 18px; }
.doc-list li { margin-bottom: 6px; }
.code-block { background: #1f2430; border-radius: 12px; padding: 4px 12px; overflow: auto; direction: ltr; text-align: left; }
.code-block pre { margin: 0; }
.code-block code { background: transparent; color: #f7f4ef; border: 0; padding: 0; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: linear-gradient(180deg, #fff, #fffbf7); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; padding: 30px 20px 18px; }
.footer-brand { font-size: 19px; font-weight: 900; }
.footer-brand span { color: var(--muted); font-size: 13px; font-weight: 600; }
.site-footer h4 { font-size: 14px; margin-bottom: 8px; color: var(--orange-700); }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin-bottom: 5px; }
.footer-list a { color: var(--ink-2); font-size: 13px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px 26px; border-top: 1px dashed var(--line); font-size: 12.5px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tool-layout { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .main-nav, .search-box { display: none; }
  .btn-ghost#navToggle { display: inline-flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kv.cols-3, .kv.cols-4, .kv.cols-5, .kv.cols-2 { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: 26px; }
  .hero-search { flex-wrap: wrap; border-radius: 18px; padding: 12px; }
  .hero-search .btn { width: 100%; }
  .bar-row { grid-template-columns: 100px 1fr 54px; }
  .timing-row { grid-template-columns: 96px 1fr 76px; }
  .check { grid-template-columns: 22px 1fr; }
  .check .value { grid-column: 2; justify-self: start; max-width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .score-wrap { gap: 14px; }
  .ring { width: 108px; height: 108px; }
}
@media (max-width: 420px) {
  .kv.cols-3, .kv.cols-4, .kv.cols-5, .kv.cols-2 { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .site-footer, .panel, .tool-actions, .table-tools, .code-head .spacer ~ button { display: none !important; }
  body { background: #fff; }
  .results { box-shadow: none; border: 0; }
  .section-block { break-inside: avoid; }
}
