/* ── Reset & base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple-50:  #EAF0FF;
  --purple-100: #C8D9FF;
  --purple-200: #95B4FC;
  --purple-400: #3B6FE8;
  --purple-500: #1A4FCC;
  --purple-600: #1340AF;
  --purple-700: #0E3090;

  --gray-50:  #F8F8F7;
  --gray-100: #F1F0EC;
  --gray-200: #E4E3DE;
  --gray-300: #CCCAC2;
  --gray-500: #888780;
  --gray-700: #444441;
  --gray-900: #1A1A19;

  --green-100: #EAF3DE;
  --green-600: #3B6D11;
  --green-700: #27500A;

  --red-100:  #FCEBEB;
  --red-500:  #E24B4A;
  --red-600:  #A32D2D;

  --amber-100: #FAEEDA;
  --amber-500: #EF9F27;
  --amber-600: #854F0B;

  --blue-100: #E6F1FB;
  --blue-600: #185FA5;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --transition: 150ms ease;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-900);
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

img { max-width: 100%; display: block; }

/* ── Typography ────────────────────────────────────────────────── */
h1 { font-size: 2.25rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
h2 { font-size: 1.5rem;  font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1rem;  font-weight: 600; }
p  { color: var(--gray-700); }

/* ── Layout ────────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 640px; }
.container-md { max-width: 820px; }
main { flex: 1; }

/* ── Navigation ────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
}

.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}

.nav__logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.0625rem; font-weight: 600; color: var(--gray-900);
  text-decoration: none;
}

.nav__logo-icon {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: var(--purple-500); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
}

.nav__links {
  display: flex; align-items: center; gap: 28px;
  list-style: none;
}

.nav__links a {
  font-size: .875rem; color: var(--gray-700);
  transition: color var(--transition);
}
.nav__links a:hover { color: var(--gray-900); text-decoration: none; }

.nav__actions { display: flex; align-items: center; gap: 10px; }

.nav__badge {
  font-size: .75rem; font-weight: 500;
  background: var(--purple-50); color: var(--purple-700);
  padding: 3px 10px; border-radius: 20px;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 20px; border-radius: var(--radius-md);
  font-family: var(--font); font-size: .875rem; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
  white-space: nowrap; text-decoration: none;
  -webkit-user-select: none; user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active { opacity: .88; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--purple-500); color: #fff; border-color: var(--purple-500); }
.btn-primary:hover { background: var(--purple-600); border-color: var(--purple-600); color: #fff; }

.btn-secondary { background: #fff; color: var(--gray-900); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-500); }

.btn-ghost { background: transparent; color: var(--gray-700); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-danger { background: #fff; color: var(--red-600); border-color: #F09595; }
.btn-danger:hover { background: var(--red-100); }

.btn-sm { padding: 6px 14px; font-size: .8125rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-full { width: 100%; }

.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

label {
  font-size: .8125rem; font-weight: 500; color: var(--gray-700);
}

.input, input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="url"], input[type="number"], textarea, select {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--gray-300); border-radius: var(--radius-md);
  font-family: var(--font); font-size: .9375rem; color: var(--gray-900);
  background: #fff; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.input:hover, input[type="text"]:hover, input[type="email"]:hover,
input[type="password"]:hover { border-color: var(--gray-500); }

.input:focus, input:focus, textarea:focus, select:focus {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(26,79,204,.15);
}

textarea { resize: vertical; min-height: 120px; }

.input-hint { font-size: .8125rem; color: var(--gray-500); }
.input-error { font-size: .8125rem; color: var(--red-600); }

.input--error { border-color: #F09595 !important; }
.input--error:focus { box-shadow: 0 0 0 3px rgba(226,75,74,.15) !important; }

.form-divider {
  display: flex; align-items: center; gap: 14px;
  color: var(--gray-500); font-size: .8125rem;
  margin: 20px 0;
}
.form-divider::before, .form-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 24px;
}
.card-sm { padding: 16px; border-radius: var(--radius-md); }
.card-hover { transition: border-color var(--transition), box-shadow var(--transition); }
.card-hover:hover { border-color: var(--gray-300); box-shadow: var(--shadow-sm); }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; font-weight: 500;
  padding: 3px 10px; border-radius: 20px;
}
.badge-purple { background: var(--purple-50); color: var(--purple-700); }
.badge-green  { background: var(--green-100); color: var(--green-700); }
.badge-amber  { background: var(--amber-100); color: var(--amber-600); }
.badge-red    { background: var(--red-100);   color: var(--red-600); }
.badge-gray   { background: var(--gray-100);  color: var(--gray-700); }
.badge-blue   { background: var(--blue-100);  color: var(--blue-600); }

/* ── Alerts / Flash ─────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-radius: var(--radius-md);
  font-size: .9rem; border: 1px solid transparent;
  margin-bottom: 20px;
}
.alert-success { background: var(--green-100); border-color: #C0DD97; color: var(--green-600); }
.alert-error   { background: var(--red-100);   border-color: #F7C1C1; color: var(--red-600); }
.alert-warning { background: var(--amber-100); border-color: #FAC775; color: var(--amber-600); }
.alert-info    { background: var(--blue-100);  border-color: #B5D4F4; color: var(--blue-600); }
.alert__close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: inherit; opacity: .6; font-size: 1.1rem; line-height: 1; padding: 0 2px;
}
.alert__close:hover { opacity: 1; }

/* ── Legal pages ────────────────────────────────────────────────── */
.legal-hero {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 56px 0 40px;
}
.legal-body { max-width: 100%; }
.legal-body h2 {
  font-size: 1.125rem; font-weight: 600; color: var(--gray-900);
  margin: 40px 0 12px; padding-top: 8px;
  border-top: 1px solid var(--gray-200);
}
.legal-body h3 {
  font-size: .9375rem; font-weight: 600; color: var(--gray-900);
  margin: 24px 0 8px;
}
.legal-body p, .legal-body li { line-height: 1.75; color: var(--gray-700); }
.legal-body ul { padding-left: 20px; margin: 0 0 16px; }
.legal-body li { margin-bottom: 6px; }
.legal-table {
  width: 100%; border-collapse: collapse; font-size: .875rem;
  margin: 12px 0 24px;
}
.legal-table th {
  text-align: left; padding: 10px 14px; font-weight: 600; font-size: .8125rem;
  color: var(--gray-500); background: var(--gray-50);
  border: 1px solid var(--gray-200); text-transform: uppercase; letter-spacing: .04em;
}
.legal-table td {
  padding: 10px 14px; border: 1px solid var(--gray-200); color: var(--gray-700);
  vertical-align: top;
}
.legal-table code {
  font-family: var(--font-mono, monospace); font-size: .8125rem;
  background: var(--gray-100); padding: 2px 6px; border-radius: 4px;
}

/* ── Contact page ────────────────────────────────────────────────── */
.contact-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: 24px; text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.contact-card:hover {
  border-color: var(--purple-400); box-shadow: 0 4px 16px rgba(26,79,204,.08);
}
.contact-card__icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.contact-card__title { font-weight: 600; color: var(--gray-900); margin: 0 0 2px; font-size: .9375rem; }
.contact-card__email { color: var(--purple-500); font-size: .875rem; margin: 0 0 6px; font-weight: 500; }
.contact-card__desc  { color: var(--gray-500); font-size: .8125rem; margin: 0; line-height: 1.5; }
@media (max-width: 640px) {
  .contact-card { grid-column: span 2; }
}

/* ── Cookie banner ───────────────────────────────────────────────── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  transform: translateY(100%); transition: transform .3s ease;
  background: var(--gray-900); color: #fff;
  box-shadow: 0 -4px 24px rgba(0,0,0,.18);
}
.cookie-banner--visible { transform: translateY(0); }
.cookie-banner__inner {
  max-width: 1200px; margin: 0 auto; padding: 18px 24px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.cookie-banner__text { flex: 1; min-width: 260px; }
.cookie-banner__text p { margin: 0; font-size: .9375rem; color: rgba(255,255,255,.9); line-height: 1.5; }
.cookie-banner__text a { color: #7EB8FF; text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-banner__actions .btn-secondary {
  background: transparent; border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.8);
}
.cookie-banner__actions .btn-secondary:hover {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.5); color: #fff;
}

/* ── Footer ─────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--gray-200);
  padding: 28px 0;
  margin-top: auto;
}
.footer__inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer__copy { font-size: .8125rem; color: var(--gray-500); }
.footer__links { display: flex; gap: 20px; }
.footer__links a { font-size: .8125rem; color: var(--gray-500); }
.footer__links a:hover { color: var(--gray-700); text-decoration: none; }

/* ── Hero section ───────────────────────────────────────────────── */
.hero {
  padding: 88px 0 72px;
  text-align: center;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8125rem; font-weight: 500;
  background: var(--purple-50); color: var(--purple-700);
  padding: 5px 14px; border-radius: 20px;
  margin-bottom: 22px;
  border: 1px solid var(--purple-100);
}
.hero h1 { margin-bottom: 16px; }
.hero h1 span { color: var(--purple-500); }
.hero__sub {
  font-size: 1.0625rem; color: var(--gray-700);
  max-width: 520px; margin: 0 auto 32px;
  line-height: 1.7;
}
.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero__stats {
  display: flex; justify-content: center; gap: 40px;
  margin-top: 52px; padding-top: 40px;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.hero__stat-n { font-size: 1.75rem; font-weight: 600; color: var(--gray-900); }
.hero__stat-l { font-size: .8125rem; color: var(--gray-500); margin-top: 2px; }

/* ── Section ────────────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section--gray { background: var(--gray-50); }
.section__header { text-align: center; margin-bottom: 48px; }
.section__eyebrow {
  font-size: .8125rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .06em; color: var(--purple-500); margin-bottom: 10px;
}
.section__title { margin-bottom: 12px; }
.section__sub { font-size: 1.0625rem; color: var(--gray-700); max-width: 540px; margin: 0 auto; }

/* ── Category cards ─────────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.cat-card {
  display: block; padding: 24px 20px;
  border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  background: #fff; text-decoration: none; color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.cat-card:hover {
  border-color: var(--purple-100); box-shadow: var(--shadow-md);
  transform: translateY(-2px); text-decoration: none;
}
.cat-card__icon { font-size: 1.75rem; margin-bottom: 12px; line-height: 1; }
.cat-card__name { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.cat-card__count { font-size: .8125rem; color: var(--gray-500); margin-bottom: 14px; }
.cat-card__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.cat-card__tag {
  font-size: .75rem; background: var(--gray-100);
  color: var(--gray-700); padding: 2px 9px; border-radius: 4px;
}

/* ── Tools page hero ─────────────────────────────────────────────── */
.tools-hero {
  background: linear-gradient(135deg, #080e2e 0%, #0d1e52 50%, #1340af 100%);
  padding: 64px 0 48px; color: #fff;
}
.tools-hero__content { text-align: center; margin-bottom: 40px; }
.tools-hero__title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; margin-bottom: 12px; }
.tools-hero__subtitle { font-size: 1.0625rem; color: rgba(255,255,255,.7); margin-bottom: 24px; }
.tools-hero__cta { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.tools-hero__cta .text-muted { color: rgba(255,255,255,.55); }
.tools-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.tools-stat {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg); padding: 16px 12px; text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
  color: #fff;
}
.tools-stat:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.25); text-decoration: none; }
.tools-stat__icon { color: var(--cat-color, #fff); }
.tools-stat__label { font-size: .8125rem; font-weight: 500; text-align: center; }
.tools-stat__count { font-size: .75rem; color: rgba(255,255,255,.5); }

/* ── Tools toolbar ───────────────────────────────────────────────── */
.tools-toolbar {
  position: sticky; top: 0; z-index: 40;
  background: #fff; border-bottom: 1px solid var(--gray-200);
  padding: 12px 0; box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.tools-toolbar__inner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.tools-search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.tools-search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--gray-500); pointer-events: none;
}
.tools-search {
  width: 100%; padding: 8px 12px 8px 34px;
  border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  font-size: .875rem; background: var(--gray-50);
}
.tools-search:focus { outline: none; border-color: var(--purple-500); background: #fff; }
.tools-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.tools-filter {
  padding: 6px 12px; font-size: .8125rem; font-weight: 500;
  border: 1px solid var(--gray-200); border-radius: 999px;
  background: #fff; cursor: pointer; color: var(--gray-700);
  transition: all var(--transition);
}
.tools-filter:hover { border-color: var(--purple-500); color: var(--purple-500); }
.tools-filter.active { background: var(--purple-500); border-color: var(--purple-500); color: #fff; }
.tools-filter__count {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.25); border-radius: 999px;
  padding: 0 5px; font-size: .7rem; margin-left: 4px; min-width: 18px; height: 16px;
}
.tools-filter:not(.active) .tools-filter__count { background: var(--gray-100); color: var(--gray-500); }

/* ── Category sections ───────────────────────────────────────────── */
.tools-body { padding-top: 40px; padding-bottom: 60px; }
.cat-section { margin-bottom: 52px; }
.cat-section__header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
  padding-bottom: 14px; border-bottom: 1px solid var(--gray-200);
}
.cat-section__icon { display: flex; }
.cat-section__title { font-size: 1.125rem; font-weight: 600; flex: 1; }
.cat-section__badge {
  font-size: .75rem; font-weight: 500; color: var(--gray-500);
  background: var(--gray-100); padding: 2px 8px; border-radius: 999px;
}

/* ── Tool grid ──────────────────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.tool-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px; border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  background: #fff; cursor: pointer; text-decoration: none; color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
}
.tool-card:hover {
  border-color: var(--purple-500); box-shadow: 0 4px 12px rgba(26,79,204,.12);
  transform: translateY(-1px); text-decoration: none;
}
.tool-card__icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.tool-card__body { flex: 1; min-width: 0; }
.tool-card__name { font-size: .9rem; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.tool-card__desc { font-size: .8125rem; color: var(--gray-500); line-height: 1.45; }
.tool-card__lock {
  position: absolute; top: 10px; right: 10px;
  color: var(--gray-300); flex-shrink: 0;
}

/* ── Pricing ────────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: start;
}
.pricing-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.pricing-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1100px) {
  .pricing-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .pricing-grid--3, .pricing-grid--4 { grid-template-columns: 1fr; }
}
.pricing-card {
  border: 1px solid var(--gray-200); border-radius: var(--radius-xl);
  padding: 28px 24px; background: #fff; position: relative;
}
.pricing-card--featured {
  border: 2px solid var(--purple-500);
  box-shadow: 0 0 0 4px rgba(26,79,204,.07);
}
.pricing-card--active {
  border: 2px solid var(--green-600);
  box-shadow: 0 0 0 4px rgba(59,109,17,.08);
}
.pricing-card--featured.pricing-card--active {
  border-color: var(--green-600);
}
.pricing-card__current {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--green-600); color: #fff;
  font-size: .75rem; font-weight: 600;
  padding: 3px 14px; border-radius: 20px; white-space: nowrap;
}
.pricing-card__popular {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--purple-500); color: #fff;
  font-size: .75rem; font-weight: 500;
  padding: 4px 14px; border-radius: 20px; white-space: nowrap;
}
.pricing-card__plan { font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); margin-bottom: 8px; }
.pricing-card__price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.pricing-card__price-main { font-size: 2.5rem; font-weight: 600; letter-spacing: -.03em; color: var(--gray-900); }
.pricing-card__price-period { font-size: .9375rem; color: var(--gray-500); }
.pricing-card__price-note { font-size: .8125rem; color: var(--gray-500); margin-bottom: 20px; min-height: 20px; }
.pricing-card__divider { height: 1px; background: var(--gray-200); margin: 20px 0; }
.pricing-card__features { list-style: none; display: flex; flex-direction: column; gap: 11px; margin-bottom: 24px; }
.pricing-card__features li { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; }
.pricing-card__features li .check { color: #3B6D11; font-size: .875rem; flex-shrink: 0; margin-top: 2px; }
.pricing-card__features li .cross { color: var(--gray-300); font-size: .875rem; flex-shrink: 0; margin-top: 2px; }

/* ── Auth pages ─────────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
  background: var(--gray-50);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl); padding: 36px 32px;
}
.auth-card__logo {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; font-size: 1.0625rem; font-weight: 600;
  color: var(--gray-900); margin-bottom: 24px; text-decoration: none;
}
.auth-card__title { font-size: 1.375rem; font-weight: 600; margin-bottom: 6px; text-align: center; }
.auth-card__sub { font-size: .875rem; color: var(--gray-500); text-align: center; margin-bottom: 28px; }

.btn-google {
  width: 100%; padding: 10px 20px;
  border: 1px solid var(--gray-300); border-radius: var(--radius-md);
  background: #fff; font-family: var(--font); font-size: .9rem; font-weight: 500;
  color: var(--gray-900); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background var(--transition), border-color var(--transition);
}
.btn-google:hover { background: var(--gray-50); border-color: var(--gray-500); }

.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Dashboard ──────────────────────────────────────────────────── */
.dashboard { display: flex; min-height: calc(100vh - 60px); }

.sidebar {
  width: 220px; flex-shrink: 0;
  border-right: 1px solid var(--gray-200);
  padding: 24px 12px;
  background: var(--gray-50);
}
.sidebar__label {
  font-size: .6875rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--gray-500);
  padding: 0 12px; margin-bottom: 8px; margin-top: 20px;
}
.sidebar__label:first-child { margin-top: 0; }
.sidebar__link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: .875rem; color: var(--gray-700); text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.sidebar__link:hover { background: var(--gray-200); color: var(--gray-900); text-decoration: none; }
.sidebar__link.active { background: var(--purple-50); color: var(--purple-600); font-weight: 500; }
.sidebar__link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.sidebar__coin-badge {
  margin-left: auto; background: #1d4ed8; color: #fff;
  font-size: .65rem; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  letter-spacing: .02em;
}

