:root {
  color-scheme: light dark;
  --bg: #f5faf6;
  --bg-deep: #eaf4ed;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.58);
  --surface-strong: #ffffff;
  --ink: #18251c;
  --ink-soft: #405246;
  --muted: #6d7e72;
  --faint: #94a199;
  --line: rgba(49, 91, 61, 0.12);
  --line-strong: rgba(49, 91, 61, 0.2);
  --primary: #679777;
  --primary-strong: #3f6a50;
  --primary-soft: #e5f3e9;
  --primary-faint: #f0f8f2;
  --accent: #d4a45f;
  --accent-soft: #fff3df;
  --success: #2f7b58;
  --success-soft: #e3f5eb;
  --success-line: rgba(47, 123, 88, 0.18);
  --danger: #a8454d;
  --danger-soft: #fbecee;
  --shadow-sm: 0 8px 24px rgba(34, 67, 45, 0.06);
  --shadow-md: 0 22px 60px rgba(34, 67, 45, 0.1);
  --shadow-hero: 0 24px 70px rgba(34, 67, 45, 0.1);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --header-height: 76px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC",
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101812;
    --bg-deep: #162119;
    --surface: rgba(28, 41, 32, 0.9);
    --surface-solid: #1d2b21;
    --surface-soft: rgba(35, 50, 39, 0.72);
    --surface-strong: #243429;
    --ink: #eef7f0;
    --ink-soft: #d3e2d6;
    --muted: #aab9ae;
    --faint: #849489;
    --line: rgba(210, 235, 216, 0.12);
    --line-strong: rgba(210, 235, 216, 0.2);
    --primary: #9ac8a8;
    --primary-strong: #c0e3ca;
    --primary-soft: #294334;
    --primary-faint: #22372b;
    --accent: #e6bd7d;
    --accent-soft: #443723;
    --success: #8ed4aa;
    --success-soft: #1d3b2b;
    --success-line: rgba(142, 212, 170, 0.2);
    --danger: #f0a0a7;
    --danger-soft: #42262a;
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 24px 65px rgba(0, 0, 0, 0.3);
    --shadow-hero: 0 30px 90px rgba(0, 0, 0, 0.32);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 2%, rgba(187, 226, 197, 0.48), transparent 30rem),
    radial-gradient(circle at 92% 18%, rgba(242, 220, 169, 0.25), transparent 28rem),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(67, 111, 80, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 111, 80, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black, transparent 65%);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg .fill {
  fill: currentColor;
  stroke: none;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  top: 28rem;
  left: -12rem;
  width: 28rem;
  height: 28rem;
  background: radial-gradient(circle, rgba(160, 210, 174, 0.17), transparent 68%);
}

.ambient-two {
  right: -14rem;
  bottom: 8rem;
  width: 32rem;
  height: 32rem;
  background: radial-gradient(circle, rgba(232, 204, 146, 0.14), transparent 68%);
}

.noscript-banner {
  padding: 12px 20px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

.header-inner,
.page-shell {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  border-radius: 14px;
}

.brand:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 4px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: linear-gradient(145deg, #8cba98, #4d7a5c);
  color: #fff;
  box-shadow: 0 9px 24px rgba(64, 111, 80, 0.22);
  transform: rotate(-3deg);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.brand-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.button,
.icon-button,
.sort-button,
.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease,
    transform 160ms ease, box-shadow 160ms ease;
}

.button {
  min-height: 42px;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 24%, transparent);
}

.button-primary:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.button-soft {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}

.button-soft:hover {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  color: var(--primary-strong);
  transform: translateY(-1px);
}

.button-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-soft);
}

.button-ghost:hover {
  background: var(--surface-soft);
}

.button-danger {
  background: var(--danger);
  color: #fff;
}

.button-danger:hover {
  filter: brightness(0.93);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-color: var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--primary);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 2px;
}

.menu-wrap {
  position: relative;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 252px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-md);
  animation: menu-in 150ms ease both;
}

.menu-panel[hidden] {
  display: none;
}

.menu-panel button {
  display: flex;
  width: 100%;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.menu-panel button:hover {
  background: var(--primary-faint);
  color: var(--ink);
}

.menu-panel button > svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  color: var(--muted);
}

.menu-panel button > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.menu-panel button strong {
  font-size: 13px;
  font-weight: 650;
}

.menu-panel button small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}

.menu-panel .danger-item {
  color: var(--danger);
}

.menu-panel .danger-item > svg {
  color: var(--danger);
}

.menu-divider {
  height: 1px;
  margin: 6px 8px;
  background: var(--line);
}

.page-shell {
  padding: 34px 0 34px;
}

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

.overview {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary-faint) 78%, var(--surface-solid)), var(--surface-solid));
  box-shadow: var(--shadow-sm);
}

.overview::before {
  position: absolute;
  top: -9rem;
  right: -7rem;
  width: 23rem;
  height: 23rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 214, 180, 0.3), transparent 68%);
  content: "";
  pointer-events: none;
}

