/* ==========================================================================
   أدوات الميثاق | Adawat Elmithak
   Design system — RTL first, light + dark mode, no external CSS framework.
   ========================================================================== */

:root {
  color-scheme: light;
  --navy-900: #0b1f3a;
  --navy-800: #102a4c;
  --navy-700: #16395f;
  --navy-600: #1e4a78;
  --navy-500: #2a5e92;
  --blue-500: #2f6fb5;
  --blue-400: #4a8fd0;
  --green-600: #14805c;
  --green-500: #1a9c72;
  --green-400: #2bbd8a;
  --green-100: #e3f7ef;

  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #10233d;
  --text-soft: #4a5b70;
  --text-muted: #6b7c93;
  --accent: var(--navy-700);
  --accent-soft: #e8f0fa;
  --success: #14805c;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --warning: #b7791f;

  --shadow-sm: 0 1px 2px rgba(16, 35, 61, .06), 0 1px 3px rgba(16, 35, 61, .04);
  --shadow-md: 0 4px 12px rgba(16, 35, 61, .07), 0 2px 4px rgba(16, 35, 61, .04);
  --shadow-lg: 0 14px 36px rgba(16, 35, 61, .12), 0 4px 10px rgba(16, 35, 61, .05);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --container: 1180px;
  --header-h: 68px;

  --font: "Cairo", "Tajawal", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Mono", Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1626;
  --surface: #142138;
  --surface-2: #1b2b45;
  --border: #263a56;
  --border-strong: #35506f;
  --text: #e8eef7;
  --text-soft: #b9c8db;
  --text-muted: #8ea2ba;
  --accent: #6fa8e6;
  --accent-soft: #1b2b45;
  --green-100: #12352c;
  --success: #35c295;
  --danger: #ff7b6b;
  --danger-soft: #3a1f1f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, .45);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  direction: rtl;
  text-align: right;
  transition: background .25s ease, color .25s ease;
}

h1, h2, h3, h4, h5 {
  line-height: 1.35;
  margin: 0 0 .5em;
  font-weight: 700;
  color: var(--text);
}

h1 { font-size: clamp(1.85rem, 1.2rem + 2.2vw, 3rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 1.05rem + 1.3vw, 2.1rem); font-weight: 800; }
h3 { font-size: clamp(1.12rem, .98rem + .6vw, 1.4rem); font-weight: 700; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .18s ease;
}
a:hover { color: var(--green-500); }

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

ul, ol { padding-inline-start: 1.35rem; margin: 0 0 1rem; }
li { margin-bottom: .35rem; }

code, kbd, pre { font-family: var(--mono); font-size: .92em; }

:focus-visible {
  outline: 3px solid var(--green-400);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -60px;
  background: var(--navy-700);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 200;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: saturate(180%) blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-weight: 800;
  color: var(--text);
  font-size: 1.12rem;
  flex-shrink: 0;
}
.brand:hover { color: var(--text); }

.brand-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.05rem;
  background: linear-gradient(135deg, var(--navy-700), var(--green-500));
  box-shadow: var(--shadow-sm);
}
.brand-logo {
  display: block;
  width: auto;
  height: 52px;
  max-width: 180px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 8px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 1.08rem; }
.brand-sub { font-size: .68rem; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; }

.main-nav { margin-inline-start: auto; }
.main-nav ul {
  display: flex;
  align-items: center;
  gap: .35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav li { margin: 0; }
.main-nav a {
  display: block;
  padding: .5rem .8rem;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
}
.main-nav a:hover { background: var(--surface-2); color: var(--accent); }
.main-nav a.active { color: var(--accent); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: .5rem; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  transition: all .18s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--accent); border-color: var(--border-strong); }

