:root {
  --page: #edf2f3;
  --surface: #ffffff;
  --surface-soft: #f5f8f8;
  --ink: #102b38;
  --muted: #60727a;
  --line: #d7e0e3;
  --accent: #d24b4b;
  --accent-dark: #bd3939;
  --navy: #153a4b;
  --danger: #a43c3c;
  --shadow: 0 24px 70px rgba(28, 55, 66, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(210, 75, 75, 0.12), transparent 34rem),
    linear-gradient(180deg, #f8faf9 0%, var(--page) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(210, 75, 75, 0.28);
  outline-offset: 3px;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 28px;
}

.app-card {
  overflow: hidden;
  border: 1px solid rgba(192, 207, 212, 0.8);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(24px, 5vw, 56px);
}

.flyer-frame {
  display: grid;
  width: 100%;
  min-height: 280px;
  max-height: 560px;
  margin: 0;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
  box-shadow: 0 16px 42px rgba(22, 51, 63, 0.1);
}

.flyer-image {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
}

.search-panel {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  max-width: 14ch;
  margin: 0;
  color: var(--navy);
  font-size: clamp(2rem, 4.5vw, 3.45rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.intro {
  max-width: 50ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.13rem);
  line-height: 1.6;
}

.search-form {
  margin-top: 30px;
}

.search-form > label {
  display: block;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 58px;
  border: 1px solid #bdcbd0;
  border-radius: 12px;
  padding: 0 17px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1rem;
  box-shadow: inset 0 1px 2px rgba(25, 48, 58, 0.04);
}

input::placeholder {
  color: #8b9aa0;
}

input:disabled {
  background: #f1f4f5;
  cursor: wait;
}

.primary-button,
.secondary-button {
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  padding: 0 24px;
  cursor: pointer;
  font-weight: 800;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(210, 75, 75, 0.2);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.search-help {
  margin: 8px 0 0;
  color: #77888f;
  font-size: 0.82rem;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  padding: 13px 15px;
  border: 1px solid #dbe6e5;
  border-radius: 12px;
  background: #f3f8f7;
  color: #50676a;
}

.privacy-note p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
}

.privacy-mark {
  display: inline-grid;
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid #81aaa7;
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
}

.status {
  min-height: 22px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.status.is-error {
  color: var(--danger);
  font-weight: 750;
}

.pwa-status {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
}

.secondary-button {
  min-height: 44px;
  margin-top: 10px;
  border: 1px solid #dfb0b0;
  padding: 0 16px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 0.86rem;
  box-shadow: none;
}

.secondary-button:hover {
  background: #fff3f3;
}

.results {
  scroll-margin-top: 16px;
  padding: 34px clamp(24px, 5vw, 56px) clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--line);
  background: #f7f9f9;
}

.results-heading {
  margin: 0 0 18px;
  color: var(--navy);
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.detail-card,
.person-card {
  border: 1px solid var(--line);
  background: var(--surface);
}

.detail-card {
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(25, 51, 62, 0.06);
}

.detail-card + .detail-card {
  margin-top: 16px;
}

.detail-card > h2 {
  margin: 0;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  font-size: 1.22rem;
}

.detail-grid,
.person-data {
  margin: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-grid > div {
  min-width: 0;
  padding: 17px 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-grid > div:nth-child(3n) {
  border-right: 0;
}

.detail-grid > div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

dt {
  margin: 0 0 5px;
  color: #73848b;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: var(--ink);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.people-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.person-card {
  overflow: hidden;
  border-radius: 14px;
}

.person-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px 18px 15px;
}

.person-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.35;
}

.masked-ci {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  background: #fff0f0;
  color: #8f3b3b;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.person-data {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 70px;
  border-top: 1px solid var(--line);
  background: #fbfcfc;
}

.person-data > div {
  min-width: 0;
  padding: 13px 18px;
  border-right: 1px solid var(--line);
}

.person-data > div:last-child {
  border-right: 0;
}

.person-data dd {
  font-size: 0.86rem;
}

.page-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  padding: 20px 12px 0;
  color: #708087;
  font-size: 0.78rem;
  text-align: center;
}

noscript {
  display: block;
  padding: 20px;
  color: var(--danger);
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .flyer-frame {
    width: min(540px, 100%);
    max-height: none;
    margin: 0 auto;
  }

  .flyer-image {
    max-height: none;
  }

  h1 {
    max-width: none;
  }

  .people-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 16px, 1120px);
    padding-top: 8px;
  }

  .app-card {
    border-radius: 18px;
  }

  .hero-grid {
    gap: 26px;
    padding: 14px 14px 28px;
  }

  .flyer-frame {
    min-height: 180px;
    border-radius: 12px;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 2.8rem);
  }

  .search-controls {
    grid-template-columns: 1fr;
  }

  .primary-button {
    width: 100%;
  }

  .results {
    padding: 26px 14px 30px;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid > div,
  .detail-grid > div:nth-child(3n) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .detail-grid > div:nth-child(2n) {
    border-right: 0;
  }

  .detail-grid > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .person-header {
    flex-direction: column;
    gap: 9px;
  }

  .person-data {
    grid-template-columns: minmax(0, 1fr) 64px 64px;
  }

  .person-data > div {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