.progress-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.72fr);
  gap: 30px;
  align-items: center;
  padding: 24px 30px;
}

.progress-card-head {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.section-kicker {
  display: block;
  margin: 0 0 5px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.progress-number {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin: 0;
  color: var(--ink);
  line-height: 1.1;
}

.progress-number strong {
  font-size: 38px;
  font-weight: 760;
  letter-spacing: -0.05em;
}

.progress-number span {
  color: var(--muted);
  font-size: 13px;
}

.progress-number span span {
  font-size: inherit;
}

.progress-caption {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.progress-ring {
  --progress: 0deg;
  display: grid;
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--progress), var(--primary-soft) 0);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 10%, transparent);
}

.progress-ring-inner {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-solid);
}

.progress-ring strong {
  color: var(--primary);
  font-size: 17px;
  font-weight: 750;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--line);
}

.stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface-solid);
}

.stat-item span {
  color: var(--muted);
  font-size: 11px;
}

.stat-item strong {
  font-size: 18px;
  font-weight: 740;
}

.stat-item:last-child strong {
  color: var(--success);
}

.workspace {
  position: relative;
  z-index: 5;
  margin-top: 24px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(15px);
}

.search-row {
  display: flex;
  gap: 12px;
}

.search-box {
  display: flex;
  min-width: 0;
  height: 50px;
  flex: 1;
  gap: 11px;
  align-items: center;
  padding: 0 13px 0 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-solid);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box:focus-within {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 9%, transparent);
}

.search-box > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--faint);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.search-box input::placeholder {
  color: var(--faint);
}

.search-box kbd {
  min-width: 24px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--faint);
  font-family: inherit;
  font-size: 10px;
  text-align: center;
}

.search-clear {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.search-clear:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.search-clear svg {
  width: 15px;
  height: 15px;
}

.sort-button {
  height: 50px;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-solid);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.sort-button:hover {
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.sort-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--primary) 22%, var(--line));
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.sort-button svg {
  width: 18px;
  height: 18px;
}

.filter-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
}

.segmented {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.segmented button {
  min-height: 34px;
  padding: 5px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.segmented button span {
  margin-left: 3px;
  opacity: 0.65;
  font-weight: 500;
}

.segmented button:hover {
  color: var(--ink-soft);
}

.segmented button.is-active {
  background: var(--surface-solid);
  color: var(--primary-strong);
  box-shadow: 0 3px 11px rgba(55, 35, 76, 0.08);
}

.day-filters {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.day-filters::-webkit-scrollbar {
  display: none;
}

.day-chip {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.day-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.day-chip.is-active {
  border-color: color-mix(in srgb, var(--primary) 22%, var(--line));
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.results {
  margin-top: 32px;
}

.results-head {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 3px;
}

.results-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.results-head h2 span {
  display: inline-grid;
  min-width: 26px;
  height: 24px;
  margin-left: 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 3px;
}

.result-summary {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.person-card {
  --avatar-hue: 270;
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 252px;
  flex-direction: column;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface-solid);
  box-shadow: 0 10px 30px rgba(60, 38, 82, 0.045);
  animation: card-in 360ms cubic-bezier(0.2, 0.7, 0.25, 1) both;
  animation-delay: calc(var(--card-index, 0) * 24ms);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.person-card::after {
  position: absolute;
  top: -48px;
  right: -42px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, hsla(var(--avatar-hue), 65%, 75%, 0.13), transparent 68%);
  content: "";
  pointer-events: none;
}

.person-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 18px 46px rgba(60, 38, 82, 0.09);
  transform: translateY(-3px);
}

.person-card.is-contacted {
  border-color: var(--success-line);
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--success-soft) 70%, var(--surface-solid)), var(--surface-solid));
}

.card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid hsla(var(--avatar-hue), 56%, 45%, 0.12);
  border-radius: 15px;
  background: hsl(var(--avatar-hue), 67%, 92%);
  color: hsl(var(--avatar-hue), 45%, 38%);
  font-size: 18px;
  font-weight: 730;
  line-height: 1;
}

.card-identity {
  min-width: 0;
  flex: 1;
  padding-top: 1px;
}

.card-identity h3 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 730;
  letter-spacing: -0.015em;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.tag {
  max-width: 100%;
  padding: 2px 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--primary-faint);
  color: var(--primary-strong);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.65;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-neutral {
  background: var(--surface-soft);
  color: var(--muted);
}

.contact-badge {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  align-items: center;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 9px;
  font-weight: 700;
}

.contact-badge svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.5;
}