.nav-toggle { display: none; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .68rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn-accent {
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-accent:hover { color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn-outline {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border-strong);
}
.btn-outline:hover { background: var(--accent-soft); color: var(--accent); }

.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: .42rem .9rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 1.5rem + 4vw, 5rem) 0 clamp(2rem, 1rem + 3vw, 3.5rem);
  background:
    radial-gradient(1000px 420px at 85% -10%, rgba(26, 156, 114, .16), transparent 60%),
    radial-gradient(900px 400px at 10% -20%, rgba(47, 111, 181, .18), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--green-100);
  color: var(--success);
  border-radius: 999px;
  padding: .35rem .9rem;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero h1 { margin-bottom: .6rem; }

.hero-gradient-text {
  background: linear-gradient(120deg, var(--navy-700), var(--green-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 1.08rem;
  color: var(--text-soft);
  max-width: 42rem;
  margin-bottom: 1.5rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}
.hero-stat strong { display: block; font-size: 1.6rem; color: var(--accent); line-height: 1.2; }
.hero-stat span { font-size: .85rem; color: var(--text-muted); }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
}
.hero-card-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; font-weight: 700; }
.hero-card-head i { color: var(--green-500); }
.hero-card ul { list-style: none; padding: 0; margin: 0; }
.hero-card li {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: .92rem;
  color: var(--text-soft);
}
.hero-card li:last-child { border-bottom: 0; }
.hero-card li i { color: var(--green-500); font-size: .85rem; }

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: .3rem .3rem .3rem 1rem;
  box-shadow: var(--shadow-sm);
  max-width: 640px;
  width: 100%;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search-box:focus-within {
  border-color: var(--green-500);
  box-shadow: 0 0 0 4px rgba(26, 156, 114, .14);
}
.search-box input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  padding: .75rem .4rem;
  color: var(--text);
  outline: none;
  min-width: 0;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box .btn { flex-shrink: 0; }

.search-suggest {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + .5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 60;
  display: none;
  text-align: right;
}
.search-suggest.open { display: block; }
.search-suggest a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.search-suggest a:last-child { border-bottom: 0; }
.search-suggest a:hover { background: var(--surface-2); }
.search-suggest .icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.search-suggest .meta { font-size: .78rem; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Sections & cards
   -------------------------------------------------------------------------- */

.section { padding: clamp(2.25rem, 1.5rem + 2.5vw, 3.75rem) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { margin-bottom: 1.75rem; }
.section-head p { color: var(--text-soft); margin: 0; max-width: 60ch; }
.section-head.centered { text-align: center; }
.section-head.centered p { margin-inline: auto; }

.eyebrow {
  display: inline-block;
  color: var(--green-600);
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: .35rem;
}

.grid { display: grid; gap: 1.1rem; }
.grid-cats { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-tools { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

a.card:hover, .card-link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  color: inherit;
}

.card-icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  margin-bottom: .9rem;
  background: linear-gradient(135deg, var(--accent-soft), var(--green-100));
  color: var(--navy-700);
}
[data-theme="dark"] .card-icon { color: var(--accent); }

.card h3 { margin-bottom: .35rem; font-size: 1.05rem; }
.card p { color: var(--text-soft); font-size: .9rem; margin: 0; }

.card-meta {
  margin-top: auto;
  padding-top: .85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .78rem;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border-radius: 999px;
  padding: .18rem .6rem;
  font-size: .72rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-soft);
}
.badge-new { background: var(--green-100); color: var(--success); }
.badge-popular { background: #fff3d6; color: #9a6b12; }
[data-theme="dark"] .badge-popular { background: #3d3117; color: #f0c46b; }

/* --------------------------------------------------------------------------
   Tool page
   -------------------------------------------------------------------------- */

.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 0 1.5rem;
}
.page-head h1 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.2rem); margin-bottom: .35rem; }
.page-head .lead { color: var(--text-soft); max-width: 70ch; margin: 0; }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  font-size: .84rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: .5; }

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  align-items: start;
  padding: 2rem 0 3rem;
}

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
}

.tool-panel > h2 { font-size: 1.2rem; }

