* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --bg: #f7f6fa;
  --paper: #fff;
  --ink: #231d35;
  --muted: #686179;
  --line: #eae6f1;
  --accent: #6040c7;
  --accent-dark: #4e31a9;
  --lilac: #f1ebff;
  --pink: #a53b67;
  --rose: #fcecf2;
  --green: #2d7258;
  --mint: #e7f5ee;
  --clay: #91612f;
  --peach: #fff1df;
  --radius: 24px;
  --shadow: 0 3px 14px #402c6907;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-optical-sizing: auto;
  line-height: 1.45;
}
body { margin: 0; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--accent-dark); }
button, a, input, textarea, select { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
[hidden] { display: none !important; }
.shell { width: min(1152px, calc(100% - 80px)); margin-inline: auto; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 1.43rem; letter-spacing: -.075em; font-weight: 800; white-space: nowrap; }
.brand-period { color: var(--accent); }
.brand-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); position: relative; display: inline-block; flex: none; }
.brand-icon i { position: absolute; top: 11px; left: 9px; height: 18px; width: 14px; border-radius: 6px; background: #c8b9ff; transform: rotate(-18deg); }
.brand-icon i + i { left: 16px; top: 9px; background: #fff; transform: rotate(18deg); }
nav { display: flex; gap: 4px; align-items: center; }
.nav-link { border-radius: 10px; display: flex; align-items: center; gap: 7px; text-decoration: none; color: var(--muted); min-height: 44px; padding: 8px 12px; font-weight: 650; font-size: .91rem; white-space: nowrap; }
.nav-link:hover, .nav-link[aria-current] { background: var(--lilac); color: var(--accent-dark); }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.nav-link .icon { width: 18px; height: 18px; }
.profile { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 5px 8px; min-height: 44px; border: 1px solid var(--line); background: var(--paper); border-radius: 30px; color: var(--muted); }
.profile:hover { border-color: #c8b9f0; }
.avatars { display: inline-flex; align-items: center; }
.avatar { background: var(--lilac); color: var(--accent-dark); width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .83rem; font-weight: 750; border: 2px solid var(--paper); flex: none; }
.avatar.second { background: var(--rose); color: var(--pink); }
.avatars .avatar + .avatar { margin-left: -8px; }
.profile > .icon { width: 15px; height: 15px; }
.main { padding-block: 39px 56px; }
.heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.1rem, 4vw, 3.15rem); line-height: 1.05; letter-spacing: -.065em; font-weight: 760; }
h2 { font-size: 1.4rem; letter-spacing: -.04em; line-height: 1.18; }
h3 { font-size: 1.0625rem; line-height: 1.25; letter-spacing: -.018em; overflow-wrap: anywhere; }
.subtle { color: var(--muted); }
.small { font-size: .875rem; }
.section-label { color: var(--muted); font-size: .875rem; font-weight: 650; margin-bottom: 8px; }
.button { min-height: 44px; padding: 9px 15px; border-radius: 12px; border: 1px solid transparent; color: var(--ink); background: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; font-size: .9375rem; text-decoration: none; white-space: nowrap; }
.button .icon { width: 18px; height: 18px; }
.button.primary { color: white; background: var(--accent); box-shadow: 0 3px 7px #6040c72b; }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { border-color: var(--line); }
.button.secondary:hover, .icon-btn:hover { background: var(--lilac); border-color: #dfd3f8; }
.button.ghost { color: var(--accent-dark); background: var(--lilac); }
.button.danger { color: #9d324a; background: #fff1f3; }
.icon-btn { display: inline-grid; place-items: center; border: 1px solid var(--line); width: 40px; height: 40px; background: var(--paper); color: var(--ink); border-radius: 12px; flex: none; }
.icon-btn .icon { width: 17px; height: 17px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.calendar-panel { padding: 23px 24px 19px; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 20px; }
.month-controls { display: flex; gap: 6px; align-items: center; }
.today-btn { min-height: 40px; padding-inline: 12px; margin-right: 3px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekday { text-align: center; font-size: .875rem; color: var(--muted); font-weight: 650; padding-bottom: 7px; }
.weekday.weekend { color: var(--accent-dark); }
.day { display: grid; place-items: center; align-content: center; gap: 4px; height: clamp(48px, 5.4vw, 66px); min-width: 0; padding: 4px 1px; border-radius: 12px; border: 1px solid #f3f1f7; background: #fbfafc; color: var(--ink); font-weight: 650; }
.day:hover { background: var(--lilac); border-color: #dfd3f8; }
.day.outside { color: #776f86; background: #fff; border-color: #f7f5fa; font-weight: 450; }
.day.today { color: var(--accent-dark); border-color: #cbb9f7; }
.day.selected { color: #fff; background: var(--accent); border-color: var(--accent); }
.day-marks { display: flex; gap: 4px; align-items: center; height: 6px; }
.day-marks i, .legend i { width: 6px; height: 6px; border-radius: 50%; background: var(--mark); display: inline-block; }
.day.selected .day-marks i { background: #fff; }
.event { --tone: var(--accent-dark); --soft: var(--lilac); --mark: #7155cb; }
.task { --tone: var(--green); --soft: var(--mint); --mark: #408c71; }
.recipe { --tone: var(--clay); --soft: var(--peach); --mark: #bd8243; }
.movie, .wish { --tone: var(--pink); --soft: var(--rose); --mark: #c65582; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: .825rem; margin-top: 17px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.agenda { padding: 21px; }
.agenda-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.date-tile { background: var(--lilac); color: var(--accent-dark); border-radius: 14px; width: 54px; height: 58px; flex: none; display: grid; place-content: center; text-align: center; padding: 5px; }
.date-tile strong { font-size: 1.55rem; line-height: 1; letter-spacing: -.04em; }
.date-tile span { font-size: .75rem; margin-top: 3px; font-weight: 700; }
.agenda-head p { margin-top: 3px; }
.agenda-rows { display: grid; gap: 8px; }
.agenda-row { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 14px; cursor: pointer; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; text-align: left; gap: 10px; padding: 9px; min-height: 62px; width: 100%; }
.agenda-row:hover, .item-card:hover { border-color: #cdbdf0; }
.agenda-row .item-icon { width: 37px; height: 37px; border-radius: 11px; }
.agenda-row strong, .agenda-row .meta { display: block; overflow-wrap: anywhere; }
.agenda-row .meta { margin: 2px 0 0; }
.row-time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .825rem; color: var(--muted); }
.item-icon { background: var(--soft); color: var(--tone); width: 45px; height: 45px; border-radius: 14px; display: inline-grid; place-items: center; flex: none; }
.meta { color: var(--muted); font-size: .825rem; }
.agenda-add { width: 100%; margin-top: 12px; }
.list-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter { border: 1px solid var(--line); border-radius: 24px; min-height: 40px; padding: 7px 14px; color: var(--muted); background: var(--paper); font-weight: 650; font-size: .875rem; }
.filter[aria-pressed="true"] { background: var(--lilac); color: var(--accent-dark); border-color: #dfd3f8; }
.items { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(285px, 100%),1fr)); align-items: stretch; gap: 14px; }
.item-card { padding: 17px; display: grid; gap: 12px; align-content: start; }
.item-card > button.open-item { display: grid; text-align: left; background: transparent; border: 0; padding: 0; color: inherit; gap: 12px; width: 100%; min-width: 0; border-radius: 13px; }
.item-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item-title { font-size: 1.0625rem; line-height: 1.25; letter-spacing: -.018em; overflow-wrap: anywhere; }
.item-head .meta { display: block; }
.item-card .open-item .meta { margin-top: 4px; }
.item-card p.caption { color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.item-foot, .chips { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.chip { font-size: .825rem; font-weight: 650; padding: 5px 9px; border-radius: 8px; background: var(--soft, var(--bg)); color: var(--tone, var(--muted)); display: inline-flex; align-items: center; gap: 4px; }
.chip .icon { width: 14px; height: 14px; }
.done-title { text-decoration: line-through; }
.empty { padding: 24px 13px; text-align: center; color: var(--muted); border: 1px dashed #dfd8ed; border-radius: 14px; overflow-wrap: anywhere; }
.empty h3 { color: var(--ink); margin: 7px 0 3px; }
.empty.block { padding: 38px 18px; }
.loading { padding: 36px 12px; text-align: center; color: var(--muted); }
.entry { max-width: 490px; margin: 10px auto; padding: 26px; }
.entry h1 { font-size: 2rem; }
.entry p { margin-block: 12px 20px; }
.entry .brand-icon { margin-bottom: 14px; }
dialog { color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); width: min(540px, calc(100% - 28px)); max-height: calc(100% - 32px); max-height: calc(100dvh - 32px); padding: 0; box-shadow: 0 18px 65px #21123b37; }
dialog::backdrop { background: #241b3b6b; }
.dialog-inner { padding: 21px; }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.dialog-top h2 { padding-top: 7px; overflow-wrap: anywhere; }
.dialog-back { margin-right: 7px; }
.field-list, .detail { display: grid; gap: 12px; }
.field { display: grid; min-width: 0; align-content: start; gap: 5px; font-size: .875rem; color: var(--muted); font-weight: 650; }
.field :is(input,select,textarea) { width: 100%; min-width: 0; min-height: 43px; border: 1px solid #ded8eb; border-radius: 10px; background: #fbfafc; color: var(--ink); padding: 8px 10px; font-size: 1rem; font-weight: 450; }
.field textarea { min-height: 82px; resize: vertical; }
.photo-field { border: 1px solid var(--line); border-radius: 15px; padding: 11px; display: grid; gap: 8px; }
.field-caption { color: var(--muted); font-size: .875rem; font-weight: 650; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.photo-actions .button { min-height: 41px; font-size: .875rem; }
.photo-preview { max-width: 280px; }
.photo-status { color: var(--muted); }
.photo-status.photo-error { color: #9d324a; }
.record-photo { display: block; width: 100%; overflow: hidden; border-radius: 13px; background: var(--bg); position: relative; }
.record-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; visibility: hidden; }
.record-photo img.photo-loaded { visibility: visible; }
.detail > .record-photo img, .photo-preview .record-photo img { object-fit: contain; aspect-ratio: auto; max-height: min(420px, 50vh); }
.detail > .record-photo img:not(.photo-loaded), .photo-preview .record-photo img:not(.photo-loaded) { aspect-ratio: 16 / 10; }
.photo-unavailable { display: none; }
.photo-failed .photo-unavailable { display: grid; place-items: center; position: absolute; inset: 0; color: var(--muted); font-size: .875rem; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.dialog-actions.end { justify-content: flex-end; }
.detail-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.detail a, .invite-link { overflow-wrap: anywhere; }
.detail hr { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--line); }
.comments { display: grid; gap: 8px; }
.comment { background: var(--bg); padding: 9px 11px; border-radius: 10px; }
.comment p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.choice-list { display: grid; gap: 7px; }
.choice-list button { justify-content: flex-start; min-height: 49px; border-color: var(--line); }
.choice-list button:hover { background: var(--lilac); }
.form-error { color: #9d324a; font-size: .875rem; overflow-wrap: anywhere; }
.dialog-feedback { margin-bottom: 12px; }
.ratings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.rating { background: var(--rose); color: var(--pink); border-radius: 12px; padding: 10px; overflow-wrap: anywhere; }
.rating strong { display: block; font-size: 1.12rem; }
.rating p { color: var(--ink); margin-top: 4px; }
.toast { display: none; position: fixed; z-index: 2; bottom: 19px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 26px); padding: 9px 15px; background: #29203e; color: white; border-radius: 12px; box-shadow: var(--shadow); }
.toast.visible { display: block; }
.demo-note { color: var(--muted); margin: 16px 0 0; font-size: .825rem; }
@media (max-width: 890px) {
  .shell { width: calc(100% - 36px); }
  .top-inner { gap: 9px; }
  .nav-link { padding-inline: 8px; gap: 5px; }
  .calendar-layout { grid-template-columns: minmax(0,1.3fr) minmax(270px,1fr); gap: 12px; }
  .calendar-panel, .agenda { padding: 15px; }
}
@media (max-width: 710px) {
  .top-inner { min-height: 62px; }
  .main { padding-block: 22px calc(83px + env(safe-area-inset-bottom)); }
  nav { background: white; position: fixed; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 5px 3px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); z-index: 1; }
  .nav-link { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 1px; min-height: 48px; font-size: .75rem; }
  .nav-link .icon { width: 20px; height: 20px; }
  .nav-link[aria-current] { background: var(--lilac); }
  .calendar-layout { grid-template-columns: 1fr; }
  .heading { margin-bottom: 15px; align-items: center; }
  .heading .button { padding-inline: 10px; }
  .calendar-toolbar { margin-bottom: 13px; }
  .calendar-panel h2, .agenda-head h2 { font-size: 1.23rem; }
  .day { height: 44px; border-radius: 8px; }
  .legend { margin-top: 11px; gap: 6px 11px; }
  .calendar-grid { gap: 3px; }
  .toast { bottom: calc(67px + env(safe-area-inset-bottom)); }
}
@media (max-width: 390px) {
  .shell { width: calc(100% - 24px); }
  .calendar-panel, .agenda { padding: 12px; }
  .calendar-toolbar { gap: 5px; }
  .month-controls { gap: 4px; }
  .month-controls .icon-btn { width: 34px; }
  .today-btn { padding-inline: 7px; margin: 0; }
  h1 { font-size: 1.95rem; }
}