.dash-main { flex: 1; padding: 32px; overflow-x: hidden; }

/* ── Dashboard welcome ──────────────────────────────────────────── */
.dash-welcome {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.dash-welcome h1 { font-size: 1.375rem; font-weight: 600; margin-bottom: 4px; }
.dash-welcome p  { font-size: .9rem; color: var(--gray-500); }

/* ── Stat cards ─────────────────────────────────────────────────── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.dstat {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.dstat__icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dstat__icon--purple { background: var(--purple-50); color: var(--purple-600); }
.dstat__icon--blue   { background: #E8F1FB; color: #185FA5; }
.dstat__icon--green  { background: #EAF3DE; color: #3B6D11; }
.dstat__icon--amber  { background: #FEF3DA; color: #854F0B; }
.dstat__body { flex: 1; min-width: 0; }
.dstat__label { font-size: .75rem; color: var(--gray-500); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.dstat__value { font-size: 1.5rem; font-weight: 600; color: var(--gray-900); line-height: 1.2; }
.dstat__sub   { font-size: .875rem; color: var(--gray-500); font-weight: 400; }
.dstat__bar   { height: 4px; background: var(--gray-200); border-radius: 2px; overflow: hidden; margin: 8px 0 4px; }
.dstat__bar-fill { height: 100%; border-radius: 2px; transition: width .4s ease; }
.dstat__hint  { font-size: .75rem; color: var(--gray-500); }

/* ── Section header ─────────────────────────────────────────────── */
.dash-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.dash-section-header h2 { font-size: 1rem; font-weight: 600; }
.dash-section-link { font-size: .875rem; color: var(--purple-500); text-decoration: none; }
.dash-section-link:hover { text-decoration: underline; }

/* ── Quick-access grid ──────────────────────────────────────────── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.qcard {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 16px 18px;
  text-decoration: none; color: inherit;
  transition: border-color 150ms, box-shadow 150ms;
}
.qcard:hover { border-color: var(--purple-500); box-shadow: 0 0 0 3px var(--purple-50); }
.qcard__icon {
  width: 40px; height: 40px; background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--purple-600);
}
.qcard__body { flex: 1; min-width: 0; }
.qcard__name { font-size: .9rem; font-weight: 500; color: var(--gray-900); margin-bottom: 2px; }
.qcard__desc { font-size: .8rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qcard__arrow { color: var(--gray-300); flex-shrink: 0; transition: color 150ms; }
.qcard:hover .qcard__arrow { color: var(--purple-500); }

/* ── Upgrade banner ─────────────────────────────────────────────── */
.dash-upgrade-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(135deg, var(--purple-50) 0%, #EBF2FF 100%);
  border: 1px solid var(--purple-100); border-radius: var(--radius-lg);
  padding: 20px 24px; margin-top: 4px;
}
.dash-upgrade-banner__body { display: flex; align-items: center; gap: 14px; }
.dash-upgrade-banner__icon {
  width: 42px; height: 42px; background: var(--purple-500); color: #fff;
  border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dash-upgrade-banner strong { font-size: .9375rem; display: block; margin-bottom: 3px; color: var(--gray-900); }
.dash-upgrade-banner p { font-size: .8375rem; color: var(--gray-700); }

/* legacy — keep for tool pages */
.dash-header { margin-bottom: 28px; }
.dash-header__title { font-size: 1.375rem; font-weight: 600; margin-bottom: 4px; }
.dash-header__sub { font-size: .9rem; color: var(--gray-500); }
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 32px;
}
.stat-card { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 18px; }
.stat-card__label { font-size: .8125rem; color: var(--gray-500); margin-bottom: 6px; }
.stat-card__value { font-size: 1.75rem; font-weight: 600; color: var(--gray-900); line-height: 1; }
.stat-card__sub { font-size: .8125rem; color: var(--gray-500); margin-top: 4px; }
.usage-bar { height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.usage-bar__fill { height: 100%; background: var(--purple-500); border-radius: 3px; transition: width .4s ease; }
.usage-bar__fill--warning { background: #EF9F27; }
.usage-bar__fill--danger  { background: #E24B4A; }

/* ── Tool disclaimer ────────────────────────────────────────────── */
.tool-card__premium-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .7rem; font-weight: 600; color: var(--purple-600);
  background: var(--purple-50); border: 1px solid var(--purple-100);
  border-radius: 999px; padding: 2px 7px; margin-top: 4px;
}

/* ── Tool disclaimer ────────────────────────────────────────────── */
.tool-disclaimer {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--blue-100); border: 1px solid #C5DCF5;
  border-radius: var(--radius-md); padding: 10px 14px;
  font-size: .8125rem; color: #185FA5; margin-bottom: 20px; line-height: 1.5;
}
.tool-disclaimer svg { flex-shrink: 0; margin-top: 1px; }
.tool-disclaimer--warn {
  background: #FEF3DA; border-color: #FAC775; color: #854F0B;
}

/* ── Tool page ──────────────────────────────────────────────────── */
.tool-wrap { max-width: 820px; margin: 40px auto; padding: 0 24px; }
.tool-header { margin-bottom: 28px; }
.tool-header__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .875rem; color: var(--gray-500); margin-bottom: 16px;
  cursor: pointer; background: none; border: none; padding: 0;
  transition: color var(--transition);
}
.tool-header__back:hover { color: var(--gray-900); }
.tool-header__title { font-size: 1.5rem; font-weight: 600; margin-bottom: 6px; }
.tool-header__desc { font-size: .9375rem; color: var(--gray-700); }

.tool-body { display: grid; gap: 20px; }

.tool-output {
  border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: 20px; min-height: 120px;
  font-family: var(--font-mono); font-size: .875rem;
  background: var(--gray-50); white-space: pre-wrap; word-break: break-all;
}
.tool-output--hidden { display: none; }

/* ── Credit banner ──────────────────────────────────────────────── */
.credit-banner {
  background: var(--amber-100); border: 1px solid #FAC775;
  border-radius: var(--radius-md); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: .875rem; color: var(--amber-600);
  margin-bottom: 24px;
}

/* ── Upgrade modal overlay ──────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: #fff; border-radius: var(--radius-xl);
  padding: 36px 32px; max-width: 440px; width: 100%;
  border: 1px solid var(--gray-200);
}
.modal__title { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; }
.modal__sub { font-size: .9375rem; color: var(--gray-700); margin-bottom: 24px; }
.modal__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Table ──────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  text-align: left; font-size: .8125rem; font-weight: 500;
  color: var(--gray-500); padding: 11px 16px;
  background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-900); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }

/* ── Spinner ────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  animation: spin .6s linear infinite;
  display: none;
}
.spinner--purple { border-color: rgba(26,79,204,.2); border-top-color: var(--purple-500); }
.btn--loading .spinner { display: block; }
.btn--loading .btn__text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utilities ──────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .8125rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Tool page layout ───────────────────────────────────────────── */
.tool-page { max-width: 860px; }
.tool-page__header { margin-bottom: 28px; }
.tool-page__breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: .8125rem; color: var(--gray-500); margin-bottom: 10px;
}
.tool-page__breadcrumb a { color: var(--purple-500); text-decoration: none; }
.tool-page__breadcrumb a:hover { text-decoration: underline; }
.tool-page__title { font-size: 1.5rem; font-weight: 700; }
.tool-page__subtitle { font-size: .9375rem; color: var(--gray-500); margin-top: 4px; }