.tool-form { display: grid; gap: 1.05rem; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.field { display: flex; flex-direction: column; gap: .35rem; }
.field > label {
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.field .req { color: var(--danger); }
.field .help { font-size: .79rem; color: var(--text-muted); }

.input, .select, .textarea {
  width: 100%;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: .62rem .8rem;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(26, 156, 114, .14);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.input[type="range"] { padding: 0; accent-color: var(--green-500); }
.input[type="color"] { padding: .25rem; height: 44px; }
.input[type="file"] { padding: .5rem; background: var(--surface-2); }

.choice-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: .88rem;
  cursor: pointer;
  transition: all .16s ease;
  background: var(--surface);
}
.choice:hover { border-color: var(--green-500); }
.choice input { accent-color: var(--green-500); }
.choice:has(input:checked) {
  border-color: var(--green-500);
  background: var(--green-100);
  color: var(--success);
  font-weight: 700;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-top: .35rem;
}

/* Result panel ------------------------------------------------------- */

.tool-result {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}
.tool-result[hidden] { display: none; }
.tool-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .8rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.tool-result-body { padding: 1.1rem; }

.result-rows { display: grid; gap: .55rem; }
.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.result-row .label { color: var(--text-soft); font-size: .9rem; }
.result-row .value { font-weight: 800; font-size: 1.05rem; color: var(--accent); font-family: var(--mono); word-break: break-word; }

.result-text {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem;
  font-family: var(--mono);
  font-size: .88rem;
  max-height: 460px;
  overflow: auto;
  direction: ltr;
  text-align: left;
}

.alert {
  margin-top: 1.25rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .92rem;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
}
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(192, 57, 43, .25); }
.alert-success { background: var(--green-100); color: var(--success); border-color: rgba(20, 128, 92, .25); }
.alert-info { background: var(--accent-soft); color: var(--accent); border-color: rgba(30, 74, 120, .2); }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn.is-loading { opacity: .75; pointer-events: none; }

/* Sidebar ------------------------------------------------------------ */

.sidebar { display: grid; gap: 1.1rem; position: sticky; top: calc(var(--header-h) + 1rem); }

.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
}
.side-card h3 { font-size: 1rem; margin-bottom: .8rem; }
.side-card ul { list-style: none; padding: 0; margin: 0; }
.side-card li { border-bottom: 1px solid var(--border); }
.side-card li:last-child { border-bottom: 0; }
.side-card li a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .25rem;
  color: var(--text-soft);
  font-size: .9rem;
}
.side-card li a:hover { color: var(--accent); }
.side-card li a i { width: 22px; text-align: center; color: var(--green-500); font-size: .85rem; }

/* Content blocks ----------------------------------------------------- */

.prose { color: var(--text-soft); }
.prose h2 { color: var(--text); margin-top: 1.75rem; }
.prose h3 { color: var(--text); margin-top: 1.5rem; }
.prose ul { padding-inline-start: 1.2rem; }
.prose li { margin-bottom: .45rem; }
.prose strong { color: var(--text); }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-inline-start: 3rem;
  margin-bottom: 1rem;
  color: var(--text-soft);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: .1rem;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--green-500));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .85rem;
  font-weight: 800;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .65rem;
  background: var(--surface);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: .85rem 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .75rem; color: var(--text-muted); transition: transform .2s ease; }
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item .answer { padding: 0 1rem 1rem; color: var(--text-soft); font-size: .93rem; }

.example-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: .85rem;
}
.example-box h4 { font-size: .95rem; margin-bottom: .4rem; }
.example-box pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: .85rem;
  color: var(--text-soft);
  direction: ltr;
  text-align: left;
}

/* Ads ---------------------------------------------------------------- */

.ad-slot {
  margin: 1.25rem 0;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  min-height: 90px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
  overflow: hidden;
}
.ad-slot > span { padding: 1rem; }
.ad-slot iframe { width: 100%; border: 0; display: block; }
.ad-label { display: block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin-bottom: .25rem; }

