/* People Log: a midnight-blue personal journal.
   Native CSS, self-hosted Anuphan, and licensed Phosphor icons. */
@font-face {
  font-family: PeopleAnuphan;
  src: url("/assets/fonts/anuphan-400-700.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0E00-0E7F, U+200C-200D, U+25CC;
}
@font-face {
  font-family: PeopleAnuphan;
  src: url("/assets/fonts/anuphan-latin-400-700.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF;
}
:root {
  --bg: #030712;
  --surface: #0d1422;
  --surface-soft: #151d2b;
  --border: #2c3443;
  --text: #f0f0f5;
  --text-muted: #a4aabc;
  --accent: #d8b65b;
  --accent-hover: #e7ca7b;
  --accent-soft: #25231c;
  --gold: var(--accent);
  --gold-light: var(--accent);
  --gold-dim: var(--accent-soft);
  --blue: #9cc8eb;
  --cyan: #8ad7da;
  --violet: #cfb4ed;
  --danger: #f3a2ab;
  --status-all: #d8b65b;
  --status-active: #a0ded5;
  --status-dormant: #e6bf85;
  --status-drifted: #a4c3d2;
  --status-memory: #cfb4ed;
  --status-birthday: #f2abc9;
  --radius: 14px;
  --font-body: PeopleAnuphan, "Leelawadee UI", sans-serif;
  --font-head: var(--font-body);
  color-scheme: dark;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
body {
  --aknav-focus: var(--accent);
  margin: 0;
  min-height: 100vh;
  padding-top: 64px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}
button,
input,
select,
textarea {
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
::selection {
  background: #65542d;
  color: var(--text);
}
.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;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.ui-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  fill: currentColor;
  vertical-align: middle;
  pointer-events: none;
}
/* Page-local nav palette, preserving the AUDIKUNG mark and generated navigation. */
.aknav,
.aknav-mobile {
  --aknav-bg: #050912;
  --aknav-text: var(--text);
  --aknav-muted: var(--text-muted);
  --aknav-gold: #c9a84c;
  --aknav-gold-light: #e5c586;
  --aknav-border: var(--border);
  --aknav-head: var(--font-body);
  --aknav-body: var(--font-body);
  --aknav-focus: var(--accent);
}
.aknav {
  border-bottom: 1px solid var(--border);
  box-shadow: none !important;
}
body .aknav,
body .aknav-mobile {
  background: #050912;
}
body .aknav-logo {
  text-shadow: none;
}
body .auth-nav-login {
  color: var(--accent);
  background: #16181b;
  border-color: #625332;
}
body .auth-modal,
body .setup-modal,
body .pd-wrap {
  background: var(--surface);
  border-color: var(--border);
}
body .auth-input {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
body .auth-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
body .auth-label,
body .auth-anon-note,
body .auth-forgot,
body .auth-modal-close,
body .auth-tab {
  color: var(--text-muted);
}
body .auth-input:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.aknav-logo img {
  border-radius: 50%;
}
.aknav .aknav-logo {
  letter-spacing: 0.08em;
  font-size: 1.1rem;
}
.aknav-burger span {
  background: var(--text) !important;
}
.people-shell {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  column-gap: 40px;
  row-gap: 32px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 40px 32px;
}
.people-hero {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 32px;
  border-bottom: 1px solid var(--border);
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.recall-action {
  color: var(--text);
  min-height: 48px;
}
.hero-heading {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}
.hero-mark {
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%, var(--surface) 100%);
  fill: var(--accent);
  padding: 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
.people-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}
.private-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--accent);
  padding: 2px 8px;
  background: var(--accent-soft);
  border-radius: 99px;
}
.private-label .ui-icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}
.people-hero h1 {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.4;
  margin: 4px 0 6px;
}
.people-intro {
  font-size: 1rem;
  color: var(--text-muted);
}
.primary-action {
  --action-ink: #17130b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: var(--accent);
  color: var(--action-ink);
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 10px;
  min-height: 48px;
  white-space: nowrap;
}
.primary-action:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(216, 182, 91, 0.2);
}
.primary-action:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(216, 182, 91, 0.1);
}
.text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
  min-height: 44px;
  white-space: nowrap;
}
.text-action:hover {
  background: var(--surface-soft);
  border-color: #75623b;
  color: var(--text);
}
.link-action {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.875rem;
  padding: 8px;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.danger-action {
  border: 1px solid #67424e;
  background: #342334;
  color: var(--danger);
  padding: 8px 12px;
  border-radius: 8px;
  min-height: 44px;
  margin-left: auto;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 1.3rem;
  color: var(--text-muted);
}
.icon-btn:hover {
  background: var(--surface-soft);
  color: var(--accent);
}
.directory-sidebar {
  align-self: start;
  position: sticky;
  top: 96px;
  min-width: 0;
}
.sidebar-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 4px 12px 14px;
}
.filter-panel > summary {
  display: none;
}
.people-status-tabs {
  display: grid;
  gap: 5px;
}
.status-tab {
  --status-color: var(--status-all);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: left;
  min-height: 46px;
}
.status-tab .ui-icon {
  color: var(--status-color);
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}
.ui-emoji {
  display: inline-block;
  font-family:
    "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1em;
  line-height: 1;
  margin-inline-end: 0.45em;
  vertical-align: -0.05em;
  flex-shrink: 0;
}
.status-tab > .ui-emoji {
  width: 20px;
  text-align: center;
  font-size: 1.125rem;
  margin: 0;
}
.chip > .ui-emoji,
.birthday-strip h2 > .ui-emoji {
  margin-inline-end: 0;
}
.tab-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.status-tab[data-status="active"] {
  --status-color: var(--status-active);
}
.status-tab[data-status="dormant"] {
  --status-color: var(--status-dormant);
}
.status-tab[data-status="drifted"] {
  --status-color: var(--status-drifted);
}
.status-tab[data-status="memory"] {
  --status-color: var(--status-memory);
}
.status-tab[data-status="birthday"] {
  --status-color: var(--status-birthday);
}
.status-tab:hover {
  background: color-mix(in srgb, var(--status-color) 9%, var(--bg));
  color: var(--status-color);
}
.status-tab.active {
  background: color-mix(in srgb, var(--status-color) 15%, var(--bg));
  border-color: color-mix(in srgb, var(--status-color) 35%, var(--bg));
  color: var(--status-color);
  font-weight: 600;
}
.status-tab:focus-visible {
  outline-color: var(--status-color);
}
.tab-count {
  font-size: 0.75rem;
  line-height: 1.6;
  padding: 1px 7px;
  min-width: 23px;
  text-align: center;
  border-radius: 5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  background: var(--surface);
}
.status-tab.active .tab-count,
.status-tab:hover .tab-count {
  color: var(--status-color);
}
.tab-birthday {
  margin-top: 12px;
}
.sidebar-bottom {
  border-top: 1px solid var(--border);
  margin: 26px 0 0;
  padding: 20px 12px 0;
}
.people-summary {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.8;
}
.people-storage-bar {
  display: grid;
  gap: 14px;
}
.people-privacy {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.people-privacy summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  min-height: 44px;
  list-style: none;
}
.people-privacy summary::-webkit-details-marker {
  display: none;
}
.people-privacy summary .ui-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}
.people-privacy summary::after {
  content: "⌄";
  margin-left: auto;
}
.people-privacy p {
  line-height: 1.9;
  padding: 8px 0 14px;
}
.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.backup-actions .text-action {
  border: 0;
  background: transparent;
  justify-content: flex-start;
  padding: 5px 0;
  font-size: 0.8125rem;
  width: 100%;
}
.backup-actions .ui-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}
.people-workspace {
  min-width: 0;
}
.recall-panel {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid #625332;
  border-radius: 12px;
}
.recall-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.recall-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
}
.recall-heading .icon-btn {
  margin: -10px -12px -10px 0;
}
.recall-person {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.recall-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  font-size: 1.6rem;
  color: var(--accent);
  background: #2b2923;
}
.recall-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recall-copy {
  min-width: 0;
  max-width: 65ch;
}
.recall-name {
  font-size: 1.375rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.recall-when {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 2px 0 12px;
}
.recall-clue,
.recall-note {
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}
.recall-clue {
  color: var(--text);
  margin-bottom: 6px;
}
.recall-note {
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}
.recall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 0 80px;
}
.recall-actions button {
  min-height: 44px;
  font-size: 0.875rem;
}
.people-shell.is-empty .people-toolbar,
.people-shell.is-empty .directory-controls,
.people-shell.is-empty .filter-panel {
  display: none;
}
.people-shell.is-empty .sidebar-bottom {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.people-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 12px 16px;
  background: #112f32;
  border: 1px solid #2c5d58;
  border-radius: 10px;
  color: #a0ded5;
  font-size: 0.875rem;
}