/* Tool form area */
.tool-form { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.tool-form__label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 6px; }
.tool-result { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 24px; min-height: 120px; }
.tool-result__empty { color: var(--gray-500); font-size: .875rem; text-align: center; padding: 24px 0; }

/* ── Skeleton loader ────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton-line {
  height: 14px; border-radius: 6px; margin-bottom: 10px;
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
}
.skeleton-line--short { width: 45%; }
.skeleton-line--med   { width: 70%; }
.skeleton-line--full  { width: 100%; }
.skeleton-line--tall  { height: 20px; }

/* Coming soon state */
.tool-coming-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 64px 32px;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
}
.tool-coming-soon__icon { font-size: 3rem; margin-bottom: 16px; }
.tool-coming-soon h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; }
.tool-coming-soon p { color: var(--gray-500); margin-bottom: 24px; }

/* ── Nav credits ─────────────────────────────────────────────────── */
.nav-credits {
  display: flex; align-items: center; gap: 6px;
  font-size: .8125rem; color: var(--gray-700);
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 999px; padding: 4px 10px;
}
.nav-credits__label { color: var(--gray-500); }
.nav-credits__upgrade {
  color: var(--purple-500); font-weight: 600; text-decoration: none;
  border-left: 1px solid var(--gray-200); padding-left: 8px; margin-left: 2px;
}
.nav-credits__upgrade:hover { text-decoration: underline; }
.nav-credits__divider { color: var(--gray-300); }
.nav-credits__coins {
  display: flex; align-items: center; gap: 4px;
  color: var(--amber-600, #d97706); font-weight: 600; text-decoration: none;
}
.nav-credits__coins:hover { text-decoration: underline; }
.nav-credits__coins .nav-credits__label { color: var(--amber-500, #f59e0b); }

/* ── Ad block ───────────────────────────────────────────────────── */
.ad-block {
  position: relative;
  margin: 28px 0 4px;
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 90px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}
.ad-block__label {
  position: absolute; top: 6px; right: 8px;
  font-size: .65rem; color: var(--gray-400);
  text-transform: uppercase; letter-spacing: .06em;
  pointer-events: none; z-index: 1;
}
.ad-block--placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; padding: 20px;
  border-style: dashed;
}
.ad-block__dev { font-size: .8125rem; color: var(--gray-500); }

/* ── Mobile sidebar toggle button ───────────────────────────────── */
.nav__menu-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--gray-700);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.nav__menu-btn:hover { background: var(--gray-100); }
.nav__menu-btn[aria-expanded="true"] { background: var(--purple-50); color: var(--purple-600); }

/* Overlay behind open sidebar */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 39;
  background: rgba(0,0,0,.35);
}
.sidebar-overlay.open { display: block; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  .nav__links { display: none; }
  .nav__menu-btn { display: flex; align-items: center; justify-content: center; }

  /* Nav right side: shrink credits text so it doesn't overflow */
  .nav-credits__label { display: none; }
  .nav-credits { gap: 6px; font-size: .8125rem; }
  .nav-username { display: none; }

  /* Sidebar: slide in from left as a drawer */
  .sidebar {
    position: fixed; top: 60px; left: 0; bottom: 0;
    z-index: 40; width: 260px;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.14);
    overflow-y: auto;
    border-right: none;
  }
  .sidebar.open { transform: translateX(0); }

  /* Main content takes full width — sidebar is out of flow when closed */
  .dashboard { display: block; }
  .dash-main { padding: 20px 16px; width: 100%; }

  .hero { padding: 56px 0 48px; }
  .hero__stats { gap: 24px; }
  .auth-card { padding: 28px 20px; }
  .dash-stats { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .dash-welcome { flex-direction: column; align-items: flex-start; }
  .dash-upgrade-banner { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════════
   Result Card System — rc-*
   Shared output components for all tool results.
   Tools should use these classes instead of inventing per-tool CSS.
   ═══════════════════════════════════════════════════════════════════ */

.rc-wrap { display: flex; flex-direction: column; gap: 18px; }

/* ── Metrics grid ─────────────────────────────────────────────── */
.rc-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}
.rc-metric {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
}
.rc-metric--hero {
  background: var(--purple-50);
  border-color: var(--purple-100);
  grid-column: span 2;
}
.rc-metric--wide { grid-column: 1 / -1; }
.rc-metric__val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.1;
  margin-bottom: 4px;
}
.rc-metric--hero .rc-metric__val { font-size: 2.1rem; }
.rc-metric__label {
  font-size: .72rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.rc-metric__sub {
  font-size: .72rem;
  color: var(--gray-400);
  margin-top: 3px;
  font-weight: 400;
}

/* ── Score bar ────────────────────────────────────────────────── */
.rc-bar-wrap { }
.rc-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .82rem;
  color: var(--gray-700);
  margin-bottom: 7px;
  font-weight: 500;
}
.rc-bar-header span:last-child { color: var(--gray-500); font-size: .78rem; }
.rc-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.rc-bar__fill {
  height: 100%;
  border-radius: 4px;
  background: var(--purple-500);
  transition: width .5s ease;
}