/* Filters / pagination ------------------------------------------------ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.filter-bar .select, .filter-bar .input { width: auto; min-width: 190px; }

.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.chip {
  padding: .38rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: .86rem;
  color: var(--text-soft);
  background: var(--surface);
  transition: all .16s ease;
}
.chip:hover { border-color: var(--green-500); color: var(--accent); }
.chip.active { background: var(--navy-700); border-color: var(--navy-700); color: #fff; font-weight: 700; }

.pagination { display: flex; justify-content: center; gap: .35rem; margin-top: 2rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 40px;
  height: 40px;
  padding: 0 .7rem;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-weight: 700;
  font-size: .9rem;
}
.pagination a:hover { border-color: var(--green-500); color: var(--accent); }
.pagination .current { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-soft);
}
.empty-state i { font-size: 2.5rem; color: var(--border-strong); margin-bottom: .75rem; display: block; }

/* Features / steps / CTA --------------------------------------------- */

.feature { display: flex; gap: 1rem; align-items: flex-start; }
.feature-icon {
  width: 46px; height: 46px;
  flex-shrink: 0;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--green-100));
  color: var(--navy-700);
  font-size: 1.15rem;
}
[data-theme="dark"] .feature-icon { color: var(--accent); }
.feature h3 { font-size: 1.02rem; margin-bottom: .25rem; }
.feature p { color: var(--text-soft); font-size: .92rem; margin: 0; }

.cta {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600) 55%, var(--green-600));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255, 255, 255, .85); max-width: 55ch; margin-inline: auto; }
.cta .btn-accent { margin-top: .75rem; }

/* Footer -------------------------------------------------------------- */

.site-footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, .78);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}
.site-footer a { color: rgba(255, 255, 255, .78); font-size: .9rem; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 { color: #fff; font-size: .98rem; margin-bottom: .85rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: .45rem; }
.footer-support .support-link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .75rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  white-space: nowrap;
}
.footer-support .support-link:hover {
  background: rgba(141, 224, 198, .12);
  border-color: rgba(141, 224, 198, .5);
}
.footer-brand .brand { color: #fff; margin-bottom: .75rem; }
.footer-brand p { font-size: .9rem; line-height: 1.8; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .84rem;
}
.social-row { display: flex; gap: .5rem; margin-top: .85rem; }
.social-row a {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  display: grid;
  place-items: center;
  color: #fff;
}
.social-row a:hover { background: var(--green-500); }

/* Toast --------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  inset-inline-start: 1.25rem;
  display: grid;
  gap: .5rem;
  z-index: 120;
}
.toast {
  background: var(--navy-800);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  font-weight: 600;
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Utilities ------------------------------------------------------------ */

.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 1.25rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.stack { display: grid; gap: 1rem; }
.divider { height: 1px; background: var(--border); border: 0; margin: 1.5rem 0; }
.code-inline {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .1rem .4rem;
  font-size: .86em;
  direction: ltr;
  display: inline-block;
}

/* Responsive ---------------------------------------------------------- */

@media (max-width: 1024px) {
  .tool-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-grid; }
  .main-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
    padding: .5rem 1rem 1rem;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: .15rem; }
  .main-nav a { padding: .7rem .6rem; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .tool-panel { padding: 1.15rem; border-radius: var(--radius); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.25rem; }
  .form-actions .btn { flex: 1 1 auto; }
}

@media print {
  .site-header, .site-footer, .ad-slot, .tool-actions, .sidebar { display: none !important; }
  body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --------------------------------------------------------------------------
   Refined site-wide experience
   -------------------------------------------------------------------------- */

:root {
  --navy-900: #10243a;
  --navy-800: #18344e;
  --navy-700: #1c4960;
  --green-600: #087e72;
  --green-500: #0c9a84;
  --green-400: #37b89a;
  --green-100: #e4f5ef;
  --bg: #f4f7f6;
  --surface-2: #f0f5f3;
  --border: #dfe9e5;
  --border-strong: #c7d8d1;
  --text: #172d3d;
  --text-soft: #526675;
  --text-muted: #71828e;
  --accent: var(--navy-700);
  --accent-soft: #e8f1f2;
  --shadow-sm: 0 2px 8px rgba(20, 48, 58, .045);
  --shadow-md: 0 12px 30px rgba(20, 48, 58, .09);
  --shadow-lg: 0 24px 60px rgba(20, 48, 58, .13);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --container: 1200px;
  --header-h: 76px;
}

[data-theme="dark"] {
  --bg: #101b25;
  --surface: #172734;
  --surface-2: #1e3240;
  --border: #2b414c;
  --border-strong: #3c5964;
  --text: #eaf2f1;
  --text-soft: #c0cece;
  --text-muted: #91a6aa;
  --accent: #8bcfbe;
  --accent-soft: #203c44;
  --green-100: #1d4039;
  --success: #56c7a5;
}

body {
  background-image: radial-gradient(ellipse at 50% -30rem, rgba(12, 154, 132, .07), transparent 55%);
  background-attachment: fixed;
  line-height: 1.8;
}

::selection { background: rgba(12, 154, 132, .2); color: var(--text); }

.container { width: min(100% - 2.5rem, var(--container)); }

.site-header {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom-color: color-mix(in srgb, var(--border) 78%, transparent);
  box-shadow: 0 4px 24px rgba(20, 48, 58, .035);
}

.header-inner { gap: clamp(.65rem, 2vw, 1.5rem); }
.brand { gap: .75rem; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: linear-gradient(145deg, #1c4960 4%, #087e72 100%);
  box-shadow: 0 7px 18px rgba(8, 126, 114, .2);
}
.footer-brand .brand-logo { height: 58px; max-width: 200px; }
.main-nav ul { gap: .2rem; }
.main-nav a { padding: .52rem .72rem; font-size: .91rem; }
.main-nav a.active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green-500) 14%, transparent); }
.icon-btn { border-radius: 13px; }

