:root {
  --bg: #07111c;
  --bg-deep: #050d16;
  --surface: #0f1c2b;
  --surface-2: #142334;
  --surface-3: #0b1724;
  --surface-glass: rgba(15, 28, 43, 0.78);
  --line: rgba(130, 170, 205, 0.13);
  --line-strong: rgba(130, 170, 205, 0.22);
  --text: #eef5fb;
  --muted: #92a8bf;
  --muted-2: #6f879f;
  --accent: #3ea0ff;
  --accent-2: #1d7fe8;
  --accent-3: #67d4ff;
  --accent-soft: rgba(62, 160, 255, 0.13);
  --accent-text: #9fd0ff;
  --cyan-soft: rgba(103, 212, 255, 0.1);
  --green: #2fce7b;
  --green-text: #7eecc0;
  --green-soft: rgba(47, 206, 123, 0.12);
  --danger: #ff7b8a;
  --danger-text: #ffb0b9;
  --danger-soft: rgba(255, 123, 138, 0.12);
  --warn: #f0b429;
  --warn-text: #ffd56a;
  --warn-soft: rgba(240, 180, 41, 0.12);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.24);
  --font: "Cairo", system-ui, sans-serif;
  --shell: min(1120px, calc(100% - 2.5rem));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.7;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 480px at 85% -8%, rgba(62, 160, 255, 0.18), transparent 58%),
    radial-gradient(700px 420px at 8% 20%, rgba(103, 212, 255, 0.07), transparent 55%),
    radial-gradient(600px 360px at 50% 100%, rgba(47, 206, 123, 0.04), transparent 60%),
    linear-gradient(180deg, #08131f 0%, var(--bg-deep) 100%);
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at center, black 15%, transparent 72%);
}

.shell {
  position: relative;
  z-index: 1;
  width: var(--shell);
  margin: 0 auto;
}

.top-strip {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.6rem 1rem;
  font-size: 0.86rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 206, 123, 0.16);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.92); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.site-header {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0.85rem 0.7rem 0.7rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0.75rem;
  z-index: 40;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  justify-self: start;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #5bb0ff, #1570d6);
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 10px 22px rgba(29, 127, 232, 0.34);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.02rem;
  font-weight: 800;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.12rem;
}

.nav {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
}

.nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.site-header .btn-soft,
.header-actions {
  justify-self: end;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--line-strong);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-soft {
  padding: 0.62rem 1.1rem;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid rgba(62, 160, 255, 0.22);
  font-weight: 600;
  font-size: 0.92rem;
}

.btn-soft:hover {
  background: rgba(62, 160, 255, 0.18);
}

.btn-ghost {
  padding: 0.5rem 0.95rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.88rem;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
}

.btn-primary {
  width: 100%;
  padding: 0.98rem 1.2rem;
  background: linear-gradient(180deg, #56adff 0%, var(--accent-2) 100%);
  color: white;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(29, 127, 232, 0.34);
}

.btn-primary:hover {
  box-shadow: 0 18px 36px rgba(29, 127, 232, 0.42);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 2.75rem;
  align-items: center;
  padding: 3.4rem 0 2rem;
  animation: rise 0.65s ease both;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 0.85rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 600;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.15rem, 4.2vw, 3.35rem);
  line-height: 1.22;
  letter-spacing: -0.03em;
  max-width: 10.5ch;
  font-weight: 800;
}

.hero-lead {
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  max-width: 34rem;
  line-height: 1.85;
}

.hero-lead strong {
  color: #c5e4ff;
  font-weight: 700;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 2rem;
}

.feature {
  display: flex;
  gap: 0.8rem;
  padding: 1rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.feature-num {
  color: var(--accent-text);
  font-weight: 800;
  font-size: 0.9rem;
  padding-top: 0.1rem;
}

.feature h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.feature p {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.search-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, var(--accent-soft), transparent 44%),
    var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 1.45rem 1.4rem 1.4rem;
  box-shadow: var(--shadow);
  animation: rise 0.75s ease 0.05s both;
}

.search-card-bg {
  position: absolute;
  top: -0.15rem;
  left: 0.55rem;
  font-size: 5.2rem;
  font-weight: 800;
  color: rgba(148, 163, 184, 0.055);
  pointer-events: none;
  line-height: 1;
  letter-spacing: -0.04em;
}