/* ── Grade letter ─────────────────────────────────────────────── */
.rc-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  font-size: 1.75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.rc-grade--A  { background: #DCFCE7; color: #166534; }
.rc-grade--Ap { background: #D1FAE5; color: #065F46; }
.rc-grade--B  { background: #ECFDF5; color: #047857; }
.rc-grade--C  { background: #FEFCE8; color: #854D0E; }
.rc-grade--D  { background: #FFF7ED; color: #9A3412; }
.rc-grade--F  { background: #FEF2F2; color: #991B1B; }

/* ── Badges ───────────────────────────────────────────────────── */
.rc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}
.rc-badge--success { background: #DCFCE7; color: #166534; }
.rc-badge--warning { background: #FEFCE8; color: #854D0E; }
.rc-badge--danger  { background: #FEF2F2; color: #991B1B; }
.rc-badge--info    { background: #EFF6FF; color: #1E40AF; }
.rc-badge--neutral { background: var(--gray-100); color: var(--gray-600); }

/* ── Checklist ────────────────────────────────────────────────── */
.rc-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 5px 14px;
}
.rc-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  color: var(--gray-700);
  padding: 3px 0;
}
.rc-check__icon { width: 15px; height: 15px; flex-shrink: 0; }
.rc-check--pass .rc-check__icon { color: #16a34a; }
.rc-check--fail .rc-check__icon { color: var(--gray-300); }
.rc-check--warn .rc-check__icon { color: #d97706; }

/* ── Key-value rows ───────────────────────────────────────────── */
.rc-rows {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.rc-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: .855rem;
}
.rc-row:last-child { border-bottom: none; }
.rc-row:nth-child(even) { background: var(--gray-50); }
.rc-row__key {
  color: var(--gray-500);
  flex-shrink: 0;
  min-width: 140px;
  max-width: 180px;
  font-weight: 500;
  font-size: .8rem;
  padding-top: 1px;
}
.rc-row__val {
  color: var(--gray-900);
  flex: 1;
  word-break: break-word;
}

/* ── Code block ───────────────────────────────────────────────── */
.rc-code {
  position: relative;
  background: #1e1e2e;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.rc-code pre {
  margin: 0;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: #cdd6f4;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
.rc-code__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.rc-code__lang {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.rc-code__copy {
  background: rgba(255,255,255,.08);
  border: none;
  border-radius: 5px;
  padding: 3px 9px;
  font-size: .72rem;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: var(--font);
}
.rc-code__copy:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ── Section grouping ─────────────────────────────────────────── */
.rc-section { display: flex; flex-direction: column; gap: 8px; }
.rc-section__title {
  font-size: .72rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* ── Tips / recommendations ───────────────────────────────────── */
.rc-tips { display: flex; flex-direction: column; gap: 6px; }
.rc-tip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  line-height: 1.45;
}
.rc-tip--ok     { background: #F0FDF4; color: #14532D; border-left: 3px solid #16a34a; }
.rc-tip--warn   { background: #FFFBEB; color: #78350F; border-left: 3px solid #d97706; }
.rc-tip--danger { background: #FEF2F2; color: #7F1D1D; border-left: 3px solid #dc2626; }
.rc-tip--info   { background: #EFF6FF; color: #1E3A8A; border-left: 3px solid #3b82f6; }
.rc-tip__icon { flex-shrink: 0; width: 14px; height: 14px; margin-top: 1px; }

/* ── Table ────────────────────────────────────────────────────── */
.rc-table-wrap { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-md); }
.rc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .845rem;
}
.rc-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.rc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: top;
}
.rc-table tbody tr:last-child td { border-bottom: none; }
.rc-table tbody tr:hover td { background: var(--gray-50); }

/* ── Summary header (grade + text) ───────────────────────────── */
.rc-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}
.rc-summary__body { flex: 1; min-width: 0; }
.rc-summary__title { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); margin-bottom: 2px; }
.rc-summary__sub   { font-size: .84rem; color: var(--gray-500); }

/* ── Header row inside a result section ──────────────────────── */
.rc-hdr-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--gray-100);
}
.rc-hdr-row:last-child { border-bottom: none; padding-bottom: 0; }
.rc-hdr-row__icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; }
.rc-hdr-row__icon--ok   { color: #16a34a; }
.rc-hdr-row__icon--miss { color: var(--gray-300); }
.rc-hdr-row__body { flex: 1; min-width: 0; }
.rc-hdr-row__name { font-size: .875rem; font-weight: 600; color: var(--gray-900); margin-bottom: 2px; }
.rc-hdr-row__desc { font-size: .78rem; color: var(--gray-500); margin-bottom: 5px; }
.rc-hdr-row__val  {
  font-family: var(--font-mono);
  font-size: .76rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  word-break: break-all;
  display: inline-block;
  max-width: 100%;
}
.rc-hdr-row__miss { font-size: .78rem; color: #991B1B; font-style: italic; }

@media (max-width: 600px) {
  .rc-metrics { grid-template-columns: repeat(2, 1fr); }
  .rc-metric--hero { grid-column: 1 / -1; }
  .rc-checks { grid-template-columns: 1fr 1fr; }
  .rc-row { flex-direction: column; gap: 3px; }
  .rc-row__key { min-width: 0; max-width: 100%; }
}