.btn {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn-primary, .btn-accent {
  background: linear-gradient(135deg, #1c4960, #087e72);
  box-shadow: 0 6px 16px rgba(8, 126, 114, .16);
}
.btn-primary:hover, .btn-accent:hover { box-shadow: 0 10px 24px rgba(8, 126, 114, .23); }
.btn-outline { border-radius: 12px; }

.hero {
  isolation: isolate;
  padding-block: clamp(3rem, 7vw, 6rem);
  background:
    radial-gradient(ellipse 36rem 25rem at 100% 0%, rgba(12, 154, 132, .13), transparent 72%),
    radial-gradient(ellipse 34rem 22rem at 0% 100%, rgba(28, 73, 96, .09), transparent 76%),
    var(--surface);
  border-bottom-color: var(--border);
}
.hero-grid { gap: clamp(2rem, 6vw, 5rem); }
.hero-badge {
  border: 1px solid color-mix(in srgb, var(--green-500) 20%, transparent);
  padding: .38rem .85rem;
}
.hero h1 { max-width: 15ch; line-height: 1.28; }
.hero-gradient-text {
  background-image: linear-gradient(115deg, #1c4960 10%, #087e72 82%);
}
[data-theme="dark"] .hero-gradient-text { background-image: linear-gradient(115deg, #a9d9d4, #62d0ad); }
.hero-sub { max-width: 38rem; line-height: 1.9; }
.hero-card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.35rem, 3vw, 2rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--surface), color-mix(in srgb, var(--green-100) 34%, var(--surface)));
}
.hero-card::after {
  content: "";
  position: absolute;
  width: 10rem;
  height: 10rem;
  inset-inline-end: -5rem;
  top: -5rem;
  border: 1px solid color-mix(in srgb, var(--green-500) 15%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 1.2rem color-mix(in srgb, var(--green-500) 4%, transparent), 0 0 0 2.4rem color-mix(in srgb, var(--green-500) 3%, transparent);
  pointer-events: none;
}
.hero-card-head { position: relative; z-index: 1; }
.hero-card li { padding-block: .68rem; }

.search-box {
  max-width: 680px;
  border-color: var(--border-strong);
  padding: .36rem .4rem .36rem 1.15rem;
  box-shadow: 0 10px 26px rgba(20, 48, 58, .075);
}
.search-box .btn { min-height: 46px; padding-inline: 1.2rem; }

.section { padding-block: clamp(2.75rem, 5vw, 4.5rem); }
.section-head { margin-bottom: 2rem; }
.section-head h2 { margin-bottom: .4rem; }
.eyebrow { letter-spacing: .01em; }
.grid { gap: 1.15rem; }
.grid-cats { grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr)); }
.grid-tools { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }

.card {
  position: relative;
  overflow: hidden;
  padding: 1.35rem;
  border-color: var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--green-500), transparent);
  opacity: 0;
  transition: opacity .2s ease;
}
.card:hover::before, a.card:focus-visible::before { opacity: 1; }
a.card:hover, .card-link:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--green-500) 34%, var(--border));
  box-shadow: var(--shadow-md);
}
.card-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 82%, var(--surface)), var(--green-100));
  color: var(--green-600);
}
.card h3 { line-height: 1.5; }
.card p { line-height: 1.75; }
.card-meta { border-top: 1px solid var(--border); margin-top: .9rem; padding-top: .85rem; }
.badge { padding: .22rem .62rem; }

