:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-strong: #eef2ff;
  --page-bg: #f5f7fb;
  --text: #172033;
  --text-muted: #64748b;
  --border: #dfe5ef;
  --border-strong: #cbd5e1;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #067647;
  --success-soft: #ecfdf3;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.09);
  --shadow-focus: 0 0 0 4px rgba(37, 99, 235, 0.14);
  --transition: 180ms ease;
}

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

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

body.bg-body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.08), transparent 26rem),
    linear-gradient(180deg, #f9fbff 0, var(--page-bg) 36rem);
  color: var(--text);
  font-family: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition), background-color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

a:hover {
  color: var(--primary);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

p,
ul,
ol {
  margin-top: 0;
}

p:last-child,
ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  line-height: 1.45;
}

h2,
h3,
h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 9999;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  color: #fff;
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(203, 213, 225, 0.72);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.logo {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--text);
}

.logo img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-copy strong {
  font-size: 1.15rem;
  font-weight: 800;
}

.brand-copy small {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.main-nav {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.main-nav a {
  padding: 0.62rem 0.72rem;
  border-radius: 11px;
  color: #42526a;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  margin-inline-start: auto;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  width: 20px;
  height: 2px;
  display: block;
  border-radius: 99px;
  background: currentColor;
}

.nav-toggle-icon {
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  right: 0;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.page-container {
  flex: 1;
  padding-block: 2.5rem 4rem;
}

.page-heading {
  max-width: 850px;
  margin-bottom: 1.15rem;
}

.page-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.page-subtitle {
  max-width: 760px;
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  font-size: clamp(0.98rem, 1.5vw, 1.08rem);
}

.breadcrumbs {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--primary-dark);
}

.card {
  position: relative;
  margin-bottom: 1.35rem;
  padding: clamp(1.15rem, 3vw, 2rem);
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
}

.card > :first-child {
  margin-top: 0;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.18rem, 2vw, 1.45rem);
  font-weight: 800;
}

.card h3 {
  font-size: 1.05rem;
}

.card li + li {
  margin-top: 0.35rem;
}

.card-accent {
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.1rem;
  align-items: end;
}

.form-group {
  min-width: 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.42rem;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea,
.card input,
.card select,
.card textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.form-group textarea,
.card textarea {
  min-height: 130px;
  resize: vertical;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover,
.card input:hover,
.card select:hover,
.card textarea:hover {
  border-color: #94a3b8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.card input:focus,
.card select:focus,
.card textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
  color: #fff;
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition), background-color var(--transition), border-color var(--transition);
}

.btn:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.25);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn.is-loading {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.btn-secondary {
  border-color: var(--border);
  background: #fff;
  box-shadow: none;
  color: #344054;
}

.btn-secondary:hover {
  border-color: #b8c5d6;
  background: var(--surface-muted);
  box-shadow: var(--shadow-sm);
  color: var(--primary-dark);
}

.btn-green {
  background: linear-gradient(135deg, #0f766e, #115e59);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
}

.btn-blue {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.btn-full {
  width: 100%;
}

.alert {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
}

.alert ul {
  margin: 0.5rem 0 0;
}

.alert-error {
  border-color: #fecdca;
  background: var(--danger-soft);
  color: var(--danger);
}

.result-highlight {
  display: inline-block;
  color: var(--primary-dark);
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 800;
}

[data-result-wrapper] {
  border-color: #bfdbfe;
  background: linear-gradient(145deg, #ffffff 0%, #eff6ff 100%);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1rem;
}

.copy-status {
  color: var(--success);
  font-size: 0.86rem;
}

.tool-grid,
.home-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
  gap: 0.9rem;
}

.tool-card,
.home-tool-card {
  min-height: 112px;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.tool-card:hover,
.home-tool-card:hover {
  border-color: #93b4ef;
  background: #fafdff;
  color: var(--text);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.tool-icon,
.home-tool-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  font-size: 1.35rem;
}

.tool-desc,
.home-tool-desc {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.category-block + .category-block {
  margin-top: 1.7rem;
}

.category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.category-heading h2,
.category-heading h3 {
  margin: 0;
}

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.75fr);
  gap: 1.2rem;
  margin-bottom: 1.35rem;
}

.home-hero,
.home-trust {
  margin-bottom: 0;
}

.home-hero {
  padding: clamp(1.5rem, 4vw, 2.6rem);
  background:
    radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.13), transparent 15rem),
    linear-gradient(135deg, #ffffff 0%, #f1f7ff 100%);
}

.home-hero h2 {
  max-width: 680px;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.home-trust {
  background: linear-gradient(145deg, #0f172a, #1e3a5f);
  color: #e2e8f0;
}

.home-trust h2,
.home-trust strong {
  color: #fff;
}

.trust-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.trust-list li::before {
  content: "✓";
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: #86efac;
  font-weight: 800;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 0.85rem;
}

.example-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.example-card p {
  margin-bottom: 0.45rem;
}

.faq-list {
  display: grid;
  gap: 0.7rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.faq-item summary {
  padding: 0.95rem 1rem;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: left;
  color: var(--primary);
  font-size: 1.3rem;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 1rem 1rem;
  color: var(--text-muted);
}

.share-panel {
  margin: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.share-label {
  margin-inline-end: 0.25rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.share-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: #344054;
  text-decoration: none;
}

.share-button:hover {
  border-color: #93b4ef;
  background: var(--primary-soft);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

.share-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list li {
  padding: 0.72rem 0;
  border-bottom: 1px dashed var(--border);
}

.link-list li:last-child {
  border-bottom: 0;
}

.link-list a {
  font-weight: 600;
}

.link-inline {
  text-decoration: underline;
}

.content-note {
  padding: 1rem;
  border-right: 4px solid var(--primary);
  border-radius: 10px;
  background: var(--primary-soft);
  color: #344054;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.4fr);
  gap: 2rem;
  padding-block: 2.5rem 1.75rem;
}

.footer-brand strong {
  font-size: 1.2rem;
}

.footer-brand p {
  max-width: 440px;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  align-content: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.footer-links a {
  padding: 0.45rem 0.65rem;
  border-radius: 9px;
  color: #475467;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover {
  background: var(--surface-muted);
  color: var(--primary-dark);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.1rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.76rem;
}

.footer-bottom p {
  margin: 0;
}

.greg-date-highlight {
  display: inline-block;
  margin-bottom: 0.2rem;
  padding: 0.5rem 1.2rem;
  border-radius: 10px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}

.greg-date-label {
  color: #334155;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
}

.u-flex { display: flex; }
.u-gap-sm { gap: 8px; }
.u-nowrap { flex-wrap: nowrap; }
.u-self-end { align-self: end; }
.u-self-center { align-self: center; }
.u-text-center { text-align: center; }
.u-block { display: block; }
.u-w-60 { width: 60px !important; }
.u-w-80 { width: 80px !important; }
.u-w-90 { width: 90px !important; }
.u-mt-1 { margin-top: 0.25rem; }
.u-mt-2 { margin-top: 0.5rem; }
.u-mt-3 { margin-top: 0.75rem; }
.u-mt-4 { margin-top: 1rem; }
.u-mt-6 { margin-top: 1.5rem; }
.u-mb-2 { margin-bottom: 0.5rem; }
.u-mb-3 { margin-bottom: 0.75rem; }
.u-mb-4 { margin-bottom: 1rem; }
.u-mb-6 { margin-bottom: 1.5rem; }
.u-text-xs { font-size: 0.85rem; }
.u-text-sm { font-size: 0.9rem; }
.u-text-md { font-size: 0.95rem; }
.u-text-secondary { color: var(--text-muted); }

@media (max-width: 980px) {
  .header-inner {
    min-height: 72px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .main-nav.is-collapsible {
    width: 100%;
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    opacity: 0;
    transition: max-height 250ms ease, opacity 180ms ease, padding 180ms ease;
  }

  .main-nav.is-collapsible.is-open {
    max-height: 480px;
    padding-bottom: 0.85rem;
    opacity: 1;
  }

  .main-nav a {
    text-align: center;
  }

  .home-intro {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  body.bg-body {
    font-size: 15px;
  }

  .container {
    width: min(100% - 1.15rem, 1180px);
  }

  .header-inner {
    gap: 0.65rem;
  }

  .logo img {
    width: 43px;
    height: 43px;
  }

  .brand-copy small {
    display: none;
  }

  .nav-toggle {
    padding: 0.52rem 0.65rem;
    font-size: 0.82rem;
  }

  .page-container {
    padding-block: 1.55rem 2.8rem;
  }

  .page-title {
    font-size: 1.65rem;
  }

  .card {
    margin-bottom: 1rem;
    padding: 1.1rem;
    border-radius: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .btn {
    width: 100%;
  }

  .home-hero-actions .btn,
  .result-actions .btn {
    width: auto;
    flex: 1 1 160px;
  }

  .main-nav.is-collapsible {
    grid-template-columns: 1fr 1fr;
  }

  .tool-grid,
  .home-tools-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.55rem;
  }

  .u-nowrap {
    flex-wrap: wrap;
  }
}

@media (max-width: 430px) {
  .brand-copy strong {
    font-size: 1rem;
  }

  .main-nav.is-collapsible {
    grid-template-columns: 1fr;
  }

  .nav-toggle span:last-child {
    display: none;
  }

  .u-w-60,
  .u-w-80,
  .u-w-90 {
    width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .share-panel,
  .result-actions,
  .breadcrumbs,
  .nav-toggle {
    display: none !important;
  }

  body.bg-body {
    background: #fff;
  }

  .page-container {
    padding: 0;
  }

  .card {
    box-shadow: none;
    break-inside: avoid;
  }
}

.result-suggestion {
  flex: 1 1 100%;
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}
