/* ============================================================
   NSEND Tools — design system (light mode only, mobile-first)
   ============================================================ */

:root {
  /* Brand palette */
  --brand-50:  #eef4ff;
  --brand-100: #dbe6ff;
  --brand-200: #b9ccff;
  --brand-300: #8aa9ff;
  --brand-400: #5f82fb;
  --brand-500: #3b5bef;   /* primary */
  --brand-600: #2c44d6;
  --brand-700: #2536ad;
  --accent:    #12b886;
  --accent-600:#0ca678;

  /* Neutrals */
  --bg:        #f6f8fc;
  --surface:   #ffffff;
  --surface-2: #f9fafb;
  --border:    #e6e9f0;
  --border-2:  #d8dde8;
  --text:      #1b2333;
  --text-2:    #4a5468;
  --text-3:    #8a93a6;

  /* State */
  --success:   #12b886;
  --success-bg:#e6f8f1;
  --danger:    #e03131;
  --danger-bg: #fdecec;
  --warning:   #f08c00;
  --warning-bg:#fff4e2;
  --info:      #1c7ed6;
  --info-bg:   #e7f1fc;

  /* Shape & motion */
  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20,30,60,.06), 0 1px 3px rgba(20,30,60,.04);
  --shadow:    0 4px 16px rgba(20,30,60,.08);
  --shadow-lg: 0 12px 40px rgba(20,30,60,.14);
  --ring:      0 0 0 3px rgba(59,91,239,.18);

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Poppins', var(--font-sans);
  --container: 1120px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; margin: 0 0 .4em; color: var(--text); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; color: var(--text-2); }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
img { max-width: 100%; display: block; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: .12em .4em; border-radius: 6px; font-size: .9em; }
kbd { font-family: var(--font-sans); font-size: .8em; background: var(--surface); border: 1px solid var(--border-2);
  border-bottom-width: 2px; border-radius: 6px; padding: .1em .45em; box-shadow: var(--shadow-sm); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }

/* ---------- App shell ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.app-header__inner {
  display: flex; align-items: center; gap: 14px;
  height: 60px; max-width: var(--container); margin: 0 auto; padding: 0 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: #fff; font-size: 15px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  box-shadow: var(--shadow-sm);
}
.brand__name b { color: var(--brand-600); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px; color: var(--text-2);
  font-weight: 500; font-size: .92rem; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--brand-50); color: var(--brand-700); }
.nav a.active { background: var(--brand-50); color: var(--brand-700); }

.header-spacer { flex: 1; }

/* User menu */
.usermenu { position: relative; }
.usermenu__btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 9px 5px 5px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; color: var(--text); font-weight: 500;
}
.usermenu__btn:hover { border-color: var(--border-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-600)); color: #fff;
  font-size: 13px; font-weight: 600; text-transform: uppercase;
}
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; display: none; z-index: 50;
}
.usermenu.open .usermenu__panel { display: block; }
.usermenu__panel a, .usermenu__panel button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border-radius: 9px; color: var(--text-2);
  background: none; border: none; font: inherit; text-align: left; cursor: pointer;
}
.usermenu__panel a:hover, .usermenu__panel button:hover { background: var(--surface-2); color: var(--text); }
.usermenu__head { padding: 8px 11px; }
.usermenu__head .name { font-weight: 600; color: var(--text); }
.usermenu__head .email { font-size: .82rem; color: var(--text-3); }
.badge-role { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); }

/* Mobile nav toggle */
.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 10px;
  width: 40px; height: 40px; cursor: pointer; color: var(--text); font-size: 16px; }

/* ---------- Layout main ---------- */
.main { padding: 26px 0 64px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin-bottom: 4px; }
.page-head .sub { color: var(--text-3); font-size: .95rem; }
.breadcrumb { font-size: .85rem; color: var(--text-3); margin-bottom: 10px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--brand-600); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card__body { padding: 20px; }
.card__head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card__head h2, .card__head h3 { margin: 0; }

/* ---------- Tool grid ---------- */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-200); }
.tool-card__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 19px; color: var(--brand-600); background: var(--brand-50);
}
.tool-card h3 { margin: 0; font-size: 1.02rem; }
.tool-card p { margin: 0; font-size: .88rem; color: var(--text-3); }
.tool-card__foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 6px; }
.tool-card a.stretched::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }

