:root {
  color-scheme: light;
  --surface: #fff;
  --surface-soft: #f5f7fb;
  --text: #182435;
  --muted: #525f71;
  --line: #dce3eb;
  --accent: #234f8d;
  --accent-dark: #173c72;
  --accent-wash: #eaf1fb;
  --error: #9b3533;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface);
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: progress; opacity: .64; }
:focus-visible { outline: 3px solid #0b69c2; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(calc(100% - 48px), 768px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { min-width: 0; }
.brand strong { font-size: 16px; font-weight: 760; letter-spacing: -.035em; }
.member-tools { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.member-tools .button { padding-inline: 8px; }
.skip-link { position: absolute; top: 3px; left: 3px; z-index: 5; padding: 12px; background: var(--accent); color: white; transform: translateY(-110%); }
.skip-link:focus { transform: none; }
main { padding-bottom: 36px; }
.page-message { padding-block: 26px; color: var(--muted); }
h1 { font-size: clamp(35px, 5.8vw, 48px); line-height: 1.16; font-weight: 800; letter-spacing: -.075em; }
h2 { font-size: 21px; font-weight: 760; line-height: 1.25; letter-spacing: -.043em; }
.date-label { color: var(--accent); font-size: 14px; font-weight: 720; margin-bottom: 6px; }
.button { min-height: 44px; display: inline-flex; gap: 6px; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 700; color: inherit; text-decoration: none; white-space: nowrap; }
.button.primary { color: white; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.button.secondary:hover, .button.quiet:hover, .button.more-button:hover { background: var(--surface-soft); }
.button.quiet, .button.more-button { color: var(--muted); background: transparent; }
.button.small { min-height: 44px; padding-inline: 8px; }
.button.full { width: 100%; }

.entry { max-width: 410px; margin-inline: auto; padding: clamp(48px, 10vw, 106px) 0 50px; }
.entry-intro { margin-bottom: 27px; }
.entry-intro h1 + p { margin-top: 12px; color: var(--muted); font-size: 15px; }
.entry-card h2 { margin: 0 0 14px; }
.entry-card .button.full { min-height: 49px; margin-top: 10px; }
.entry-card label { margin-top: 12px; }
.entry-card .form-hint { margin-top: 12px; }
label { display: block; color: var(--muted); font-size: 14px; font-weight: 650; margin-bottom: 4px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 47px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 16px; }
input::placeholder { color: #627086; }
input, textarea { display: block; }
textarea { min-height: 114px; resize: vertical; }
select { padding-right: 24px; }
.quiet-text { color: var(--muted); font-size: 14px; }
.form-hint { margin-top: 9px; }

.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 10px; padding: 32px 0 16px; }
.page-heading h1 { font-size: clamp(30px, 5.2vw, 42px); }
.page-heading .button { margin-bottom: 2px; }
.progress-summary { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 10px 0 14px; }
.progress-summary p { flex: none; white-space: nowrap; color: var(--muted); font-size: 14px; font-weight: 690; font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 12px; accent-color: var(--accent); background: #e4ebf4; }
progress::-webkit-progress-bar { background: #e4ebf4; border-radius: 12px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 12px; }

.directory-toolbar { position: sticky; z-index: 1; top: 0; padding-bottom: 7px; background: var(--surface); }
.segments { display: flex; align-items: stretch; gap: 20px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.segments button { min-height: 47px; padding: 6px 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 15px; font-weight: 700; }
.segments button[aria-pressed=true] { border-bottom-color: var(--accent); color: var(--accent-dark); }
.segments span { margin-left: 2px; font-size: 13px; font-variant-numeric: tabular-nums; }
.search-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.search-bar input { background: var(--surface-soft); }
#filter-count { color: var(--accent); font-variant-numeric: tabular-nums; }
.applied-filters { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 8px; }
.filter-pill { color: var(--accent-dark); background: var(--accent-wash); border: 0; border-radius: 6px; padding: 3px 9px; min-height: 36px; font-size: 13px; font-weight: 660; }
.list-meta { min-height: 35px; display: flex; align-items: center; justify-content: space-between; padding: 2px 0; color: var(--muted); font-size: 14px; }
.list-meta p { font-variant-numeric: tabular-nums; }
.elder-list { list-style: none; margin: 0; padding: 0; border-block: 1px solid var(--line); }
.elder-row { min-height: 78px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 0; }
.elder-row + .elder-row { border-top: 1px solid var(--line); }
.elder-info { display: grid; gap: 2px; min-width: 0; }
.elder-name { font-size: 18px; font-weight: 760; letter-spacing: -.018em; }
.elder-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.elder-state { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.elder-owner { color: var(--muted); }
.badge { color: var(--accent-dark); font-weight: 650; }
.badge.complete { color: #226144; }
.badge.excluded, .badge.local { color: var(--muted); }
.row-actions { display: flex; align-items: center; justify-content: end; gap: 2px; }
.button.row-primary { color: var(--accent-dark); background: var(--accent-wash); padding-inline: 11px; }
.button.row-primary:hover { background: #dbe9fb; }
.button.row-primary[data-action=complete] { color: white; background: var(--accent); }
.button.more-button { width: 44px; min-height: 44px; padding: 0; font-size: 22px; line-height: 1; font-weight: 600; }
.empty { text-align: center; padding: 32px 12px; }
.empty h3 { margin-bottom: 4px; font-size: 17px; }
.empty p { color: var(--muted); font-size: 14px; }

.notice, .status-message { margin: 2px 0 9px; padding: 8px 10px; color: var(--accent-dark); background: var(--accent-wash); border-radius: 7px; font-size: 14px; }
.notice.error, .status-message.error { color: var(--error); background: #fdf0ef; }
dialog { width: min(calc(100% - 32px), 490px); max-height: calc(100dvh - 30px); padding: 0; overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 15px 50px #16263928; }
dialog::backdrop { background: #13233966; }
.dialog-inner { padding: 18px 20px 21px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dialog-inner input { margin-bottom: 11px; }
.dialog-inner .status-message { margin: 9px 0 0; }
.filters { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters .button { grid-column: 1 / -1; margin-top: 4px; }
.row-dialog-actions { display: grid; gap: 8px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.share-actions .button { flex: 1; }

@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { min-height: 54px; }
  .page-heading { padding-top: 24px; }
  .page-heading .button { padding-inline: 8px; }
  .progress-summary { gap: 10px; }
  dialog { width: 100%; max-height: calc(100dvh - 12px); margin: auto 0 0; border-radius: 15px 15px 0 0; }
  .dialog-inner { padding: 13px 16px max(16px, env(safe-area-inset-bottom)); }
}
@media (max-width: 350px) {
  .wrap { width: calc(100% - 24px); }
  .member-tools { font-size: 12px; gap: 0; }
  .row-primary { font-size: 13px; }
  .share-actions .button { padding-inline: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .button { transition: background-color .12s ease, border-color .12s ease; }
}