.search-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  position: relative;
}

.search-card-head h2 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
}

.search-card-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  flex-shrink: 0;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin: 1.3rem 0 1.05rem;
  padding: 0.32rem;
  background: var(--surface-3);
  border-radius: 14px;
  border: 1px solid var(--line);
  position: relative;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.72rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: rgba(62, 160, 255, 0.16);
  color: #eaf5ff;
  box-shadow: inset 0 0 0 1px rgba(62, 160, 255, 0.3);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
  position: relative;
}

.field span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--text);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field input::placeholder {
  color: var(--muted-2);
}

.field input:focus {
  border-color: rgba(62, 160, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(62, 160, 255, 0.12);
  background: var(--surface);
}

.form-hint {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: #fecaca;
  font-size: 0.88rem;
}

.results-panel {
  margin: 0.4rem 0 1.6rem;
  padding: 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  animation: rise 0.4s ease both;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.panel-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.results-list {
  display: grid;
  gap: 0.7rem;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 0.75fr auto auto;
  gap: 0.9rem;
  align-items: center;
  width: 100%;
  padding: 1rem 1.05rem;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  text-align: right;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.result-card:hover {
  border-color: rgba(62, 160, 255, 0.42);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.result-card .name {
  font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.65;
  letter-spacing: -0.025em;
}

.result-card .meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.result-card .label {
  color: var(--muted-2);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.result-card .value {
  font-weight: 800;
  font-size: 1.08rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.result-card .percent {
  color: var(--accent-3);
  font-size: 0.84rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

.result-card .open-hint {
  color: var(--accent-text);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(62, 160, 255, 0.18);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--green-soft);
  color: var(--green-text);
  border: 1px solid rgba(47, 206, 123, 0.2);
  white-space: nowrap;
}

.badge.is-fail {
  background: var(--danger-soft);
  color: var(--danger-text);
  border-color: rgba(255, 123, 138, 0.2);
}

.badge.is-second,
.badge.is-absent {
  background: var(--warn-soft);
  color: var(--warn-text);
  border-color: rgba(240, 180, 41, 0.2);
}

.empty-state {
  text-align: center;
  padding: 2.2rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-3);
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0.35rem;
  margin: 0 0 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.case-stats {
  margin: 0 0 2.8rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.filter-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.86rem;
  transition: 0.15s ease;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.filter-chip.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: rgba(62, 160, 255, 0.35);
}

.filter-soon {
  color: var(--muted-2);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 999px;
}

.stats-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
}

.chart-card h3 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 800;
}

.chart-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
}

.chart-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.chart-center strong {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.chart-center span {
  color: var(--muted);
  font-size: 0.8rem;
}

.chart-legend {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.chart-legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.chart-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-legend strong {
  color: var(--text);
  font-size: 0.84rem;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.case-card.is-dimmed {
  opacity: 0.38;
  filter: grayscale(0.35);
}

.case-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.05rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 148px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.case-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.case-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.case-card strong {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.case-percent {
  color: var(--muted-2);
  font-size: 0.86rem;
  font-weight: 700;
}

.case-bar {
  margin-top: auto;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  overflow: hidden;
}

.case-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.7s ease;
}

.case-card.is-total strong { color: var(--accent-text); }
.case-card.is-total .case-bar span { background: linear-gradient(90deg, var(--accent), var(--accent-3)); }

.case-card.is-pass strong { color: var(--green-text); }
.case-card.is-pass .case-bar span { background: var(--green); }

.case-card.is-second strong { color: var(--warn-text); }
.case-card.is-second .case-bar span { background: var(--warn); }

.case-card.is-fail strong { color: var(--danger-text); }
.case-card.is-fail .case-bar span { background: var(--danger); }

.case-card.is-absent strong { color: #b8c5d6; }
.case-card.is-absent .case-bar span { background: #7f91a8; }

.stat {
  text-align: center;
  padding: 1.15rem 0.8rem;
}

.stat + .stat {
  border-inline-start: 1px solid var(--line);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.stat strong {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.how {
  padding: 0 0 3.2rem;
}

.section-head {
  text-align: center;
  margin-bottom: 1.7rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0.55rem auto 0;
  color: var(--muted);
  max-width: 32rem;
  font-size: 0.98rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.step {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.2rem 1.3rem;
  min-height: 205px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.step:hover {
  transform: translateY(-3px);
  border-color: rgba(62, 160, 255, 0.32);
  box-shadow: var(--shadow-soft);
}

.step-index {
  position: absolute;
  top: 0.65rem;
  left: 0.85rem;
  font-size: 2.5rem;
  font-weight: 800;
  color: rgba(148, 163, 184, 0.07);
  line-height: 1;
}

.step-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-text);
  margin-bottom: 1rem;
  border: 1px solid rgba(62, 160, 255, 0.16);
}

.step h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.info-bar {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.info-copy {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.info-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 800;
  flex-shrink: 0;
  border: 1px solid rgba(251, 191, 36, 0.18);
}

.info-copy h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
}

.info-copy p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 44rem;
  line-height: 1.7;
}

.info-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent-text);
  font-weight: 700;
  white-space: nowrap;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(62, 160, 255, 0.18);
  transition: background 0.15s ease;
}

.info-cta:hover {
  background: rgba(62, 160, 255, 0.18);
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem 0 2.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer-brand strong {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 800;
}

.footer-note {
  margin: 0;
  text-align: center;
  line-height: 1.7;
}

.footer-meta {
  text-align: left;
  font-weight: 600;
  display: grid;
  gap: 0.35rem;
}

.visitor-counter {
  color: var(--muted);
  font-size: 0.88rem;
}

.visitor-counter strong {
  color: var(--accent-text);
  font-size: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.15rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, 0.78);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  width: min(470px, 100%);
  background:
    linear-gradient(165deg, rgba(62, 160, 255, 0.1), transparent 42%),
    var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 1.55rem 1.35rem 1.2rem;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  animation: rise 0.28s ease both;
}

.report-modal-card {
  width: min(1080px, 97vw);
  height: min(96vh, 1000px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-color: #b9d9fa;
  box-shadow: 0 28px 70px rgba(29, 127, 232, 0.2);
}

.report-frame {
  display: block;
  width: 100%;
  height: calc(100% - 70px);
  min-height: 0;
  flex: 1 1 auto;
  border: 0;
  background: #fff;
}

.report-modal-card #share-card,
.report-modal-card #btn-print,
.report-modal-card .share-toast {
  display: none !important;
}

.report-modal-card .modal-actions {
  flex: 0 0 70px;
  height: 70px;
  margin: 0;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  background: #f8fbff;
  border-top: 1px solid #c9e1f8;
}

.report-modal-card .modal-actions .btn {
  width: 100%;
  height: 50px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid #b9d9fa;
  border-radius: 999px;
  background: #eaf4ff;
  color: #1569c7;
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-modal-card .modal-actions .btn-certificate {
  background: #eaf4ff;
  border-color: #b9d9fa;
  color: #1569c7;
}

.report-modal-card .modal-actions .modal-open-page {
  background: linear-gradient(180deg, #48a9ff 0%, #1d7fe8 100%);
  border-color: #1d7fe8;
  color: #fff;
}

.report-modal-card .modal-actions .btn-return-search {
  background: #eaf4ff;
  border-color: #b9d9fa;
  color: #1569c7;
}

.report-modal-card .modal-close {
  z-index: 2;
  top: 0.75rem;
  left: 0.75rem;
  background: #fff;
  color: #14453d;
}

html[data-theme="dark"] .report-modal-card,
html[data-theme="dark"] .report-frame {
  background: #0f1c2b;
}

html[data-theme="dark"] .report-modal-card .modal-actions {
  background: #0b1724;
  border-top-color: rgba(130, 170, 205, 0.22);
}

html[data-theme="dark"] .report-modal-card .modal-actions .btn {
  background: #14283a;
  border-color: rgba(130, 170, 205, 0.28);
  color: #b9d8f4;
}

html[data-theme="dark"] .report-modal-card .modal-actions .modal-open-page {
  background: linear-gradient(180deg, #48a9ff 0%, #1d7fe8 100%);
  color: #fff;
}

@media (max-width: 720px) {
  .modal {
    padding: max(0.35rem, env(safe-area-inset-top))
      max(0.35rem, env(safe-area-inset-right))
      max(0.35rem, env(safe-area-inset-bottom))
      max(0.35rem, env(safe-area-inset-left));
    align-items: center;
  }

  .modal-card.report-modal-card {
    width: 100%;
    max-height: calc(100dvh - 0.7rem);
    padding: 0;
    border-radius: 18px;
  }

  .report-frame {
    height: auto;
    min-height: 0;
  }

  .report-modal-card .modal-actions {
    flex-basis: auto;
    height: 112px;
    min-height: 112px;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .report-modal-card .modal-actions .btn {
    height: 45px;
    font-size: 0.78rem;
    line-height: 1.25;
    white-space: normal;
  }

  .report-modal-card .modal-close {
    top: 0.55rem;
    left: 0.55rem;
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.modal-close:hover {
  background: var(--accent-soft);
  border-color: var(--line-strong);
}

.modal-head {
  padding-inline-end: 0.2rem;
  padding-inline-start: 2.4rem;
  margin-bottom: 1.2rem;
}

.modal-kicker {
  margin: 0;
  color: var(--accent-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.modal-card h2 {
  margin: 0.4rem 0 0;
  font-size: clamp(1.18rem, 3.2vw, 1.4rem);
  line-height: 1.55;
  font-weight: 800;
  color: var(--text);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.modal-box {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem 1rem 1.05rem;
  min-height: 86px;
}

.modal-box span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  margin-bottom: 0.42rem;
}

.modal-box strong {
  display: block;
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

#modal-percent,
#r-percent {
  color: var(--accent-3);
}

#modal-case-box.is-pass strong,
#r-case-box.is-pass strong { color: var(--green-text); }
#modal-case-box.is-fail strong,
#r-case-box.is-fail strong { color: var(--danger-text); }
#modal-case-box.is-second strong,
#modal-case-box.is-absent strong,
#r-case-box.is-second strong,
#r-case-box.is-absent strong { color: var(--warn-text); }

.modal-foot {
  margin: 0.9rem 0 0;
  text-align: center;
  color: var(--muted-2);
  font-size: 0.8rem;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 1rem;
}

.modal-actions [hidden] {
  display: none !important;
}

.modal-actions .btn-certificate {
  width: 100%;
  justify-content: center;
  padding: 0.7rem 0.8rem;
  color: #1569c7;
  font-size: 0.9rem;
  font-weight: 800;
  background: #eaf4ff;
  border-color: #b9d9fa;
  box-shadow: none;
}

.modal-actions .btn-primary {
  width: auto;
  padding: 0.7rem 0.8rem;
  font-size: 0.9rem;
  box-shadow: none;
}

.modal-actions .btn-soft {
  width: 100%;
  justify-content: center;
}

.search-history {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.history-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.history-chip {
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.84rem;
}

.history-chip:hover {
  border-color: rgba(62, 160, 255, 0.4);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.compare-section {
  margin: 0 0 2.8rem;
}

.compare-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
}

.compare-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.85rem;
  align-items: end;
}

.compare-inputs .btn-primary {
  width: auto;
  min-width: 140px;
  padding: 0.95rem 1.1rem;
}

.compare-out {
  margin-top: 1rem;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.compare-item {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

.compare-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  line-height: 1.45;
}

.compare-item p,
.compare-item em,
.compare-item span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
}

.compare-item strong {
  display: block;
  margin: 0.55rem 0 0.2rem;
  font-size: 1.45rem;
  font-weight: 800;
}

.compare-item.is-winner {
  border-color: rgba(47, 206, 123, 0.45);
  box-shadow: 0 0 0 3px rgba(47, 206, 123, 0.12);
}

.compare-summary {
  margin: 0.9rem 0 0;
  text-align: center;
  color: var(--accent-text);
  font-weight: 700;
}

.mobile-search-bar {
  display: none;
  position: fixed;
  inset-inline: 1rem;
  bottom: 1rem;
  z-index: 50;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: 999px;
  background: linear-gradient(180deg, #56adff 0%, var(--accent-2) 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(29, 127, 232, 0.35);
}

@media print {
  @page {
    size: A4 portrait;
    margin: 14mm;
  }

  html,
  body {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #0f172a !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-result > *:not(#print-root) {
    display: none !important;
  }

  body.printing-result #print-root {
    display: block !important;
    width: 100% !important;
    max-width: 680px !important;
    margin: 0 auto !important;
    padding: 8mm 0 0 !important;
    background: #fff !important;
    color: #0f172a !important;
    text-align: center !important;
    font-family: "Cairo", sans-serif !important;
  }

  body.printing-result #print-root .print-kicker {
    margin: 0 0 8px !important;
    color: #1d7fe8 !important;
    font-size: 16pt !important;
    font-weight: 700 !important;
  }

  body.printing-result #print-root .print-name {
    margin: 0 0 22px !important;
    color: #0f172a !important;
    font-size: 24pt !important;
    font-weight: 800 !important;
    line-height: 1.45 !important;
  }

  body.printing-result #print-root .print-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    text-align: right !important;
  }

  body.printing-result #print-root .print-box {
    border: 1.5px solid #d7dee8 !important;
    border-radius: 14px !important;
    padding: 16px 14px !important;
    background: #fff !important;
    min-height: 84px !important;
  }

  body.printing-result #print-root .print-box span {
    display: block !important;
    margin-bottom: 8px !important;
    color: #6b7c93 !important;
    font-size: 11pt !important;
    font-weight: 600 !important;
  }

  body.printing-result #print-root .print-box strong {
    display: block !important;
    color: #0f172a !important;
    font-size: 18pt !important;
    font-weight: 800 !important;
  }

  body.printing-result #print-root .print-box strong.is-percent {
    color: #1d7fe8 !important;
  }

  body.printing-result #print-root .print-box strong.is-pass {
    color: #15803d !important;
  }

  body.printing-result #print-root .print-box strong.is-fail {
    color: #be123c !important;
  }

  body.printing-result #print-root .print-box strong.is-second,
  body.printing-result #print-root .print-box strong.is-absent {
    color: #b45309 !important;
  }

  body.printing-result #print-root .print-note {
    margin: 18px 0 0 !important;
    color: #8a97a8 !important;
    font-size: 10pt !important;
    font-weight: 500 !important;
  }
}

.share-toast {
  margin: 0.75rem 0 0;
  text-align: center;
  color: var(--green-text);
  background: var(--green-soft);
  border: 1px solid rgba(47, 206, 123, 0.2);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sort-field {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.sort-field select {
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  outline: none;
}

.suggest-wrap {
  position: relative;
}

.suggest-box {
  position: absolute;
  top: calc(100% + 0.35rem);
  inset-inline: 0;
  z-index: 30;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow-y: auto;
}

.suggest-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: right;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
}

.suggest-item:last-child {
  border-bottom: 0;
}

.suggest-item:hover {
  background: var(--accent-soft);
}

.suggest-item small {
  color: var(--muted);
}

.dev-credit {
  margin: 0 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.15rem;
  background:
    linear-gradient(120deg, rgba(62, 160, 255, 0.1), transparent 45%),
    var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.dev-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #5bb0ff, #1570d6);
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.dev-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.dev-copy span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.dev-copy strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.dev-social {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(62, 160, 255, 0.25);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.dev-social:hover {
  background: rgba(62, 160, 255, 0.2);
}

.result-shell {
  padding-bottom: 1rem;
}

.result-main {
  padding: 2.2rem 0 1.5rem;
}

.result-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.result-state.is-error {
  color: var(--danger-text);
  background: var(--danger-soft);
  border-style: solid;
}

.result-view {
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 1.6rem 1.4rem 1.3rem;
  box-shadow: var(--shadow);
}

.result-view h1 {
  margin: 0.35rem 0 1.2rem;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  line-height: 1.5;
}

html[data-theme="light"] {
  --bg: #eef3f8;
  --bg-deep: #e7eef6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3f8;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --line: rgba(15, 40, 70, 0.1);
  --line-strong: rgba(15, 40, 70, 0.16);
  --text: #132033;
  --muted: #5b6f86;
  --muted-2: #7a8ea5;
  --accent: #1d7fe8;
  --accent-2: #1569c7;
  --accent-3: #0284c7;
  --accent-soft: rgba(29, 127, 232, 0.1);
  --accent-text: #1569c7;
  --green: #16a34a;
  --green-text: #15803d;
  --green-soft: rgba(22, 163, 74, 0.1);
  --danger: #e11d48;
  --danger-text: #be123c;
  --danger-soft: rgba(225, 29, 72, 0.1);
  --warn: #d97706;
  --warn-text: #b45309;
  --warn-soft: rgba(217, 119, 6, 0.1);
  --shadow: 0 18px 40px rgba(15, 40, 70, 0.1);
  --shadow-soft: 0 8px 20px rgba(15, 40, 70, 0.06);
}

html[data-theme="light"] body {
  background: var(--bg);
}

html[data-theme="light"] .ambient {
  background:
    radial-gradient(900px 480px at 85% -8%, rgba(29, 127, 232, 0.12), transparent 58%),
    radial-gradient(700px 420px at 8% 20%, rgba(14, 165, 233, 0.08), transparent 55%),
    linear-gradient(180deg, #f5f8fc 0%, #eaf0f7 100%);
}

html[data-theme="light"] .ambient::after {
  opacity: 0.18;
}

html[data-theme="light"] .theme-toggle {
  background: #f1f5f9;
  color: var(--text);
}

html[data-theme="light"] .theme-toggle:hover {
  background: #e2e8f0;
}

html[data-theme="light"] .nav a:hover {
  background: rgba(29, 127, 232, 0.08);
}

html[data-theme="light"] .search-card-bg {
  color: rgba(15, 40, 70, 0.05);
}

html[data-theme="light"] .case-bar,
html[data-theme="light"] .empty-state {
  background: rgba(15, 40, 70, 0.04);
}

html[data-theme="light"] .modal-card,
html[data-theme="light"] .result-view,
html[data-theme="light"] .chart-card,
html[data-theme="light"] .step,
html[data-theme="light"] .info-bar,
html[data-theme="light"] .case-card,
html[data-theme="light"] .filter-chip,
html[data-theme="light"] .dev-credit,
html[data-theme="light"] .suggest-box {
  background: var(--surface);
}

html[data-theme="light"] .modal-backdrop {
  background: rgba(15, 40, 70, 0.35);
}

html[data-theme="light"] .modal-close {
  background: #f1f5f9;
  color: var(--text);
  border-color: var(--line);
}

html[data-theme="light"] .stats-bar,
html[data-theme="light"] .results-panel {
  background: var(--surface);
}

html[data-theme="light"] .hero-lead strong {
  color: var(--accent-2);
}

html[data-theme="light"] .stat {
  background: transparent;
}

@media (max-width: 960px) {
  :root {
    --shell: min(100%, calc(100% - 1.4rem));
  }

  .site-header {
    grid-template-columns: 1fr auto;
    border-radius: 18px;
  }

  .nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 2rem;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .stats-layout {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .stats-bar,
  .steps,
  .case-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat + .stat {
    border-inline-start: 0;
  }

  .stats-bar {
    gap: 0.55rem;
    padding: 0.7rem;
  }

  .stat {
    background: var(--surface-3);
    border-radius: 14px;
  }

  html[data-theme="light"] .stat {
    background: #f8fafc;
  }

  .info-bar,
  .site-footer,
  .result-card,
  .dev-credit,
  .modal-actions,
  .compare-inputs,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .compare-inputs .btn-primary {
    width: 100%;
  }

  .mobile-search-bar {
    display: inline-flex;
  }

  .shell {
    padding-bottom: 4.5rem;
  }

  .modal-card {
    width: min(100%, 560px);
    padding: 1.35rem 1.1rem 1.1rem;
  }

  .modal-card h2,
  .result-view h1 {
    font-size: 1.35rem;
  }

  .modal-box strong {
    font-size: 1.4rem;
  }

  .modal-box {
    min-height: 96px;
  }

  .info-bar {
    align-items: stretch;
  }

  .info-cta {
    justify-content: center;
  }

  .footer-note,
  .footer-meta {
    text-align: right;
  }

  .result-card .open-hint {
    justify-self: start;
  }

  .dev-credit {
    flex-wrap: wrap;
  }

  .panel-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 580px) {
  .feature-grid,
  .stats-bar,
  .steps,
  .case-grid,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    top: 0.5rem;
    padding: 0.65rem;
  }

  .search-card,
  .results-panel {
    padding: 1.15rem;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.brand-mark {
  box-shadow: 0 10px 24px rgba(62, 160, 255, 0.28);
}
.search-card {
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
}
.site-header {
  backdrop-filter: blur(14px);
}