.migration-dialog {
  width: min(760px, calc(100vw - 32px));
}
.migration-row {
  border-top: 1px solid #2b3442;
  padding: 18px 0;
}
.migration-row h3 {
  margin: 0 0 10px;
}
.migration-preview {
  font-size: 0.875rem;
  margin: 12px 0 0;
}
.migration-preview > div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  margin: 8px 0;
}
.migration-preview dt {
  color: #a9b4c6;
  text-transform: capitalize;
}
.migration-preview dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.migration-dialog .form-actions {
  position: sticky;
  bottom: 0;
  background: #0d1422;
  padding: 16px 0;
}
.people-status[data-kind="error"] {
  background: #342334;
  color: #f4b3b8;
  border-color: #67424e;
}
.birthday-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: color-mix(in srgb, var(--status-birthday) 9%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--status-birthday) 30%, var(--bg));
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 24px;
}
.birthday-strip h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--status-birthday);
  font-weight: 600;
  margin-right: 8px;
}
.birthday-person {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  padding: 7px 12px;
  min-height: 44px;
  font-size: 0.875rem;
  color: var(--status-birthday);
}
.birthday-person span {
  font-size: 0.75rem;
}
.birthday-strip .link-action {
  color: var(--status-birthday);
}
.people-toolbar {
  margin-bottom: 20px;
}
.search-row {
  display: flex;
  gap: 12px;
}
.people-search {
  flex: 1;
  min-width: 0;
  position: relative;
}
.search-symbol {
  position: absolute;
  top: 15px;
  left: 16px;
  width: 21px;
  height: 21px;
  fill: var(--text-muted);
  pointer-events: none;
}
.people-search input {
  width: 100%;
  height: 52px;
  padding: 12px 16px 12px 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9375rem;
}
.people-search input::placeholder {
  color: var(--text-muted);
}
select {
  min-height: 44px;
  padding: 8px 30px 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  max-width: 100%;
  font-size: 0.875rem;
}
.filter-field select {
  height: 52px;
  width: 192px;
}
.directory-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
}
.result-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.result-label h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}
#people-result {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.directory-options {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sort-field {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.sort-field select {
  background: transparent;
  border: 0;
  font-size: 0.8125rem;
  max-width: 170px;
}
.view-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  background: var(--surface);
}
.view-switch button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  height: 36px;
  width: 40px;
}
.view-switch button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.people-list {
  display: grid;
  gap: 30px;
}
.people-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  padding: 0 0 16px;
  font-size: 0.9rem;
  font-weight: 600;
}
.people-category-header::-webkit-details-marker {
  display: none;
}
.people-category-header::before {
  content: "▸";
  color: var(--text-muted);
  transition: transform 0.15s;
}
.people-category-group[open] > .people-category-header::before {
  transform: rotate(90deg);
}
.people-category-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr));
  gap: 18px;
}
.person-card {
  --avatar-bg: #263f49;
  --avatar-ink: #acdbcd;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px 16px;
  transition:
    border-color 0.18s,
    transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.person-card.just-seen {
  animation: seen-confirm 650ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes seen-confirm {
  0% {
    background: #19332d;
  }
  100% {
    background: var(--surface);
  }
}
.person-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent) inset;
}
.person-card[data-tone="0"] {
  --avatar-bg: #1c3d40;
  --avatar-ink: #99e6d9;
}
.person-card[data-tone="1"] {
  --avatar-bg: #4a3820;
  --avatar-ink: #f5d499;
}
.person-card[data-tone="2"] {
  --avatar-bg: #1e3359;
  --avatar-ink: #a6c8ff;
}
.person-card[data-tone="3"] {
  --avatar-bg: #52273a;
  --avatar-ink: #ffb8d2;
}
.person-card[data-tone="4"] {
  --avatar-bg: #35265c;
  --avatar-ink: #d4bcf0;
}
.person-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.person-avatar {
  height: 60px;
  width: 60px;
  flex: 0 0 60px;
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--avatar-bg, var(--surface-soft));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--avatar-ink, var(--text)) 15%, transparent) inset;
}
.person-avatar img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  display: block;
}
.person-avatar-mono {
  display: grid;
  place-items: center;
  color: var(--avatar-ink);
  font-size: 1.5rem;
  font-weight: 500;
}
.person-card-titles {
  flex: 1;
  min-width: 0;
}
.person-name {
  font-size: 1.125rem;
  line-height: 1.5;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.person-age {
  font-size: 0.85em;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}
.person-rel {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.person-card-actions {
  display: flex;
  align-self: flex-start;
  margin-right: -10px;
  margin-top: -9px;
}
.person-card-actions .ui-icon {
  width: 18px;
  height: 18px;
}
.person-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.person-facts {
  display: grid;
  gap: 8px;
  margin: 0;
  font-size: 0.875rem;
}
.person-fact {
  display: grid;
  grid-template-columns: 85px minmax(0, 1fr);
  gap: 10px;
}
.person-fact dt {
  color: var(--text-muted);
}
.person-fact dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.person-fact.is-soon {
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--status-birthday) 12%, var(--surface));
}
.person-fact.is-soon dt,
.person-fact.is-soon dd {
  color: var(--status-birthday);
}
.person-note {
  color: #c4c7d1;
  font-size: 0.9375rem;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.person-note-details {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.person-note-details summary {
  cursor: pointer;
  min-height: 34px;
}
.person-note-details[open] .person-note {
  display: block;
}
.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.seen-action {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 0.8125rem;
  padding: 5px 0;
  min-height: 40px;
}
.card-footer-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.people-footnote {
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}
.people-list.is-list .people-grid {
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.people-list.is-list .person-card {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 1fr) 120px;
  gap: 8px 24px;
  align-items: center;
}
.people-list.is-list .person-card:last-child {
  border-bottom: 0;
}
.people-list.is-list .person-card:hover {
  transform: none;
  background: var(--surface-soft);
}
.people-list.is-list .person-card-head {
  grid-column: 1;
  grid-row: 1/3;
}
.people-list.is-list .person-badges,
.people-list.is-list .person-facts {
  grid-column: 2;
}
.people-list.is-list .person-note,
.people-list.is-list .person-note-details {
  grid-column: 1/3;
}
.people-list.is-list .card-footer {
  grid-column: 3;
  grid-row: 1/3;
  display: block;
  border: 0;
  padding: 0;
}
.people-list.is-list .card-footer-label {
  display: none;
}
/* The empty notebook is a CSS object using licensed address-book artwork.
   It carries no fabricated person records or sample profiles. */
.empty-state {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  padding: 44px 40px;
  background: var(--surface);
  border-radius: 16px;
  min-height: 370px;
}
.empty-state:not(.is-filtered)::before {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  border: 1px solid #645438;
  border-radius: 50%;
  top: 50%;
  left: -135px;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.5;
}
.empty-copy,
.book-scene {
  z-index: 1;
}
.empty-copy {
  position: relative;
}
.empty-copy {
  max-width: 38ch;
}
.empty-copy h2 {
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}
.empty-copy p {
  color: var(--text-muted);
  line-height: 1.9;
  font-size: 1rem;
  margin-bottom: 26px;
}
.empty-copy .empty-hint {
  font-size: 0.8125rem;
  margin: 18px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.empty-hint .ui-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}
.book-scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  perspective: 900px;
}
.book-object {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  width: 184px;
  height: 236px;
  border-radius: 9px 14px 14px 9px;
  background: #171e2b;
  box-shadow: 8px 9px 0 #02040a;
  transform: rotate(-9deg);
  color: var(--accent);
  isolation: isolate;
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
@media (hover: hover) and (pointer: fine) {
  .empty-state:hover .book-object {
    transform: rotate(-5deg) rotateY(-14deg) translateY(-6px);
  }
}
.book-object::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 12px;
  width: 1px;
  background: #625332;
}
.book-object::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 8px;
  bottom: 8px;
  width: 6px;
  border-radius: 0 5px 5px 0;
  background: #d4cbb8;
  z-index: -1;
}
.book-object .ui-icon {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
}
.book-title {
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.book-subtitle {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: #adb3c1;
}
.book-tab {
  position: absolute;
  right: -15px;
  width: 19px;
  height: 25px;
  border-radius: 0 4px 4px 0;
  background: #70958e;
  z-index: -2;
}
.book-tab:nth-of-type(1) {
  top: 50px;
}
.book-tab:nth-of-type(2) {
  top: 89px;
  background: #d6b178;
}
.book-tab:nth-of-type(3) {
  top: 128px;
  background: #b09acb;
}
.empty-state.is-filtered {
  grid-template-columns: 1fr;
  min-height: 260px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
}
.empty-state.is-filtered .empty-copy {
  margin: auto;
}
.empty-state.is-filtered .empty-symbol {
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  fill: currentColor;
  justify-self: center;
  margin-bottom: 16px;
}
.chip {
  --chip-color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.chip:hover {
  background: var(--surface-soft);
}
.chip.active {
  background: var(--accent-soft);
  border-color: #75623b;
  color: var(--accent);
  font-weight: 600;
}
.chip.chip-static {
  min-height: 28px;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--chip-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-color) 25%, transparent);
  color: var(--chip-color);
  border-radius: 6px;
  font-size: 0.75rem;
}
.chip-status-active {
  --chip-color: var(--status-active);
}
.chip-status-dormant {
  --chip-color: var(--status-dormant);
}
.chip-status-drifted {
  --chip-color: var(--status-drifted);
}
.chip-status-memory {
  --chip-color: var(--status-memory);
}
.chip[class*="chip-status-"] {
  color: var(--chip-color);
}
.chip[class*="chip-status-"]:hover,
.chip[class*="chip-status-"].active {
  background: color-mix(in srgb, var(--chip-color) 13%, var(--surface));
  border-color: color-mix(in srgb, var(--chip-color) 40%, var(--surface));
  color: var(--chip-color);
}
.chip[class*="chip-status-"]:focus-visible {
  outline-color: var(--chip-color);
}
.chip-contact-ig {
  --chip-color: #e8aacb;
}
.chip-contact-linkedin {
  --chip-color: #9cc8eb;
}
.chip-contact-line {
  --chip-color: #a0ded5;
}
.chip-contact-telegram {
  --chip-color: #8ad7da;
}
.chip-contact-discord {
  --chip-color: #cfb4ed;
}
.person-dialog {
  width: min(650px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  overflow: auto;
  box-shadow: 0 24px 72px #00061170;
}
.person-dialog::backdrop {
  background: #01040bc7;
}
.person-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 28px;
}
.field-full,
.person-form-head,
.person-avatar-field {
  grid-column: 1/-1;
}
.person-form-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.person-form-head .people-kicker {
  font-size: 0.8125rem;
}
.person-form-head h2 {
  font-size: 1.6rem;
  margin: 3px 0;
  font-weight: 600;
}
.person-avatar-field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.file-label {
  display: grid;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  min-width: 0;
  flex: 1;
}
.file-label input {
  width: 100%;
  font-size: 0.8125rem;
}
.file-label input::file-selector-button {
  font: inherit;
  color: var(--accent);
  padding: 8px 12px;
  margin-right: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
}
#person-avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}
.field {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 0;
}
.field input,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  background: #080e19;
  color: var(--text);
  font-weight: 400;
  font-size: 1rem;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
}
.field textarea {
  resize: vertical;
}
.field-hint {
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--text-muted);
  font-weight: 400;
}
.chip-field {
  display: grid;
  gap: 9px;
  min-width: 0;
}
.chip-field-label {
  font-size: 0.9rem;
  font-weight: 500;
}
.chip-group {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.chip-category-container {
  display: grid;
  gap: 8px;
}
.chip-category {
  border-bottom: 1px solid var(--border);
  padding-bottom: 7px;
}
.chip-category summary {
  cursor: pointer;
  min-height: 38px;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 4px 0;
}
.form-more {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.form-more > summary {
  min-height: 44px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}
.form-more > summary span {
  display: block;
  margin-left: 17px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 400;
}
.form-more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 18px;
}
.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.person-form > .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 0 -28px -28px;
  padding: 16px 28px;
  background: var(--surface);
}
.form-error {
  background: #342334;
  color: #f4b3b8;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.875rem;
}
.import-content {
  padding: 28px;
  display: grid;
  gap: 18px;
}
.import-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
}
.avatar-zoom-dialog {
  padding: 20px;
  text-align: center;
}
.avatar-zoom-dialog img {
  display: block;
  width: auto;
  max-height: 70dvh;
  margin: 0 auto 16px;
  border-radius: 10px;
}
@media (max-width: 1100px) {
  .people-shell {
    grid-template-columns: 188px minmax(0, 1fr);
    gap: 28px;
    padding: 32px 28px;
  }
  .people-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr));
  }
  .directory-controls {
    flex-wrap: wrap;
  }
  .directory-options {
    margin-left: auto;
  }
  .empty-state {
    padding: 32px 24px;
    gap: 20px;
  }
  .book-object {
    width: 156px;
    height: 210px;
  }
  .people-list.is-list .person-card {
    grid-template-columns: 1fr 120px;
  }
  .people-list.is-list .person-card-head {
    grid-column: 1;
    grid-row: auto;
  }
  .people-list.is-list .person-facts,
  .people-list.is-list .person-badges {
    grid-column: 1;
  }
  .people-list.is-list .card-footer {
    grid-column: 2;
    grid-row: 1/4;
  }
  .people-list.is-list .person-note,
  .people-list.is-list .person-note-details {
    grid-column: 1/-1;
  }
}
@media (max-width: 850px) {
  .people-hero {
    flex-wrap: wrap;
  }
  .hero-actions {
    margin-left: auto;
  }
  .people-shell {
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
    gap: 22px;
  }
  .people-hero {
    padding-bottom: 24px;
  }
  .people-hero h1 {
    font-size: 2rem;
  }
  .hero-heading {
    gap: 16px;
  }
  .hero-mark {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    padding: 13px;
  }
  .directory-sidebar {
    position: static;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }
  .filter-panel {
    flex: 1;
    min-width: 0;
  }
  .filter-panel > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    min-height: 44px;
    list-style: none;
  }
  .filter-panel > summary::-webkit-details-marker {
    display: none;
  }
  .filter-caret {
    height: 16px;
    width: 16px;
    fill: currentColor;
    margin-left: auto;
    transition: transform 0.15s;
  }
  .filter-panel[open] .filter-caret {
    transform: rotate(180deg);
  }
  .filter-panel-body {
    padding-top: 14px;
  }
  .sidebar-label {
    display: none;
  }
  .people-status-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .status-tab {
    font-size: 0.8125rem;
  }
  .tab-birthday {
    margin: 0;
    padding-top: 11px;
    border-radius: 9px;
  }
  .sidebar-bottom {
    border: 0;
    margin: 0;
    padding: 0;
    width: 210px;
    flex-shrink: 0;
  }
  .people-summary {
    display: none;
  }
  .people-storage-bar {
    position: relative;
    display: flex;
    flex-direction: column;
  }
  .people-privacy {
    font-size: 0.8125rem;
  }
  .people-privacy summary {
    background: transparent;
    border: 0;
    padding: 8px 0;
  }
  .backup-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
  }
  .backup-actions .text-action {
    width: auto;
    min-height: 36px;
    padding: 0;
  }
  .people-privacy p {
    max-width: 32ch;
  }
  .empty-state {
    grid-template-columns: 40% 1fr;
  }
  .directory-options {
    margin-left: 0;
  }
  .people-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  }
  .people-list.is-list .person-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 120px;
  }
}
@media (max-width: 560px) {
  .hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
    align-items: stretch;
  }
  .hero-actions > button {
    min-width: 0;
    white-space: normal;
    font-size: 0.875rem;
    padding: 11px 12px;
  }
  .recall-panel {
    padding: 16px;
  }
  .recall-person {
    gap: 12px;
  }
  .recall-avatar {
    flex-basis: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
  .recall-name {
    font-size: 1.1875rem;
  }
  .recall-actions {
    margin-left: 0;
  }
  .empty-state:not(.is-filtered)::before {
    left: 50%;
    transform: translate(-50%, -50%);
    top: 70px;
    width: 340px;
    height: 340px;
  }
  .people-shell {
    padding: 24px 16px;
    gap: 18px;
  }
  .people-hero {
    flex-wrap: wrap;
    gap: 18px;
    padding-bottom: 22px;
  }
  .hero-heading {
    gap: 13px;
    width: 100%;
  }
  .hero-mark {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    padding: 11px;
    border-radius: 12px;
  }
  .people-hero h1 {
    font-size: 1.7rem;
    line-height: 1.5;
    margin-bottom: 4px;
  }
  .people-kicker {
    font-size: 0.8125rem;
    gap: 10px;
  }
  .people-intro {
    font-size: 0.875rem;
    line-height: 1.8;
  }
  .people-hero .primary-action {
    --action-ink: #17130b;
    width: 100%;
  }
  .private-label {
    font-size: 0.6875rem;
  }
  .directory-sidebar {
    flex-wrap: wrap;
  }
  .filter-panel {
    flex: 1 0 100%;
    order: 2;
  }
  .sidebar-bottom {
    width: 100%;
    order: 1;
  }
  .people-storage-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .people-privacy {
    width: 100%;
    max-width: none;
  }
  .people-privacy p {
    max-width: none;
  }
  .people-privacy summary {
    font-size: 0.75rem;
    min-height: 36px;
    gap: 5px;
    padding: 2px 0;
  }
  .people-privacy summary::after {
    display: none;
  }
  .backup-actions {
    gap: 8px;
  }
  .backup-actions .text-action {
    font-size: 0.75rem;
    min-height: 36px;
  }
  .backup-actions .ui-icon {
    height: 15px;
    width: 15px;
    flex-basis: 15px;
  }
  .people-search input {
    font-size: 0.875rem;
  }
  .search-row {
    flex-direction: column;
    gap: 9px;
  }
  .filter-field select {
    width: 100%;
    height: 44px;
  }
  .people-toolbar {
    margin-bottom: 18px;
  }
  .directory-controls {
    margin-bottom: 20px;
    gap: 10px;
  }
  .result-label {
    gap: 8px;
  }
  .result-label h2 {
    font-size: 1.0625rem;
  }
  .directory-options {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .sort-field select {
    max-width: 173px;
  }
  .people-category-header {
    font-size: 0.875rem;
    padding-bottom: 12px;
  }
  .people-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .person-card {
    padding: 20px 18px 14px;
  }
  .person-avatar {
    height: 56px;
    width: 56px;
    flex-basis: 56px;
  }
  .person-card-actions {
    margin-top: -6px;
  }
  .person-fact {
    grid-template-columns: 90px 1fr;
  }
  .person-note {
    font-size: 0.9375rem;
  }
  .empty-state {
    padding: 28px 22px;
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
    min-height: 0;
  }
  .book-scene {
    min-height: 182px;
  }
  .book-object {
    width: 126px;
    height: 162px;
    gap: 10px;
    border-radius: 7px 10px 10px 7px;
    box-shadow: 6px 7px 0 #07101e;
  }
  .book-object .ui-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }
  .book-title {
    font-size: 1.25rem;
  }
  .book-subtitle {
    font-size: 0.5rem;
  }
  .book-tab {
    width: 14px;
    height: 18px;
    right: -12px;
  }
  .book-tab:nth-of-type(1) {
    top: 32px;
  }
  .book-tab:nth-of-type(2) {
    top: 61px;
  }
  .book-tab:nth-of-type(3) {
    top: 90px;
  }
  .empty-copy {
    margin: auto;
  }
  .empty-copy h2 {
    font-size: 1.3rem;
    margin: 14px 0 10px;
  }
  .empty-copy p {
    font-size: 0.9375rem;
    line-height: 1.85;
    margin-bottom: 20px;
  }
  .empty-copy .empty-hint {
    justify-content: center;
    font-size: 0.75rem;
  }
  .empty-state .primary-action {
    --action-ink: #17130b;
    width: 100%;
  }
  .people-footnote {
    margin-top: 24px;
  }
  .person-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 12px;
  }
  .person-form {
    grid-template-columns: 1fr;
    padding: 22px 20px;
    gap: 18px;
  }
  .form-more-grid {
    grid-template-columns: 1fr;
  }
  .person-form-head h2 {
    font-size: 1.4rem;
  }
  .form-actions .primary-action {
    --action-ink: #17130b;
    flex: 1;
  }
  .person-form > .form-actions {
    margin: 0 -20px -22px;
    padding: 12px 20px;
  }
  .danger-action {
    margin-left: 0;
  }
  .people-list.is-list .person-card {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .people-list.is-list .person-card-head,
  .people-list.is-list .person-badges,
  .people-list.is-list .person-facts {
    grid-column: 1;
    grid-row: auto;
  }
  .people-list.is-list .card-footer {
    grid-column: 1;
    grid-row: auto;
    border-top: 1px solid var(--border);
    padding-top: 10px;
  }
  .people-list.is-list .person-note,
  .people-list.is-list .person-note-details {
    grid-column: 1;
  }
  .birthday-strip {
    padding: 12px;
    gap: 8px;
  }
  .birthday-strip h2 {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  .person-card:hover,
  .primary-action:hover {
    transform: none;
  }
  .empty-state:hover .book-object {
    transform: rotate(-9deg);
  }
}
