:root {
  --paper: #fffaf5;
  --paper-deep: #f8efe7;
  --ink: #39302d;
  --muted: #887a73;
  --line: #eee3db;
  --coral: #e88975;
  --coral-deep: #cd6958;
  --peach: #f8ded1;
  --pink: #f5cbd4;
  --pink-deep: #d98098;
  --blue: #c8dff0;
  --blue-deep: #72a6c7;
  --yellow: #f4dfaa;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(91, 62, 49, 0.08);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(232, 137, 117, .3); outline-offset: 2px; }

.page-shell { max-width: 1360px; margin: 0 auto; padding: 0 48px 30px; }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 39px; height: 39px; border-radius: 13px; background: var(--peach); color: var(--coral-deep); display: grid; place-items: center; transform: rotate(-5deg); }
.brand-mark svg { width: 25px; height: 25px; transform: rotate(5deg); }
.brand strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 21px; letter-spacing: -.04em; line-height: 1.05; }
.brand small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; margin-top: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.saved-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.saved-dot { width: 7px; height: 7px; border-radius: 50%; background: #93c69e; box-shadow: 0 0 0 4px #e4f2e4; }
.picker-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.picker-row:has(.relation-input) { grid-template-columns: minmax(0, 1fr) minmax(130px, .7fr) auto; }
.picker-list { display: flex; flex-wrap: wrap; gap: 7px; min-height: 28px; margin: 0 0 12px; }
.picker-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: #fff2e9; color: #7c5849; font-size: 12px; }
.picker-pill button { width: 19px; height: 19px; padding: 0; border: 0; border-radius: 50%; background: #f6d6ca; color: #9c5b4b; line-height: 1; }
.picker-empty { color: var(--muted); font-size: 12px; }
.legacy-picker-value { display: none; }
.avatar-button { border: 0; width: 38px; height: 38px; border-radius: 50%; color: #7f5e4c; background: var(--yellow); font-weight: 700; }

.hero-row { padding: 68px 0 48px; display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.eyebrow { margin: 0 0 12px; font-size: 10px; font-weight: 750; letter-spacing: .18em; color: var(--coral-deep); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 18px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(44px, 6vw, 70px); font-weight: 400; letter-spacing: -.06em; line-height: .97; }
h1 em { color: var(--coral); font-style: italic; }
.hero-copy { max-width: 410px; margin-bottom: 0; color: var(--muted); font-size: 16px; }
.hero-note { max-width: 260px; padding: 18px 20px; border: 1px solid #f1dfd5; border-radius: 17px 17px 17px 4px; background: #fff2e9; color: #895e50; transform: rotate(2deg); }
.hero-note p { margin: 0; font-size: 12px; line-height: 1.55; }
.hero-note strong { color: var(--coral-deep); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.hero-note-icon { display: block; margin-bottom: 7px; color: var(--coral); font-size: 19px; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 58px; }
.stat-card { display: flex; align-items: center; min-height: 102px; padding: 19px 22px; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); }
.stat-card-main { border-color: #f2d6ca; background: #fff4ed; }
.stat-icon { width: 41px; height: 41px; border-radius: 13px; display: grid; place-items: center; font-size: 23px; }
.stat-icon-coral { color: var(--coral-deep); background: var(--peach); }
.stat-icon-pink { color: var(--pink-deep); background: #fae5e8; }
.stat-icon-blue { color: var(--blue-deep); background: #e5f0f7; }
.stat-card div { flex: 1; }
.stat-label { display: block; color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; font-family: Georgia, serif; font-size: 30px; font-weight: 400; line-height: 1.05; }
.stat-tail { align-self: end; padding-bottom: 3px; color: #aa9990; font-size: 10px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(280px, .78fr); gap: 42px; align-items: start; }
.section-heading, .people-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
h2 { margin-bottom: 0; font-family: Georgia, serif; font-size: 28px; font-weight: 400; letter-spacing: -.04em; }
.compact-heading { align-items: center; }
.calendar-controls { display: flex; align-items: center; gap: 7px; }
.today-button, .icon-button { border: 1px solid var(--line); background: var(--white); color: var(--ink); }
.today-button { padding: 9px 13px; border-radius: 10px; color: var(--coral-deep); font-size: 12px; font-weight: 650; }
.icon-button { width: 34px; height: 34px; border-radius: 10px; font-size: 24px; line-height: 1; }
.today-button:hover, .icon-button:hover { border-color: var(--coral); background: #fff7f2; }
.calendar-filters { display: flex; gap: 12px; margin-bottom: 10px; }
.calendar-filter { position: relative; flex: 1; min-width: 0; padding: 9px 14px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--white); transition: border-color .18s ease, background .18s ease; }
.calendar-filter > span { display: block; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .03em; }
.calendar-filter select { display: block; width: 100%; min-height: 38px; margin: 0; padding: 3px 22px 8px 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 650; cursor: pointer; appearance: none; -webkit-appearance: none; }
.calendar-filter::after { position: absolute; right: 16px; bottom: 18px; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); pointer-events: none; content: ""; }
.calendar-filter:hover, .calendar-filter:focus-within { border-color: var(--coral); }
.calendar-filter.is-active { border-color: #e6b0a2; background: #fff4ed; }
.calendar-filter-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; margin-bottom: 12px; }
.calendar-filter-status p { margin: 0; color: var(--muted); font-size: 11px; }
.calendar-filter-status button { flex-shrink: 0; min-height: 34px; padding: 5px 10px; border: 0; border-radius: 8px; background: var(--peach); color: var(--coral-deep); font-size: 11px; font-weight: 650; }
.calendar-filter-status button[hidden] { display: none; }
.person-region { display: inline-block; margin-top: 8px; padding: 3px 8px; border-radius: 6px; background: var(--paper-deep); color: var(--muted); font-size: 10px; }
.calendar-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow); }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekdays { padding: 19px 21px 10px; color: #b19f95; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-align: center; }
.calendar-grid { gap: 5px; padding: 5px 21px 18px; }
.calendar-day { position: relative; min-height: 95px; padding: 9px; border: 1px solid transparent; border-radius: 13px; background: #fffdfa; }
.calendar-day.is-muted { background: #fcfaf8; color: #c9bcb4; }
.calendar-day.is-today { border-color: #f2aa96; background: #fff3ed; }
.day-number { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; font-size: 12px; }
.is-today .day-number { color: #fff; background: var(--coral); font-weight: 700; }
.birthday-stack { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.birthday-chip { overflow: hidden; padding: 4px 7px; border-radius: 7px; color: #6e5148; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.birthday-chip.female { background: #f9dfe5; color: #a55f73; }
.birthday-chip.male { background: #dcecf6; color: #4b7897; }
.birthday-chip.other { background: #f7e8bd; color: #927b43; }
.calendar-legend { display: flex; justify-content: flex-end; gap: 15px; padding: 12px 21px 16px; border-top: 1px solid #f4ebe5; color: var(--muted); font-size: 10px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-female { background: var(--pink-deep); }.legend-male { background: var(--blue-deep); }.legend-other { background: #d9ba65; }

.upcoming-column { min-width: 0; }
.mini-sparkle { color: var(--coral); font-size: 23px; transform: rotate(15deg); }
.upcoming-card { min-height: 300px; padding: 6px 20px; border-radius: var(--radius-lg); background: #f8efe9; }
.upcoming-item { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid #eddfd6; }
.upcoming-item:last-child { border-bottom: 0; }
.date-badge { width: 43px; flex: 0 0 43px; padding: 5px 2px; border-radius: 10px; background: var(--white); text-align: center; }
.date-badge strong { display: block; font-family: Georgia, serif; font-size: 19px; font-weight: 400; line-height: 1; }
.date-badge span { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.upcoming-avatar, .person-avatar { display: grid; place-items: center; border-radius: 50%; font-weight: 750; }
.upcoming-avatar { width: 34px; height: 34px; flex: 0 0 34px; font-size: 12px; }
.upcoming-item.female .upcoming-avatar, .person-card.female .person-avatar { color: #a55f73; background: var(--pink); }
.upcoming-item.male .upcoming-avatar, .person-card.male .person-avatar { color: #4b7897; background: var(--blue); }
.upcoming-item.other .upcoming-avatar, .person-card.other .person-avatar { color: #927b43; background: var(--yellow); }
.upcoming-info { min-width: 0; flex: 1; }
.upcoming-info strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-info span { display: block; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-arrow { color: #b6a49b; font-size: 18px; }
.empty-state { display: grid; min-height: 285px; place-items: center; padding: 30px; color: var(--muted); font-size: 13px; text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); font-family: Georgia, serif; font-size: 19px; font-weight: 400; }
.add-quiet-button { width: 100%; margin-top: 12px; padding: 12px; border: 1px dashed #dfc9bc; border-radius: 12px; background: transparent; color: var(--coral-deep); font-size: 12px; font-weight: 650; }
.add-quiet-button:hover { background: #fff5ef; }
.add-quiet-button span { font-size: 17px; vertical-align: -1px; }

.age-section { margin-top: 58px; }
.age-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.age-heading-note { color: var(--muted); font-size: 11px; }
.age-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.age-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); }
.age-card-title { display: flex; align-items: center; gap: 9px; padding: 16px 17px 13px; border-bottom: 1px solid var(--line); }
.age-card-title h3 { margin: 0; font-family: Georgia, serif; font-size: 19px; font-weight: 400; }
.age-card-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 9px; color: var(--coral-deep); background: var(--peach); font-size: 13px; }
.age-male .age-card-icon { color: var(--blue-deep); background: #e5f0f7; }.age-female .age-card-icon { color: var(--pink-deep); background: #fae5e8; }
.age-row { display: grid; grid-template-columns: 73px 30px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 13px 17px; border-bottom: 1px solid #f4ebe5; }
.age-row:last-child { border-bottom: 0; }
.age-row-label { color: var(--muted); font-size: 9px; line-height: 1.2; }
.age-avatar { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; font-size: 9px; font-weight: 750; }
.age-avatar.female { color: #a55f73; background: var(--pink); }.age-avatar.male { color: #4b7897; background: var(--blue); }.age-avatar.other { color: #927b43; background: var(--yellow); }
.age-person { min-width: 0; }.age-person strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.age-person small { color: #aa9990; font-size: 9px; }
.age-number { color: var(--coral-deep); font-size: 11px; white-space: nowrap; }.age-row-empty { display: block; color: var(--muted); font-size: 11px; }

.people-section { margin-top: 64px; }
.people-heading { align-items: center; }
.primary-button, .secondary-button { border-radius: 11px; padding: 11px 16px; font-size: 12px; font-weight: 700; }
.primary-button { border: 1px solid var(--coral); background: var(--coral); color: #fff; box-shadow: 0 8px 18px rgba(205, 105, 88, .15); }
.primary-button:hover { border-color: var(--coral-deep); background: var(--coral-deep); }
.primary-button span { font-size: 16px; vertical-align: -1px; }
.secondary-button { border: 1px solid var(--line); background: var(--white); color: var(--muted); }
.secondary-button:hover { border-color: #d8c7bd; color: var(--ink); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.search-box { display: flex; align-items: center; gap: 9px; width: min(360px, 100%); padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); color: #b09e94; }
.search-box:focus-within { border-color: #e6b0a2; box-shadow: 0 0 0 3px rgba(232,137,117,.1); }
.search-box span { font-size: 22px; line-height: 1; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.toolbar-hint { color: var(--muted); font-size: 11px; }
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.person-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); transition: transform .18s ease, box-shadow .18s ease; }
.person-card:hover { transform: translateY(-2px); box-shadow: 0 13px 30px rgba(91, 62, 49, .07); }
.person-card-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.person-avatar { width: 42px; height: 42px; font-size: 14px; }
.card-actions { display: flex; gap: 4px; }
.small-action { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #b8a79f; font-size: 17px; }
.small-action:hover { background: #fff2eb; color: var(--coral-deep); }
.person-card h3 { overflow: hidden; margin: 14px 0 2px; font-family: Georgia, serif; font-size: 18px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.person-date { margin: 0; color: var(--coral-deep); font-size: 11px; font-weight: 700; }.person-date span { color: var(--muted); font-weight: 500; }
.person-note { display: -webkit-box; overflow: hidden; min-height: 39px; margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; line-clamp: 2; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.people-empty { grid-column: 1 / -1; padding: 40px; border: 1px dashed #e3d3ca; border-radius: var(--radius-md); color: var(--muted); text-align: center; }

.footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 75px; padding-top: 20px; border-top: 1px solid var(--line); color: #ad9d95; font-size: 10px; }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(58, 42, 34, .32); backdrop-filter: blur(5px); }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(100%, 480px); max-height: calc(100vh - 40px); overflow: auto; padding: 34px; border: 1px solid #f0ddd4; border-radius: 25px; background: var(--paper); box-shadow: 0 25px 70px rgba(58,42,34,.2); animation: modal-in .22s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; top: 15px; right: 17px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f6e8e0; color: var(--muted); font-size: 22px; line-height: 1; }
.modal h2 { margin-bottom: 7px; font-size: 31px; }
.modal-intro { margin-bottom: 25px; color: var(--muted); font-size: 12px; }
.field-label { display: block; margin: 0 0 7px; color: #66544c; font-size: 11px; font-weight: 700; }
.field-label span { color: var(--coral); }
.text-input { display: block; width: 100%; margin-bottom: 17px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: var(--white); color: var(--ink); font-size: 13px; }
.text-input::placeholder { color: #c0b3ac; }
.text-input:focus { border-color: #e6aa9b; box-shadow: 0 0 0 3px rgba(232,137,117,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.textarea { resize: vertical; min-height: 76px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 7px; }
.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; max-width: min(360px, calc(100vw - 44px)); padding: 12px 16px; border: 1px solid #e6c9bb; border-radius: 12px; background: #fff8f3; color: #755449; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 950px) {
  .page-shell { padding: 0 25px 26px; }
  .workspace { grid-template-columns: 1fr; gap: 48px; }
  .upcoming-card { min-height: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .upcoming-item:nth-child(odd) { padding-right: 12px; }
  .upcoming-item:nth-child(even) { padding-left: 12px; }
  .upcoming-item:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 680px) {
  .page-shell { padding: 0 16px 20px; }
  .topbar { min-height: 74px; }.saved-status { display: none; }
  .hero-row { display: block; padding: 48px 0 35px; }.hero-note { margin: 26px 0 0; }
  h1 { font-size: 49px; }.hero-copy { font-size: 14px; }
  .stats-row { grid-template-columns: 1fr; gap: 8px; margin-bottom: 44px; }.stat-card { min-height: 78px; }
  .calendar-card { border-radius: 19px; }.calendar-weekdays { padding-left: 8px; padding-right: 8px; }.calendar-grid { gap: 2px; padding: 5px 8px 13px; }.calendar-day { min-height: 70px; padding: 5px; border-radius: 9px; }.day-number { width: 22px; height: 22px; font-size: 10px; }.birthday-stack { margin-top: 4px; gap: 2px; }.birthday-chip { padding: 3px 4px; font-size: 8px; }.calendar-legend { padding-right: 12px; }
  .section-heading { align-items: start; }.calendar-controls { margin-top: 2px; }.today-button { padding: 8px 9px; font-size: 10px; }.icon-button { width: 30px; height: 30px; }
  .calendar-filters { gap: 8px; }.calendar-filter { padding: 8px 10px 0; }.calendar-filter select { min-height: 40px; font-size: 16px; }.calendar-filter::after { right: 13px; }.calendar-filter-status { align-items: flex-start; }
  .upcoming-card { display: block; }.upcoming-item:nth-child(odd), .upcoming-item:nth-child(even) { padding-left: 0; padding-right: 0; }.upcoming-item:nth-last-child(-n+2) { border-bottom: 1px solid #eddfd6; }.upcoming-item:last-child { border-bottom: 0; }
  .age-section { margin-top: 48px; }.age-section-heading { display: block; }.age-heading-note { display: block; margin-top: 7px; }.age-grid { grid-template-columns: 1fr; }
  .people-section { margin-top: 50px; }.people-heading { align-items: start; }.people-heading h2 { font-size: 24px; }.primary-button { padding: 10px 12px; }
  .people-grid { grid-template-columns: 1fr; }.toolbar { align-items: flex-start; flex-direction: column; gap: 9px; }.search-box { width: 100%; }
  .footer { flex-direction: column; gap: 6px; margin-top: 50px; }.modal { padding: 29px 20px 23px; }.form-row { grid-template-columns: 1fr; gap: 0; }
}
