:root {
  color-scheme: light;
  --ink: #1b2638;
  --muted: #758196;
  --line: #e5eaf0;
  --paper: #ffffff;
  --canvas: #f5f7fa;
  --blue: #2458d3;
  --blue-dark: #1e48ae;
  --green: #147d61;
  --amber: #a85a08;
  --red: #bf3b44;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 8% 0, rgba(220, 231, 255, .7), transparent 34rem),
    var(--canvas);
}

button, input { font: inherit; }

.page {
  width: min(100% - 40px, 920px);
  margin: 0 auto;
  padding: 58px 0 28px;
}

.hero {
  display: flex;
  align-items: center;
  gap: 19px;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  border-radius: 17px;
  background: var(--blue);
  box-shadow: 0 9px 20px rgba(36, 88, 211, .19);
  color: white;
  font-family: Manrope, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.06em;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Manrope, "Segoe UI", sans-serif; letter-spacing: -.04em; }
h1 { margin-bottom: 7px; font-size: clamp(26px, 4vw, 36px); line-height: 1.12; }
h2 { margin-bottom: 0; font-size: 20px; }
.intro { margin-bottom: 0; color: var(--muted); font-size: 14px; }

.panel {
  border: 1px solid rgba(224, 230, 239, .9);
  border-radius: 17px;
  background: var(--paper);
  box-shadow: 0 15px 45px rgba(29, 49, 82, .055);
}

.search-panel { padding: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.search-panel > .section-heading { margin-bottom: 25px; }
.private-note, .result-count { color: var(--muted); font-size: 12px; }
.private-note::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #37a783; }

.name-fields, .options { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 8px; color: #3a4659; font-size: 12px; font-weight: 600; }
.field small { margin-left: 4px; color: #939daf; font-size: 11px; font-weight: 400; }
.field input {
  width: 100%;
  min-height: 45px;
  border: 1px solid #dfe5ed;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  padding: 0 13px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #a5adba; }
.field input:focus { border-color: #7393e6; box-shadow: 0 0 0 3px rgba(36, 88, 211, .1); }
.name-fields { margin-bottom: 19px; }
.options { align-items: start; }
.top-control { display: flex; gap: 8px; }
.top-control > input { width: 82px; }
.quick-values { display: flex; align-items: center; gap: 5px; }
.quick-value {
  min-width: 42px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #5c687b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.quick-value:hover { border-color: #a8bbed; color: var(--blue); }
.quick-value.selected { border-color: #cbd8fa; background: #f0f4ff; color: var(--blue); }

.advanced-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 21px;
  padding-top: 18px;
  border-top: 1px solid #edf0f4;
}
.check-field { display: flex; align-items: center; gap: 9px; color: #485568; font-size: 12px; cursor: pointer; }
.check-field input { width: 15px; height: 15px; accent-color: var(--blue); }
.key-field { width: min(310px, 52%); }
.key-field input { min-height: 38px; }

.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; }
.hint { margin: 0; color: var(--muted); font-size: 11px; }
code { border-radius: 4px; background: #f0f2f6; padding: 2px 5px; color: #44516a; }
.search-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 17px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  padding: 0 16px;
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background .15s, transform .15s;
}
.search-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.search-button:disabled { opacity: .65; cursor: wait; transform: none; }

.status { margin: 17px 0; border-radius: 9px; padding: 12px 15px; font-size: 13px; }
.status.error { border: 1px solid #f1d1d3; background: #fff6f6; color: #a42c36; }
.status.loading { border: 1px solid #d8e2fb; background: #f4f7ff; color: #3556a5; }
.results-section { margin-top: 36px; }
.results-heading { margin-bottom: 15px; }
.result-count { border: 1px solid var(--line); border-radius: 20px; background: white; padding: 6px 10px; }
.results-list { display: grid; gap: 10px; }
.result-card { border: 1px solid var(--line); border-radius: 12px; background: white; padding: 17px 19px; }
.result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.match-names { min-width: 0; }
.match-names h3 { overflow-wrap: anywhere; margin: 0 0 4px; font-family: Manrope, sans-serif; font-size: 16px; letter-spacing: -.025em; }
.match-names p { overflow-wrap: anywhere; margin: 0; color: #69768a; font-size: 13px; }
.match-names .arabic-name { margin-bottom: 4px; color: #35445a; font-size: 15px; }
.risk-score { flex: 0 0 auto; text-align: right; }
.score { font-family: Manrope, sans-serif; font-size: 21px; font-weight: 800; letter-spacing: -.04em; }
.score-label { display: block; color: #8b95a5; font-size: 10px; }
.risk { display: inline-block; margin-top: 7px; border-radius: 20px; padding: 4px 8px; font-size: 9px; font-weight: 700; letter-spacing: .05em; }
.risk-high { background: #fff0ef; color: var(--red); }
.risk-medium { background: #fff4e5; color: var(--amber); }
.risk-low { background: #eaf7f2; color: var(--green); }
.match-type { display: inline-block; margin-top: 7px; border: 1px solid #dce6ff; border-radius: 20px; background: #f5f8ff; padding: 4px 8px; color: #445574; font-size: 10px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.meta-chip { border: 1px solid #edf0f4; border-radius: 5px; background: #fafbfc; padding: 4px 7px; color: #677386; font-size: 10px; }
.result-why { margin: 10px 0 0; color: #6d798b; font-size: 11px; line-height: 1.5; }
.analysis-card { margin-bottom: 13px; border: 1px solid #dce6ff; border-radius: 10px; background: #f5f8ff; padding: 14px 16px; color: #445574; font-size: 12px; line-height: 1.55; }
footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 34px; color: #8a94a3; font-size: 11px; }
footer a { color: #63728a; text-decoration: none; }
footer a:hover { color: var(--blue); }

[hidden] { display: none !important; }

@media (max-width: 620px) {
  .page { width: min(100% - 26px, 920px); padding-top: 30px; }
  .hero { align-items: flex-start; gap: 13px; margin-bottom: 22px; }
  .brand-mark { width: 45px; height: 45px; flex-basis: 45px; border-radius: 14px; }
  .intro { max-width: 420px; font-size: 12px; line-height: 1.5; }
  .search-panel { padding: 20px 16px; }
  .section-heading { align-items: flex-start; }
  .private-note { max-width: 125px; text-align: right; line-height: 1.4; }
  .name-fields, .options { grid-template-columns: 1fr; gap: 15px; }
  .advanced-options { align-items: flex-start; flex-direction: column; gap: 15px; }
  .key-field { width: 100%; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .search-button { width: 100%; justify-content: space-between; }
  .result-card { padding: 14px; }
  footer { flex-direction: column; }
}