.card-note {
  display: -webkit-box;
  min-height: 45px;
  margin: 15px 0 13px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-note.is-empty {
  color: var(--faint);
  font-style: italic;
}

.id-row {
  display: flex;
  min-width: 0;
  gap: 5px;
  align-items: center;
  margin-top: auto;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
}

.id-row > span:first-child {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.id-value {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  display: grid;
  width: 24px;
  height: 22px;
  flex: 0 0 auto;
  margin: -4px -4px -4px 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.copy-button:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.copy-button svg {
  width: 13px;
  height: 13px;
}

.card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.contact-button,
.message-link {
  display: inline-flex;
  min-height: 37px;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease,
    transform 150ms ease;
}

.contact-button {
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--ink-soft);
}

.contact-button:hover {
  border-color: var(--success-line);
  background: var(--success-soft);
  color: var(--success);
}

.contact-button.is-contacted {
  border-color: transparent;
  background: var(--success);
  color: #fff;
}

.contact-button svg,
.message-link svg {
  width: 14px;
  height: 14px;
}

.message-link {
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--line));
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.message-link:hover {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  background: color-mix(in srgb, var(--primary-soft) 78%, var(--primary));
  transform: translateY(-1px);
}

.message-link.is-disabled {
  background: var(--surface-soft);
  color: var(--faint);
  cursor: not-allowed;
  opacity: 0.65;
  pointer-events: none;
}

.empty-state {
  padding: 68px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-icon {
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary);
  transform: rotate(-4deg);
}

.empty-icon svg {
  width: 28px;
  height: 28px;
}

.empty-state h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.empty-state p {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-top: 38px;
  padding: 20px 3px 2px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
}

.site-footer p {
  margin: 0;
}

.site-footer strong {
  color: var(--muted);
  font-weight: 600;
}

.site-footer a {
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 650;
}

.modal {
  width: min(440px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: 0 30px 100px rgba(18, 7, 30, 0.3);
}

.modal::backdrop {
  background: rgba(29, 17, 42, 0.5);
  backdrop-filter: blur(5px);
}

.modal[open] {
  animation: modal-in 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal form {
  position: relative;
  padding: 30px;
}

.modal-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 15px;
  background: var(--primary-soft);
  color: var(--primary);
}

.danger-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.modal-icon svg {
  width: 23px;
  height: 23px;
}

.modal h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.modal p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.modal-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 25px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-close svg {
  width: 17px;
  height: 17px;
}

.help-modal {
  width: min(590px, calc(100% - 32px));
}

.help-modal pre {
  max-height: 280px;
  margin: 16px 0 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-deep);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.help-modal code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.help-modal p code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--primary-strong);
}

.help-modal .help-note {
  font-size: 11px;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  padding: 24px;
  place-items: center;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(12px);
  transition: opacity 160ms ease;
}

.drop-overlay.is-visible {
  opacity: 1;
}

.drop-overlay > div {
  display: flex;
  width: min(500px, 100%);
  min-height: 260px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed color-mix(in srgb, var(--primary) 38%, transparent);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow-hero);
  text-align: center;
}

.drop-overlay svg {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  color: var(--primary);
}

.drop-overlay strong {
  font-size: 20px;
}

.drop-overlay span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 100;
  display: flex;
  max-width: calc(100% - 32px);
  gap: 9px;
  align-items: center;
  padding: 11px 16px 11px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-solid);
  color: var(--ink-soft);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--success-soft);
  color: var(--success);
}

.toast-icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.toast.is-error .toast-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1050px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  :root {
    --header-height: 68px;
  }

  .header-inner,
  .page-shell {
    width: min(100% - 28px, 680px);
  }

  .brand-copy span {
    display: none;
  }

  .page-shell {
    padding-top: 16px;
  }

  .progress-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px;
  }

  .overview {
    border-radius: 22px;
  }

  .filter-row {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

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

  .segmented button {
    justify-content: center;
  }

  .card-grid {
    gap: 12px;
  }
}

@media (max-width: 620px) {
  .import-button span {
    display: none;
  }

  .import-button {
    width: 42px;
    padding: 0;
  }

  .search-row {
    flex-direction: column;
  }

  .search-box,
  .sort-button {
    width: 100%;
  }

  .search-box kbd {
    display: none;
  }

  .sort-button {
    height: 42px;
  }

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

  .person-card {
    min-height: 230px;
  }

  .results-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .modal form {
    padding: 25px 22px;
  }

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

  .modal-actions .button:only-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .header-inner,
  .page-shell {
    width: calc(100% - 22px);
  }

  .progress-card {
    padding: 18px;
  }

  .overview {
    border-radius: 19px;
  }

  .progress-card-head {
    gap: 12px;
  }

  .progress-ring {
    width: 78px;
    height: 78px;
  }

  .progress-ring-inner {
    width: 60px;
    height: 60px;
  }

  .workspace {
    padding: 12px;
    border-radius: 19px;
  }

  .segmented button {
    padding-right: 5px;
    padding-left: 5px;
  }

  .person-card {
    padding: 16px;
  }

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

  .message-link {
    min-height: 35px;
  }
}

@media (hover: hover) {
  .message-link:hover svg,
  .sort-button:hover svg,
  .button:hover svg {
    transform: translate(1px, -1px);
  }

  .message-link svg,
  .sort-button svg,
  .button svg {
    transition: transform 150ms ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
