:root {
  --bg: #f3f0ea;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --line: rgba(15, 23, 42, 0.08);
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(180, 83, 9, 0.12), transparent 22%),
    linear-gradient(180deg, #f8f5ef 0%, #eef3f2 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar h1,
.content-header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 1.8vw, 2.2rem);
}

.search-field input {
  width: min(360px, 78vw);
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  min-height: 0;
}

.sidebar {
  padding: 28px 18px 32px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(8px);
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.sidebar-header p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.category-nav {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.nav-all-button {
  width: 100%;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-strong, var(--accent));
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.nav-all-button.is-active,
.nav-all-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.nav-group summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.1rem;
}

.nav-group[open] summary::after {
  content: "-";
}

.nav-subitems {
  display: grid;
  gap: 8px;
  padding: 0 12px 14px;
}

.nav-section-title {
  margin: 8px 4px 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.nav-subitems button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav-subitems button:hover,
.nav-subitems button.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.content {
  padding: 28px 28px 36px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 20px;
}

.result-meta {
  margin: 0;
  color: var(--muted);
}

.status-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(180, 83, 9, 0.12);
  color: #9a3412;
  border: 1px solid rgba(180, 83, 9, 0.12);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.grouped-results {
  grid-template-columns: 1fr;
}

.result-section {
  display: grid;
  gap: 16px;
}

.result-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-section-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.result-section-body {
  display: grid;
  gap: 18px;
}

.result-subgroup {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.result-subgroup-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.result-subgroup-header h4 {
  margin: 0;
  font-size: 1.05rem;
}

.result-subgroup-header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
  font-weight: 700;
}

.subgroup-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.result-subgroup-empty {
  margin: 0;
  color: var(--muted);
}

.person-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.person-summary {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 16px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 18px;
  text-align: left;
  cursor: pointer;
}

.avatar {
  width: 84px;
  aspect-ratio: 1;
  border-radius: 24px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.25), rgba(180, 83, 9, 0.18));
}

.person-main {
  min-width: 0;
}

.person-main h3 {
  margin: 0;
  font-size: 1.1rem;
}

.person-quick {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.expand-indicator {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent);
  font-size: 1.2rem;
}

.person-card.is-open .expand-indicator {
  transform: rotate(45deg);
}

.detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 1) 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
}

.detail-grid dt,
.detail-grid dd {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.detail-grid dt {
  background: rgba(241, 245, 249, 0.7);
  font-weight: 700;
  color: #475467;
}

.detail-grid dd {
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.detail-grid dt:last-of-type,
.detail-grid dd:last-of-type {
  border-bottom: 0;
}

.empty-state {
  padding: 42px 28px;
  border: 1px dashed rgba(15, 118, 110, 0.25);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(88vh, 980px);
  overflow: auto;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  padding: 28px;
}

.modal-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent);
  font-size: 1.6rem;
  cursor: pointer;
}

.modal-person {
  display: grid;
  gap: 22px;
}

.modal-hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.modal-avatar {
  width: 220px;
  aspect-ratio: 0.9;
  border-radius: 28px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.25), rgba(180, 83, 9, 0.18));
}

.modal-top-table {
  min-width: 0;
  align-self: start;
}

.modal-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .topbar,
  .content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar,
  .content-header {
    flex-direction: column;
    align-items: stretch;
  }

  .search-field input {
    width: 100%;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .person-summary {
    grid-template-columns: 72px 1fr;
  }

  .expand-indicator {
    grid-column: 2;
    justify-self: end;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid dd {
    border-left: 0;
  }

  .modal {
    padding: 12px;
  }

  .modal-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .modal-hero {
    grid-template-columns: 1fr;
  }

  .modal-avatar {
    width: 120px;
  }

  .modal-details {
    grid-template-columns: 1fr;
  }
}