.chip { font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; }
.chip--ai { background: linear-gradient(135deg, #f3e8ff, #e7f0ff); color: #6d28d9; }
.chip--soon { background: var(--warning-bg); color: var(--warning); }
.chip--off { background: var(--danger-bg); color: var(--danger); }
.chip--ok { background: var(--success-bg); color: var(--accent-600); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { margin: 0; font-size: 1.05rem; }
.section-title .count { color: var(--text-3); font-size: .85rem; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: .92rem;
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: background .15s, box-shadow .15s, border-color .15s, transform .05s;
  text-decoration: none; line-height: 1; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-500); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-600); color: #fff; }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-600); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--border-2); color: var(--text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #c92a2a; color: #fff; }
.btn--sm { padding: 7px 11px; font-size: .82rem; border-radius: 9px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 6px; color: var(--text); }
.label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--ring); }
.input::placeholder { color: var(--text-3); }
.textarea { min-height: 120px; resize: vertical; }
.input-group { position: relative; }
.input-group .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.input-group .input { padding-left: 40px; }
.field__error { color: var(--danger); font-size: .8rem; margin-top: 5px; }
.field__hint { color: var(--text-3); font-size: .8rem; margin-top: 5px; }
.input.has-error, .select.has-error { border-color: var(--danger); }
.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: .9rem; color: var(--text-2); }
.checkbox input { width: 17px; height: 17px; accent-color: var(--brand-500); }
.form-row { display: grid; gap: 14px; }
@media (min-width: 620px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Flash / alerts ---------- */
.flash-stack { position: fixed; top: 74px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.alert {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px;
  border-radius: var(--radius-sm); border: 1px solid; box-shadow: var(--shadow);
  background: var(--surface); animation: slideIn .25s ease;
  font-size: .9rem;
}
.alert i { margin-top: 1px; }
.alert--success { border-color: #b2f2d7; background: var(--success-bg); color: #0b7a55; }
.alert--error   { border-color: #ffc9c9; background: var(--danger-bg);  color: #c92a2a; }
.alert--info    { border-color: #c5ddff; background: var(--info-bg);    color: #1864ab; }
.alert--warning { border-color: #ffe2b8; background: var(--warning-bg); color: #b5630a; }
.alert__close { margin-left: auto; background: none; border: none; cursor: pointer; color: inherit; opacity: .6; }
.alert__close:hover { opacity: 1; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { font-weight: 600; color: var(--text-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }

.pill { font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; display: inline-block; }
.pill--active { background: var(--success-bg); color: var(--accent-600); }
.pill--disabled { background: var(--danger-bg); color: var(--danger); }
.pill--user { background: var(--surface-2); color: var(--text-2); }
.pill--admin { background: var(--info-bg); color: var(--info); }
.pill--superadmin { background: #f3e8ff; color: #6d28d9; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.stat .k { font-size: .8rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .v { font-size: 1.7rem; font-weight: 700; font-family: var(--font-head); color: var(--text); }

/* ---------- Auth screen ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--brand-50), var(--bg) 60%); }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 30px 26px; }
.auth-card .brand { justify-content: center; margin-bottom: 6px; }
.auth-card h1 { text-align: center; font-size: 1.35rem; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--text-3); font-size: .9rem; margin-bottom: 22px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--text-3); font-size: .82rem; }
.cf-turnstile { margin: 4px 0 16px; display: flex; justify-content: center; }

/* ---------- Empty / coming soon ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty .ico { font-size: 40px; color: var(--brand-300); margin-bottom: 12px; }

/* ---------- Tool: dropzone & upload ---------- */
.dropzone {
  border: 2px dashed var(--border-2); border-radius: var(--radius); padding: 34px 20px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
  background: var(--surface-2);
}
.dropzone:hover, .dropzone:focus { border-color: var(--brand-400); background: var(--brand-50); outline: none; }
.dropzone--over { border-color: var(--brand-500); background: var(--brand-50); }
.dropzone__icon { font-size: 30px; color: var(--brand-400); margin-bottom: 8px; }
.dropzone__text { color: var(--text-2); }
.dropzone__hint { color: var(--text-3); font-size: .82rem; margin-top: 6px; }

.file-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); }
.file-item__icon { color: var(--brand-500); }
.file-item__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.file-item__size { font-size: .82rem; }
.file-item__remove { background: none; border: none; color: var(--text-3); cursor: pointer; padding: 4px; }
.file-item__remove:hover { color: var(--danger); }

.options-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; margin: 18px 0; }
.option-block { min-width: 160px; }

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 3px; gap: 3px; }
.segmented__item { position: relative; padding: 7px 16px; border-radius: 8px; cursor: pointer;
  font-weight: 600; font-size: .85rem; color: var(--text-2); }
.segmented__item input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented__item:has(input:checked) { background: var(--brand-500); color: #fff; box-shadow: var(--shadow-sm); }

.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: var(--border-2); outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-500); cursor: pointer; box-shadow: var(--shadow-sm); border: 2px solid #fff; }
.slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--brand-500);
  cursor: pointer; border: 2px solid #fff; }

.result-summary { background: var(--brand-50); color: var(--brand-700); border-radius: var(--radius-sm);
  padding: 11px 14px; margin-bottom: 14px; font-size: .9rem; }
.result-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.result-row:last-child { border-bottom: none; }
.result-row__name { font-weight: 500; flex: 1; min-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-row__meta { font-size: .84rem; }
.badge { font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.saved-pos { background: var(--success-bg); color: var(--accent-600); }
.saved-neg { background: var(--warning-bg); color: var(--warning); }

/* ---------- Tool: score bar & check rows ---------- */
.score-bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.score-bar__fill { height: 100%; width: 0; border-radius: 999px; transition: width .5s ease; }
.score-bar__fill.is-good { background: linear-gradient(90deg, var(--accent), var(--accent-600)); }
.score-bar__fill.is-mid  { background: linear-gradient(90deg, #ffd43b, var(--warning)); }
.score-bar__fill.is-bad  { background: linear-gradient(90deg, #ff8787, var(--danger)); }

.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--border); }
.check-row:last-child { border-bottom: none; }
.check-row i { margin-top: 2px; font-size: 1.05rem; }
.check-row__key { font-weight: 600; }
.check-row__detail { font-size: .86rem; }

.mx-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mx-list code { background: var(--surface-2); border: 1px solid var(--border); padding: 5px 10px; border-radius: 8px; }

/* ---------- Tool: generic output / code panels ---------- */
.io-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .io-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.code-area { width: 100%; min-height: 180px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .85rem; line-height: 1.5; padding: 12px 14px; border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); resize: vertical; }
.code-area:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--ring); }
.tool-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tool-tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--text-2); }
.tool-tab:hover { border-color: var(--border-2); }
.tool-tab.active { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }
.tool-panel { display: none; }
.tool-panel.active { display: block; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.copy-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text);
  color: #fff; padding: 9px 16px; border-radius: 999px; font-size: .85rem; opacity: 0; transition: opacity .2s; z-index: 70; }
.copy-toast.show { opacity: 1; }
.swatch { width: 100%; height: 64px; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ---------- Tool: report chips, kv tables, dns ---------- */
.report-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.rchip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
  font-size: .84rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface); }
.rchip--ok { background: var(--success-bg); color: var(--accent-600); border-color: #b2f2d7; }
.rchip--bad { background: var(--danger-bg); color: var(--danger); border-color: #ffc9c9; }
.rchip--info { background: var(--info-bg); color: var(--info); border-color: #c5ddff; }
.rchip--muted { background: var(--surface-2); color: var(--text-3); }

table.kv { width: 100%; border-collapse: collapse; }
table.kv th { text-align: left; font-weight: 600; color: var(--text-3); font-size: .82rem; padding: 7px 12px 7px 0;
  white-space: nowrap; vertical-align: top; width: 38%; }
table.kv td { padding: 7px 0; border-bottom: 1px solid var(--border); word-break: break-word; }
table.kv tr:last-child td, table.kv tr:last-child th { border-bottom: none; }

.dns-list { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.dns-row { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; padding: 7px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; word-break: break-all; }

.ai-card { border-color: #e9d8fd; }
.ai-output { white-space: pre-wrap; line-height: 1.6; font-size: .92rem; }

/* ---------- Tool: metrics (speed) ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .metric-grid { grid-template-columns: repeat(4, 1fr); } }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.metric .v { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; }
.metric .k { font-size: .76rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.metric .v.good { color: var(--accent-600); } .metric .v.mid { color: var(--warning); } .metric .v.bad { color: var(--danger); }

.grade { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; color: #fff; margin: 0 auto; }
.grade.A { background: var(--accent); } .grade.B { background: #74b816; }
.grade.C { background: var(--warning); } .grade.D { background: #e8590c; } .grade.F { background: var(--danger); }

/* ---------- Tool: SEO premium report ---------- */
.seo-hero { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 820px) { .seo-hero { grid-template-columns: 270px 1fr; } }
.gauge { display: block; margin: 0 auto; }
.gauge circle { transition: stroke-dashoffset 1s ease; }

.catbar { display: flex; align-items: center; gap: 12px; margin: 9px 0; }
.catbar__label { width: 130px; font-size: .85rem; font-weight: 500; flex-shrink: 0; }
.catbar__label i { margin-right: 5px; }
.catbar__track { flex: 1; height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.catbar__fill { height: 100%; border-radius: 999px; transition: width .6s ease; }
.catbar__val { width: 38px; text-align: right; font-weight: 600; font-size: .82rem; }

.serp { max-width: 600px; }
.serp__url { color: #006621; font-size: .8rem; }
.serp__title { color: #1a0dab; font-size: 1.15rem; line-height: 1.3; margin: 2px 0; }
.serp__title:hover { text-decoration: underline; cursor: pointer; }
.serp__desc { color: #4d5156; font-size: .88rem; line-height: 1.45; }

.kwbar { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.kwbar__word { width: 90px; font-size: .85rem; font-weight: 500; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kwbar__track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.kwbar__fill { height: 100%; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); border-radius: 999px; }
.kwbar__val { width: 74px; text-align: right; font-size: .78rem; color: var(--text-3); }

.outline { font-size: .88rem; }
.outline__row { padding: 4px 0; border-bottom: 1px solid var(--border); }
.outline__row:last-child { border-bottom: none; }
.outline__tag { display: inline-block; min-width: 26px; font-size: .7rem; font-weight: 700; color: var(--brand-600);
  background: var(--brand-50); border-radius: 5px; padding: 1px 5px; margin-right: 8px; }

/* ---------- Tool: YouTube ---------- */
.yt-media { display: flex; gap: 18px; flex-wrap: wrap; }
.yt-thumb { width: 100%; max-width: 320px; border-radius: var(--radius); border: 1px solid var(--border); object-fit: cover; }
.yt-meta { flex: 1; min-width: 240px; }

.dl-overlay { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center;
  background: rgba(20,30,60,.45); backdrop-filter: blur(3px); padding: 20px; }
.dl-overlay.show { display: flex; animation: fadeIn .15s ease; }
.dl-overlay__box { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 30px 28px; max-width: 380px; width: 100%; text-align: center; }
.dl-overlay__box h3 { margin: 6px 0 8px; }
.dl-overlay__box p { font-size: .88rem; }
.dl-spinner { font-size: 36px; color: var(--brand-500); margin-bottom: 6px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Print (SEO report) ---------- */
@media print {
  .app-header, .app-footer, .breadcrumb, form, .ai-card .card__head button, .menu-toggle, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .main { padding: 0; }
}

/* ---------- Footer ---------- */
.app-footer { border-top: 1px solid var(--border); padding: 22px 0; color: var(--text-3); font-size: .84rem; }
.app-footer .container { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; }

/* ---------- Utilities ---------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.muted { color: var(--text-3); }
.text-sm { font-size: .85rem; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }

/* ---------- Responsive ---------- */
@media (min-width: 560px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  body { font-size: 15.5px; }
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .menu-toggle { display: inline-grid; place-items: center; }
  .nav {
    position: fixed; inset: 60px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--border); margin: 0;
    padding: 10px 14px 16px; gap: 2px; box-shadow: var(--shadow); display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
  .flash-stack { left: 12px; right: 12px; max-width: none; }
}