.page-head {
  padding-block: clamp(2rem, 4.5vw, 3.5rem);
  background:
    radial-gradient(ellipse 32rem 18rem at 100% 0%, rgba(12, 154, 132, .1), transparent 75%),
    var(--surface);
  border-bottom: 1px solid var(--border);
}
.page-head h1 { margin-top: .5rem; }
.breadcrumbs { margin-bottom: .8rem; }
.breadcrumbs a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.breadcrumbs a:hover { text-decoration-color: currentColor; }

.filter-bar {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.chip-row { gap: .55rem; padding-block: .35rem .8rem; }
.chip {
  border-radius: 999px;
  padding: .43rem .85rem;
  font-weight: 650;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.chip:hover { transform: translateY(-1px); }
.chip.active { box-shadow: 0 5px 14px rgba(8, 126, 114, .14); }

.tool-layout { gap: clamp(1.25rem, 3vw, 2.25rem); padding-block: 1.5rem 3.5rem; }
.tool-panel, .side-card {
  border-radius: 22px;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.tool-panel { padding: clamp(1.25rem, 3vw, 2rem); }
.tool-panel > h2 { display: flex; align-items: center; gap: .6rem; }
.tool-panel > h2 i { color: var(--green-600); }
.tool-form { gap: 1.25rem; }
.form-row { gap: 1rem; }
.field label { font-size: .94rem; font-weight: 700; }
.input, .select, .textarea {
  border-radius: 12px;
  border-color: var(--border-strong);
  min-height: 46px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.textarea { min-height: 132px; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--green-500) 48%, var(--border-strong)); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green-500) 13%, transparent);
}
.form-actions { padding-top: .2rem; }
.tool-result { border-radius: 16px; overflow: hidden; }
.tool-result-head { padding: .9rem 1rem; }
.tool-result-body { line-height: 1.9; }
.side-card { padding: 1.2rem; }
.side-card h3 { font-size: 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--border); }
.side-card li { padding-block: .48rem; }
.steps { padding-inline-start: 2rem; }
.steps li { padding-inline-start: .3rem; margin-bottom: .7rem; }
.example-box, .faq-item {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  padding: 1rem 1.1rem;
  margin-bottom: .75rem;
}
.faq-item summary { font-weight: 700; cursor: pointer; }
.faq-item[open] summary { color: var(--green-600); margin-bottom: .65rem; }
.faq-item .answer { color: var(--text-soft); }

