:root {
  --red: #cf2030;
  --red-dark: #a3121f;
  --ink: #1f2227;
  --muted: #5d636e;
  --line: #e3e5ea;
  --bg: #f5f6f8;
  --card: #ffffff;
  --soft: #fbecee;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--red-dark); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; }

/* Header band */
.band {
  background: var(--red);
  color: #fff;
  padding: 36px 0 30px;
}
.band .eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
}
.band h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.1;
  font-weight: 800;
}
.band p { margin: 10px 0 0; max-width: 620px; opacity: 0.95; }
.band a { color: #fff; }

/* Buttons and inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--red);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { background: #fff; color: var(--red-dark); }
.btn.ghost:hover { background: var(--soft); }
.btn.small { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.band .btn.ghost { border-color: #fff; }

input, textarea, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #c9cdd5;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
textarea { min-height: 96px; resize: vertical; }

/* Directory */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 22px 0 14px;
}
.toolbar input { flex: 1 1 260px; }
.toolbar select { flex: 0 1 240px; }
.count { color: var(--muted); font-size: 14px; margin: 0 0 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding-bottom: 40px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card-head { display: flex; gap: 14px; align-items: center; }
.avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
  color: var(--red-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 22px;
}
.card h2 { margin: 0; font-size: 18px; line-height: 1.25; }
.card .person { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.tag {
  align-self: flex-start;
  background: var(--soft);
  color: var(--red-dark);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 600;
}
.card p { margin: 0; }
.card .area { color: var(--muted); font-size: 14px; }
.card .referral { font-size: 14px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }

.empty {
  text-align: center;
  padding: 50px 16px;
  color: var(--muted);
  grid-column: 1 / -1;
}

footer.site {
  border-top: 1px solid var(--line);
  padding: 22px 0 36px;
  color: var(--muted);
  font-size: 14px;
}

/* Form */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  margin: 22px 0 40px;
}
fieldset { border: 0; margin: 0 0 18px; padding: 0; }
legend { font-weight: 700; font-size: 17px; margin-bottom: 10px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.field .hint { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.req { color: var(--red); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

.photo-pick { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.photo-pick .avatar { width: 80px; height: 80px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: auto; margin-top: 4px; }
.hp { position: absolute; left: -9999px; }

.notice { border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.notice.error { background: #fdecee; color: #8a1020; }
.notice.ok { background: #eaf6ee; color: #1d5a32; }
.notice code { word-break: break-all; }

[hidden] { display: none !important; }

.break { overflow-wrap: anywhere; }