.pagination a, .pagination span { border-radius: 11px; }
.pagination .current { background: linear-gradient(135deg, #1c4960, #087e72); border-color: transparent; }
.empty-state { border-radius: 22px; border: 1px dashed var(--border-strong); background: var(--surface); }

.site-footer {
  background:
    radial-gradient(ellipse 38rem 22rem at 100% 0%, rgba(55, 184, 154, .16), transparent 70%),
    linear-gradient(145deg, #112c3d, #10243a 70%);
  border-top: 3px solid #0c9a84;
}
.footer-grid { grid-template-columns: 1.35fr repeat(4, 1fr); gap: 1.5rem; padding-block: 3.5rem 2.5rem; }
.site-footer .brand-mark { box-shadow: none; }
.site-footer a:hover { color: #8de0c6; }
.footer-bottom { border-top-color: rgba(255, 255, 255, .14); }

.toast { border-radius: 14px; box-shadow: var(--shadow-lg); }

@media (max-width: 860px) {
  .site-header { backdrop-filter: blur(14px); }
  .main-nav { border-radius: 0 0 18px 18px; max-height: min(72vh, 440px); overflow-y: auto; }
  .hero { padding-block: 3rem; }
  .hero-grid { gap: 2rem; }
  .hero h1 { max-width: 18ch; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 1.25rem, var(--container)); }
  .header-inner { min-height: 66px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
  .brand-logo { height: 44px; max-width: 140px; }
  .footer-brand .brand-logo { height: 50px; max-width: 170px; }
  .hero { padding-block: 2.5rem; }
  .hero-sub { font-size: 1rem; }
  .search-box { border-radius: 16px; padding: .3rem; }
  .search-box input { padding-inline: .6rem; font-size: .94rem; }
  .search-box .btn { min-height: 42px; padding-inline: .85rem; }
  .hero-stats { justify-content: space-between; gap: .75rem; }
  .hero-stat strong { font-size: 1.35rem; }
  .grid { gap: .8rem; }
  .card { padding: 1rem; border-radius: 17px; }
  .tool-layout { padding-top: 1rem; }
  .tool-panel, .side-card { border-radius: 17px; }
  .filter-bar { padding: .75rem; }
  .filter-bar form { width: 100%; }
  .filter-bar .input, .filter-bar .select { min-width: 0; width: 100%; }
}

/* Page-specific layouts shared by the remaining site sections. */

#main-content { min-height: 55vh; }

.content-article {
  width: min(100%, 900px);
  margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 2.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  line-height: 1.95;
}
.content-article > :first-child { margin-top: 0; }
.content-article h2 { padding-bottom: .45rem; border-bottom: 1px solid var(--border); }
.content-article h3 { margin-top: 1.75rem; }
.content-article a { text-decoration: underline; text-underline-offset: 3px; }
.content-article img { border-radius: 14px; }

.content-page-head { padding-block: clamp(2rem, 5vw, 3.75rem); }
.content-page-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 1.6rem);
  max-width: 900px;
  margin-inline: auto;
}
.content-page-icon {
  width: clamp(58px, 8vw, 78px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--green-500) 18%, var(--border));
  border-radius: 24px;
  background: linear-gradient(145deg, var(--surface), var(--green-100));
  color: var(--green-600);
  font-size: clamp(1.45rem, 3vw, 2rem);
  box-shadow: var(--shadow-sm);
}
.content-page-kicker {
  display: inline-block;
  margin-bottom: .15rem;
  color: var(--green-600);
  font-size: .82rem;
  font-weight: 800;
}
.content-page-title h1 { margin-bottom: .35rem; }
.content-page-title .lead { max-width: 68ch; line-height: 1.8; }
.content-page-privacy .content-page-icon { color: #3979a2; background: linear-gradient(145deg, var(--surface), #e8f3f7); }
.content-page-terms .content-page-icon { color: #6f65a8; background: linear-gradient(145deg, var(--surface), #f0edfa); }
.content-page-disclaimer .content-page-icon { color: #ae7b30; background: linear-gradient(145deg, var(--surface), #fbf2df); }
[data-theme="dark"] .content-page-privacy .content-page-icon { background: linear-gradient(145deg, var(--surface), #203745); }
[data-theme="dark"] .content-page-terms .content-page-icon { background: linear-gradient(145deg, var(--surface), #302b46); }
[data-theme="dark"] .content-page-disclaimer .content-page-icon { background: linear-gradient(145deg, var(--surface), #403721); }

.content-page-section { padding-top: clamp(1.5rem, 3vw, 2.5rem); }
.content-article {
  max-width: 820px;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(20, 48, 58, .055);
  counter-reset: content-section;
}
.content-article h2 {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 2rem 0 .8rem;
  padding: 0 0 .75rem;
  border-bottom: 1px solid var(--border);
  font-size: clamp(1.12rem, 1rem + .5vw, 1.35rem);
}
.content-article h2:first-child { margin-top: 0; }
.content-article h2::before {
  counter-increment: content-section;
  content: counter(content-section, decimal-leading-zero);
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--green-600);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 800;
}
.content-article p { color: var(--text-soft); margin-bottom: 1rem; }
.content-article a { color: var(--green-600); font-weight: 700; }
.content-article a:hover { color: var(--accent); }

.content-page-nav {
  width: min(100%, 820px);
  margin: 1.25rem auto 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}
.content-page-nav-label { display: block; margin: 0 .25rem .65rem; color: var(--text-muted); font-size: .8rem; font-weight: 800; }
.content-page-nav-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.content-page-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-soft);
  font-size: .82rem;
  font-weight: 700;
  text-align: center;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.content-page-nav a:hover { transform: translateY(-1px); border-color: var(--green-500); color: var(--green-600); }
.content-page-nav a[aria-current="page"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--green-500) 35%, var(--border)); color: var(--green-600); }
.content-page-nav a i { font-size: .8rem; }

.contact-form { min-width: 0; }
.contact-form .field { margin-bottom: .2rem; }
.contact-form .input, .contact-form .textarea { background: var(--bg); }
.contact-form .input:focus, .contact-form .textarea:focus { background: var(--surface); }
.field .help[style*="danger"] { color: var(--danger) !important; font-weight: 600; }
.field input:required:invalid:not(:placeholder-shown),
.field textarea:required:invalid:not(:placeholder-shown) { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
.alert { border-radius: 13px; }

.error-state {
  width: min(100%, 760px);
  margin: clamp(2rem, 8vw, 6rem) auto;
  padding: clamp(2rem, 6vw, 4rem) 1.25rem;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse 24rem 12rem at 50% 0%, rgba(12, 154, 132, .1), transparent 75%),
    var(--surface);
  box-shadow: var(--shadow-md);
}
.error-state > i { color: var(--green-600); font-size: 3rem; }
.error-state h1 { color: var(--accent); font-size: clamp(3rem, 12vw, 5rem); line-height: 1.1; }
.error-state h3 { margin-top: .5rem; }
.error-state p { max-width: 52ch; margin-inline: auto; color: var(--text-soft); }
.error-state .form-actions { justify-content: center; margin-top: 1.5rem; }

.category-detail-head .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1.5rem;
}
.category-detail-head .breadcrumbs { grid-column: 1 / -1; }
.category-detail-head h1, .category-detail-head .lead { grid-column: 1; }
.category-detail-head .lead { max-width: 68ch; }
.category-count {
  grid-column: 2;
  grid-row: 2 / 4;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .45rem .85rem;
  background: var(--surface);
  color: var(--text-soft);
  font-size: .85rem;
  font-weight: 700;
}

.ad-slot { border-style: solid; background: color-mix(in srgb, var(--surface) 72%, var(--surface-2)); }
.ad-label { letter-spacing: .04em; }
.search-suggest { border-radius: 16px; }
.search-suggest a { min-height: 58px; }
.search-suggest a:focus-visible { position: relative; z-index: 1; outline-offset: -3px; }

.btn:disabled, .btn[aria-disabled="true"] { opacity: .58; cursor: not-allowed; transform: none; box-shadow: none; }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .65; cursor: not-allowed; }

@media (max-width: 700px) {
  .content-article { border-radius: 17px; }
  .content-page-title { align-items: start; }
  .content-page-icon { border-radius: 18px; }
  .content-page-nav-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-detail-head .container { grid-template-columns: minmax(0, 1fr); }
  .category-detail-head .breadcrumbs,
  .category-detail-head h1,
  .category-detail-head .lead,
  .category-count { grid-column: 1; grid-row: auto; }
  .category-count { align-self: start; }
  .error-state { margin-block: 2rem; }
  .error-state .form-actions { flex-direction: column; align-items: stretch; }
  .error-state .form-actions .btn { width: 100%; }
}

@media (max-width: 420px) {
  .content-page-title { grid-template-columns: 1fr; }
  .content-page-icon { width: 52px; border-radius: 15px; }
  .content-page-nav-links { grid-template-columns: 1fr; }
  .content-page-nav a { justify-content: flex-start; }
}
