:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 16px;
  font-synthesis: none;
  --ink: #151515;
  --paper: #ffffff;
  --canvas: #eef0f5;
  --blue: #3157f5;
  --yellow: #ffe45c;
  --coral: #f36d6d;
  --green: #54c77a;
  --mint: #dff7e6;
  --muted: #62656d;
  --line: #151515;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  letter-spacing: 0;
}

.site-shell[hidden],
.user-gate[hidden] { display: none !important; }

.user-gate {
  position: relative;
  display: grid;
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 48px 42px;
  overflow: hidden;
  grid-template-rows: auto 1fr auto auto;
  border-right: 2px solid var(--line);
  border-left: 2px solid var(--line);
  background: var(--blue);
  color: #ffffff;
}

.user-gate::before {
  position: absolute;
  top: 17%;
  right: -72px;
  width: 210px;
  height: 100px;
  border: 4px solid var(--line);
  background: var(--coral);
  content: "";
  transform: rotate(-12deg);
}

.user-gate::after {
  position: absolute;
  bottom: 7%;
  left: -44px;
  width: 130px;
  height: 130px;
  border: 4px solid var(--line);
  background: var(--green);
  content: "";
  transform: rotate(18deg);
}

.user-gate-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
}

.user-gate-top small,
.user-gate-top strong { display: block; }
.user-gate-top small { font-size: 0.66rem; font-weight: 900; }
.user-gate-top strong { margin-top: 3px; font-size: 1.22rem; }
.user-gate-mark { display: grid; width: 48px; height: 48px; place-items: center; border: 3px solid var(--line); background: var(--yellow); color: var(--ink); box-shadow: 4px 4px 0 var(--line); transform: rotate(-5deg); }
.user-gate-mark svg { width: 25px; height: 25px; }

.user-gate-copy {
  position: relative;
  z-index: 1;
  align-self: end;
  max-width: 720px;
  margin: 58px 0 28px;
}

.user-gate-copy > span { font-size: 0.72rem; font-weight: 900; }
.user-gate-copy h1 { max-width: 660px; margin: 7px 0 0; font-size: 2.65rem; line-height: 1.18; }
.user-gate-copy p { margin: 12px 0 0; font-size: 0.9rem; font-weight: 700; }

.user-select-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.user-select-button {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 152px;
  padding: 22px 24px;
  grid-template-columns: 54px 68px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 16px;
  border: 3px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  text-align: left;
  box-shadow: 7px 7px 0 var(--line);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.user-select-button:hover { transform: translate(-2px, -2px); box-shadow: 10px 10px 0 var(--line); }
.user-select-button:active { transform: translate(4px, 4px); box-shadow: 3px 3px 0 var(--line); }
.user-select-button.user-nao { background: var(--yellow); }
.user-select-button.user-sayu { background: var(--coral); }
.user-select-number { align-self: start; font-size: 0.68rem; font-weight: 900; }
.user-select-avatar { display: grid; width: 64px; height: 64px; place-items: center; border: 3px solid var(--line); background: var(--paper); font-size: 1.35rem; font-weight: 900; transform: rotate(-4deg); }
.user-sayu .user-select-avatar { transform: rotate(4deg); }
.user-select-copy small,
.user-select-copy strong { display: block; }
.user-select-copy small { font-size: 0.66rem; font-weight: 800; }
.user-select-copy strong { margin-top: 4px; overflow-wrap: anywhere; font-size: 1.65rem; }
.user-select-button > svg { width: 26px; height: 26px; }
.user-gate-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; margin: 24px 0 0; font-size: 0.68rem; font-weight: 700; }
.user-gate-note svg { width: 17px; height: 17px; }

button,
input,
textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

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

.site-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  border-right: 2px solid var(--line);
  border-left: 2px solid var(--line);
}

.topbar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px 24px;
  border-bottom: 2px solid var(--line);
  background: var(--blue);
  color: #ffffff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--line);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--line);
  transform: rotate(-4deg);
}

.brand-mark svg { width: 22px; height: 22px; }
.brand small,
.brand strong { display: block; }
.brand small { font-size: 0.62rem; font-weight: 800; }
.brand strong { margin-top: 2px; font-size: 1.12rem; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.icon-button {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
}

.icon-button svg { width: 20px; height: 20px; }
.notice-dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border: 2px solid var(--blue); border-radius: 50%; background: var(--yellow); }

.profile-chip { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.profile-chip small,
.profile-chip strong { display: block; }
.profile-chip small { font-size: 0.62rem; opacity: 0.8; }
.profile-chip strong { font-size: 0.82rem; }
.profile-chip > svg { width: 15px; height: 15px; }
.profile-avatar,
.partner-avatar { display: grid; width: 38px; height: 38px; place-items: center; border: 2px solid var(--line); background: var(--green); color: var(--ink); font-size: 0.78rem; font-weight: 800; transform: rotate(4deg); }

.view-panel { min-height: 670px; }
.view-panel[hidden] { display: none !important; }

.date-banner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 40px;
  border-bottom: 2px solid var(--line);
  background: var(--coral);
}

.date-banner span,
.page-heading span,
.partner-heading span,
.input-heading span,
.dialog-header span { font-size: 0.68rem; font-weight: 900; }
.date-banner h1 { margin: 2px 0 0; font-size: 2.1rem; line-height: 1.1; }
.date-banner p { margin: 0; font-size: 0.86rem; font-weight: 800; text-align: right; }

.period-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 12px 40px;
  border-bottom: 2px solid var(--line);
  background: #fff8cf;
}

.period-title { display: inline-flex; align-items: center; gap: 7px; font-size: 0.74rem; font-weight: 800; }
.period-title svg { width: 18px; height: 18px; }
.period-strip > strong { font-size: 1.05rem; }
.period-step { padding: 6px 9px; border: 2px solid var(--line); background: var(--paper); font-size: 0.73rem; font-weight: 800; }

.edit-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 800;
}
.edit-link svg { width: 16px; height: 16px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 24px 40px 28px;
  background: var(--paper);
}

.stat {
  min-width: 0;
  padding: 14px 16px;
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
}
.stat-nao { background: var(--yellow); }
.stat-sayu { background: var(--green); }
.stat-pair { background: #ffffff; }
.stat > span,
.stat > strong { display: block; }
.stat > span { min-height: 2.4em; font-size: 0.72rem; font-weight: 800; line-height: 1.35; }
.stat > strong { margin-top: 4px; font-size: 1.65rem; line-height: 1; }

.input-stage {
  position: relative;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  background: var(--yellow);
}

.input-stage::before,
.input-stage::after {
  position: absolute;
  width: 54px;
  height: 54px;
  border: 2px solid var(--line);
  content: "";
}
.input-stage::before { top: 24px; left: 32px; background: var(--coral); transform: rotate(12deg); }
.input-stage::after { right: 34px; bottom: 36px; border-radius: 50%; background: var(--green); }

.input-stage-inner {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 42px;
}

.input-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 6px 10px;
  border: 2px solid var(--line);
  background: var(--ink);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  transform: rotate(-1deg);
}
.input-label svg { width: 16px; height: 16px; }

.input-heading,
.partner-heading,
.page-heading,
.goal-editor-heading,
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.input-heading { margin-bottom: 20px; }
.input-heading h2,
.partner-heading h2,
.page-heading h1,
.dialog-header h2 { margin: 3px 0 0; font-size: 1.35rem; }

.outline-button,
.primary-button,
.secondary-button,
.add-goal-button,
.save-record-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 14px;
  border: 2px solid var(--line);
  border-radius: 0;
  font-size: 0.76rem;
  font-weight: 900;
}
.outline-button { background: var(--paper); color: var(--ink); box-shadow: 3px 3px 0 var(--line); }
.primary-button { background: var(--blue); color: #ffffff; box-shadow: 3px 3px 0 var(--line); }
.secondary-button { background: var(--paper); color: var(--ink); }
.add-goal-button { background: var(--yellow); color: var(--ink); }
.outline-button svg,
.primary-button svg,
.add-goal-button svg,
.save-record-button svg { width: 17px; height: 17px; }

.goal-list { display: grid; gap: 12px; }

.goal-item {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 90px;
  padding: 14px;
  border: 3px solid var(--line);
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--coral);
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.goal-item.completed { background: var(--mint); box-shadow: 7px 7px 0 var(--green); transform: translate(-2px, -2px); }
.goal-symbol { display: grid; width: 46px; height: 46px; place-items: center; border: 2px solid var(--line); background: var(--yellow); }
.goal-symbol svg { width: 23px; height: 23px; }
.goal-copy { min-width: 0; }
.goal-copy strong,
.goal-copy span { display: block; overflow-wrap: anywhere; }
.goal-copy strong { font-size: 0.94rem; line-height: 1.45; }
.goal-copy span { margin-top: 3px; color: var(--muted); font-size: 0.68rem; }

.goal-clear-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 116px;
  min-height: 52px;
  padding: 10px 13px;
  border: 2px solid var(--line);
  background: var(--blue);
  color: #ffffff;
  box-shadow: 4px 4px 0 var(--line);
  font-size: 0.78rem;
  font-weight: 900;
}
.goal-clear-button svg { width: 19px; height: 19px; }
.goal-item.completed .goal-clear-button { background: var(--green); color: var(--ink); }

.record-fields { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; margin-top: 18px; }
.field-group { display: flex; flex-direction: column; min-width: 0; }
.field-group > span { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 0.7rem; font-weight: 900; }
.field-group svg { width: 15px; height: 15px; }
.field-group input,
.field-group textarea,
.dialog-field input,
.goal-editor-row input,
.memo-editor textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
}
.field-group input { min-height: 52px; padding: 10px 12px; }
.field-group textarea { min-height: 52px; padding: 10px 12px; resize: vertical; }

.clear-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 3px solid var(--line);
  background: var(--green);
  box-shadow: 6px 6px 0 var(--line);
  animation: clear-pop 360ms cubic-bezier(.2, .9, .3, 1.3);
}
.clear-banner[hidden] { display: none; }
.clear-icon { display: grid; width: 44px; height: 44px; place-items: center; border: 2px solid var(--line); border-radius: 50%; background: var(--paper); }
.clear-icon svg { width: 26px; height: 26px; }
.clear-banner strong,
.clear-banner small { display: block; }
.clear-banner strong { font-size: 1rem; }
.clear-banner small { margin-top: 3px; font-size: 0.7rem; }

.save-record-button { width: 100%; margin-top: 18px; background: var(--ink); color: #ffffff; box-shadow: 5px 5px 0 var(--blue); }

.partner-band { border-bottom: 2px solid var(--line); background: #fff7ba; }
.partner-inner { width: min(820px, calc(100% - 48px)); margin: 0 auto; padding: 30px 0 34px; }
.partner-heading { margin-bottom: 16px; }
.partner-goals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 2px solid var(--line); background: var(--paper); }
.partner-goal { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 58px; padding: 10px 13px; }
.partner-goal + .partner-goal { border-left: 2px solid var(--line); }
.partner-goal svg { width: 19px; height: 19px; }
.partner-goal span { overflow-wrap: anywhere; font-size: 0.76rem; font-weight: 700; }
.partner-goal strong { color: #237944; font-size: 0.68rem; }
.partner-goal.completed svg { color: #237944; }
.pair-message { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.72rem; font-weight: 700; }
.pair-message svg { width: 17px; height: 17px; }

.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 72px;
  border-top: 2px solid var(--line);
  background: var(--paper);
}
.nav-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 70px; padding: 8px 4px; border: 0; background: var(--paper); color: var(--ink); font-size: 0.66rem; }
.nav-button + .nav-button { border-left: 2px solid var(--line); }
.nav-button svg { width: 20px; height: 20px; }
.nav-button.active { background: var(--yellow); font-weight: 900; }

.page-heading { padding: 34px 40px 24px; border-bottom: 2px solid var(--line); }
.period-badge { padding: 8px 10px; border: 2px solid var(--line); background: var(--yellow); font-size: 0.75rem; font-weight: 800; }
.history-summary { display: flex; align-items: center; gap: 14px; padding: 18px 40px; border-bottom: 2px solid var(--line); background: var(--coral); }
.history-summary strong { font-size: 1rem; }
.history-summary span { font-size: 0.72rem; }
.calendar-toolbar { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 24px 40px 12px; }
.calendar-toolbar > div { min-width: 180px; text-align: center; }
.calendar-toolbar span,
.calendar-toolbar strong { display: block; }
.calendar-toolbar span { font-size: 0.62rem; font-weight: 900; }
.calendar-toolbar strong { margin-top: 3px; font-size: 1.25rem; }
.calendar-nav-button { display: grid; width: 44px; height: 44px; place-items: center; border: 2px solid var(--line); background: var(--paper); box-shadow: 3px 3px 0 var(--line); }
.calendar-nav-button svg { width: 20px; height: 20px; }
.calendar-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; padding: 6px 24px 18px; }
.calendar-legend > span { display: inline-flex; align-items: center; gap: 6px; font-size: 0.66rem; font-weight: 700; }
.legend-mark { width: 12px; height: 12px; border: 2px solid var(--line); }
.legend-mark.completed { background: var(--green); }
.legend-mark.missed { background: var(--coral); }
.legend-mark.pending { background: #e2e3e7; }
.legend-pair { display: grid; width: 20px; height: 20px; place-items: center; border: 2px solid var(--line); background: var(--yellow); }
.legend-pair svg { width: 12px; height: 12px; }
.calendar-wrap { margin: 0 40px 24px; border: 2px solid var(--line); background: var(--paper); }
.calendar-weekdays,
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-bottom: 2px solid var(--line); background: var(--ink); color: #ffffff; }
.calendar-weekdays span { padding: 8px 3px; font-size: 0.66rem; font-weight: 900; text-align: center; }
.calendar-day,
.calendar-blank { min-width: 0; min-height: 98px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.calendar-day { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 8px; color: var(--ink); text-align: left; }
.calendar-day:nth-child(7n),
.calendar-blank:nth-child(7n) { border-right: 0; }
.calendar-day .day-number { display: block; font-size: 0.74rem; font-weight: 900; }
.calendar-day.today .day-number { display: grid; width: 24px; height: 24px; margin: -3px 0 0 -3px; place-items: center; background: var(--blue); color: #ffffff; }
.calendar-day.selected { outline: 4px solid var(--blue); outline-offset: -4px; }
.calendar-day.pair-complete { background: #fff8cf; }
.calendar-day.pair-complete::after { position: absolute; top: 5px; right: 5px; display: grid; width: 20px; height: 20px; place-items: center; border: 2px solid var(--line); background: var(--yellow); content: "⚡"; font-size: 0.65rem; }
.calendar-day.outside-period { background: #f1f2f4; color: #8b8d93; }
.calendar-person { display: grid; grid-template-columns: 17px minmax(0, 1fr) 15px; align-items: center; gap: 3px; min-height: 22px; padding: 2px 4px; border: 1px solid var(--line); font-size: 0.58rem; font-weight: 800; }
.calendar-person .person-initial { display: grid; place-items: center; font-size: 0.55rem; }
.calendar-person .person-state { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-person svg { width: 12px; height: 12px; }
.calendar-person.completed { background: var(--mint); color: #176436; }
.calendar-person.missed { background: #ffe1e1; color: #8b2424; }
.calendar-person.pending { background: #eceef1; color: #777a80; }
.calendar-detail { margin-top: 26px; padding: 26px 40px 36px; border-top: 2px solid var(--line); background: #fff7ba; }
.calendar-detail:empty { display: none; }
.calendar-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.calendar-detail-heading span,
.calendar-detail-heading h2 { display: block; margin: 0; }
.calendar-detail-heading span { font-size: 0.66rem; font-weight: 900; }
.calendar-detail-heading h2 { margin-top: 3px; font-size: 1.15rem; }
.calendar-detail-badge { padding: 6px 8px; border: 2px solid var(--line); background: var(--yellow); font-size: 0.68rem; font-weight: 900; }
.calendar-detail-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 2px solid var(--line); background: var(--paper); }
.detail-person { padding: 14px; }
.detail-person + .detail-person { border-left: 2px solid var(--line); }
.detail-person header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.detail-person header strong { font-size: 0.82rem; }
.detail-status { font-size: 0.66rem; font-weight: 900; }
.detail-status.completed { color: #176436; }
.detail-status.missed { color: #9b2929; }
.detail-goal-list { margin: 0; padding-left: 18px; font-size: 0.72rem; line-height: 1.7; }
.calendar-detail-memo { margin: 12px 0 0; padding: 11px 13px; border: 2px solid var(--line); background: var(--paper); font-size: 0.72rem; line-height: 1.6; }

.memo-editor { max-width: 720px; margin: 36px auto 24px; padding: 0 24px; }
.memo-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.memo-editor-heading span,
.memo-editor-heading h2 { display: block; margin: 0; }
.memo-editor-heading > div span { font-size: 0.64rem; font-weight: 900; }
.memo-editor-heading h2 { margin-top: 3px; font-size: 1.2rem; }
.shared-badge { display: inline-flex !important; align-items: center; gap: 6px; padding: 6px 8px; border: 2px solid var(--line); background: var(--green); font-size: 0.66rem; font-weight: 900; }
.shared-badge svg { width: 15px; height: 15px; }
.memo-editor label { display: block; margin-bottom: 12px; font-size: 0.74rem; font-weight: 900; }
.memo-editor label > span { display: block; margin-bottom: 6px; }
.memo-editor textarea,
.memo-date-field input { width: 100%; border: 2px solid var(--line); border-radius: 0; background: var(--paper); }
.memo-date-field input { min-height: 46px; padding: 8px 10px; }
.memo-editor textarea { min-height: 130px; padding: 14px; resize: vertical; }
.memo-editor .primary-button { margin-top: 2px; }
.memo-filter { display: flex; max-width: 672px; margin: 0 auto 12px; padding: 0 0; border: 2px solid var(--line); }
.memo-filter-button { flex: 1; min-height: 42px; padding: 8px; border: 0; background: var(--paper); color: var(--ink); font-size: 0.72rem; font-weight: 800; }
.memo-filter-button + .memo-filter-button { border-left: 2px solid var(--line); }
.memo-filter-button.active { background: var(--yellow); }
.memo-log { max-width: 720px; margin: 0 auto; padding: 0 24px 40px; }
.memo-entry { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; padding: 18px 0; border-top: 2px solid var(--line); }
.memo-entry-avatar { display: grid; width: 38px; height: 38px; place-items: center; border: 2px solid var(--line); background: var(--green); font-size: 0.7rem; font-weight: 900; }
.memo-entry.sayu .memo-entry-avatar { background: var(--coral); }
.memo-entry-content { min-width: 0; }
.memo-entry-content > span { display: block; color: var(--muted); font-size: 0.66rem; }
.memo-entry-content p { margin: 6px 0 0; overflow-wrap: anywhere; font-size: 0.78rem; line-height: 1.7; }
.memo-delete-button { display: grid; width: 40px; height: 40px; place-items: center; border: 0; background: transparent; color: #9b2929; }
.memo-delete-button svg { width: 17px; height: 17px; }
.memo-empty { padding: 28px 0; border-top: 2px solid var(--line); color: var(--muted); font-size: 0.76rem; text-align: center; }

.profile-settings,
.sharing-settings { padding: 28px 40px; border-bottom: 2px solid var(--line); }
.settings-section-heading { margin-bottom: 16px; }
.settings-section-heading span,
.settings-section-heading h2 { display: block; margin: 0; }
.settings-section-heading span { font-size: 0.64rem; font-weight: 900; }
.settings-section-heading h2 { margin-top: 3px; font-size: 1.1rem; }
.profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-field > span { display: block; margin-bottom: 6px; font-size: 0.7rem; font-weight: 900; }
.settings-field input { width: 100%; min-height: 46px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 0; background: var(--paper); }
.settings-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 40px; border-bottom: 2px solid var(--line); background: var(--yellow); }
.settings-band span,
.settings-band strong,
.settings-band small { display: block; }
.settings-band span { font-size: 0.68rem; font-weight: 900; }
.settings-band strong { margin-top: 3px; font-size: 1.15rem; }
.settings-band small { margin-top: 4px; font-size: 0.72rem; }
.settings-list { padding: 28px 40px; border-bottom: 2px solid var(--line); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; border-bottom: 2px solid var(--line); }
.switch-row > label { flex: 1; cursor: pointer; }
.switch-row strong,
.switch-row small { display: block; }
.switch-row strong { font-size: 0.82rem; }
.switch-row small { margin-top: 4px; color: var(--muted); font-size: 0.68rem; }
.switch-row input { width: 24px; height: 24px; accent-color: var(--blue); }
.switch-actions { display: flex; align-items: center; gap: 10px; }
.switch-actions input[type="time"] { width: 108px; min-height: 40px; padding: 5px 7px; border: 2px solid var(--line); border-radius: 0; background: var(--paper); }
.sharing-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px; border: 2px solid var(--line); background: #fff8cf; }
.sharing-row span,
.sharing-row strong,
.sharing-row small { display: block; }
.sharing-row span { font-size: 0.64rem; font-weight: 900; }
.sharing-row strong { margin-top: 3px; font-size: 1.05rem; }
.sharing-row small { margin-top: 5px; color: var(--muted); font-size: 0.66rem; }
.sync-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.sync-dot { width: 12px; height: 12px; border: 2px solid var(--line); border-radius: 50%; background: var(--yellow); }
.sync-row strong,
.sync-row small { display: block; }
.sync-row strong { font-size: 0.76rem; }
.sync-row small { margin-top: 3px; color: var(--muted); font-size: 0.66rem; }
.settings-save { padding: 22px 40px 40px; }

.plan-dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 3px solid var(--line); border-radius: 0; background: var(--paper); color: var(--ink); box-shadow: 10px 10px 0 var(--line); }
.plan-dialog::backdrop { background: rgba(21, 21, 21, 0.62); }
.dialog-header { padding: 18px 20px; border-bottom: 2px solid var(--line); background: var(--blue); color: #ffffff; }
.dialog-body { padding: 22px 20px; }
.dialog-field { display: block; }
.dialog-field > span { display: block; margin-bottom: 6px; font-size: 0.7rem; font-weight: 900; }
.dialog-field input { min-height: 46px; padding: 8px 10px; }
.date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.goal-editor-heading { margin: 24px 0 10px; }
.goal-editor-heading span,
.goal-editor-heading small { display: block; }
.goal-editor-heading span { font-size: 0.78rem; font-weight: 900; }
.goal-editor-heading small { margin-top: 3px; color: var(--muted); font-size: 0.66rem; }
.goal-editor-list { display: grid; gap: 9px; }
.goal-editor-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 44px; align-items: center; gap: 7px; }
.drag-handle { display: grid; place-items: center; color: var(--muted); }
.drag-handle svg { width: 18px; height: 18px; }
.goal-editor-row input { min-height: 46px; padding: 8px 10px; }
.delete-goal-button { display: grid; width: 44px; height: 44px; place-items: center; border: 2px solid var(--line); background: var(--coral); color: var(--ink); }
.delete-goal-button svg { width: 18px; height: 18px; }
.form-error { min-height: 1.2em; margin: 10px 0 0; color: #b42318; font-size: 0.72rem; font-weight: 800; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 20px; border-top: 2px solid var(--line); background: #f3f4f6; }

.toast { position: fixed; right: 20px; bottom: 92px; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 12px 15px; border: 2px solid var(--line); background: var(--ink); color: #ffffff; box-shadow: 4px 4px 0 var(--blue); font-size: 0.76rem; font-weight: 800; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity 160ms ease, transform 160ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast svg { width: 18px; height: 18px; color: var(--green); }

.celebration-overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; overflow: hidden; background: var(--yellow); color: var(--ink); opacity: 0; pointer-events: none; transform: scale(0.96); transition: opacity 180ms ease, transform 220ms ease; }
.celebration-overlay.show { opacity: 1; transform: scale(1); }
.celebration-copy { position: relative; z-index: 2; text-align: center; }
.celebration-check { display: grid; width: 92px; height: 92px; margin: 0 auto 18px; place-items: center; border: 4px solid var(--line); border-radius: 50%; background: var(--green); box-shadow: 7px 7px 0 var(--line); }
.celebration-check svg { width: 55px; height: 55px; }
.celebration-copy strong,
.celebration-copy small { display: block; }
.celebration-copy strong { font-size: 2rem; }
.celebration-copy small { margin-top: 8px; font-size: 0.84rem; font-weight: 800; }
.confetti { position: absolute; width: 76px; height: 76px; border: 4px solid var(--line); }
.c1 { top: 12%; left: 10%; background: var(--blue); transform: rotate(14deg); }
.c2 { top: 17%; right: 12%; width: 110px; height: 42px; background: var(--coral); transform: rotate(-18deg); }
.c3 { right: 16%; bottom: 13%; border-radius: 50%; background: var(--green); }
.c4 { bottom: 12%; left: 15%; width: 56px; height: 110px; background: var(--blue); transform: rotate(32deg); }
.c5 { top: 47%; left: 5%; width: 44px; height: 44px; background: var(--coral); transform: rotate(45deg); }

@keyframes clear-pop {
  0% { transform: scale(0.92) rotate(-1deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@media (max-width: 760px) {
  .user-gate { padding: 24px 18px 30px; border: 0; }
  .user-gate::before { top: 12%; width: 140px; height: 72px; }
  .user-gate::after { width: 90px; height: 90px; }
  .user-gate-copy { align-self: center; margin: 48px 0 24px; }
  .user-gate-copy h1 { font-size: 1.85rem; }
  .user-gate-copy p { font-size: 0.78rem; }
  .user-select-grid { grid-template-columns: 1fr; gap: 14px; }
  .user-select-button { min-height: 116px; padding: 16px; grid-template-columns: 30px 56px minmax(0, 1fr) 24px; gap: 11px; box-shadow: 5px 5px 0 var(--line); }
  .user-select-avatar { width: 52px; height: 52px; }
  .user-select-copy strong { font-size: 1.3rem; }
  .site-shell { border: 0; }
  .topbar { padding: 10px 14px; }
  .profile-chip > span:nth-child(2),
  .profile-chip > svg { display: none; }
  #view-today { display: flex; flex-direction: column; }
  #view-today .date-banner { order: 1; }
  #view-today .period-strip { order: 2; }
  #view-today .input-stage { order: 3; }
  #view-today .stats-grid { order: 4; }
  #view-today .partner-band { order: 5; }
  .date-banner { padding: 22px 18px; }
  .date-banner h1 { font-size: 1.65rem; }
  .period-strip { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; padding: 12px 18px; }
  .period-title { grid-column: 1; }
  .period-strip > strong { grid-column: 1; font-size: 0.9rem; }
  .period-step { grid-column: 1; justify-self: start; }
  .edit-link { grid-column: 2; grid-row: 1 / span 3; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 18px; }
  .stat { padding: 11px 8px; box-shadow: 3px 3px 0 var(--line); }
  .stat > span { min-height: 3.7em; font-size: 0.62rem; }
  .stat > strong { font-size: 1.25rem; }
  .input-stage::before,
  .input-stage::after { display: none; }
  .input-stage-inner { width: calc(100% - 28px); padding: 28px 0 32px; }
  .input-heading { align-items: flex-start; flex-direction: column; }
  .goal-item { grid-template-columns: 42px minmax(0, 1fr); }
  .goal-symbol { width: 40px; height: 40px; }
  .goal-clear-button { grid-column: 1 / -1; width: 100%; }
  .record-fields { grid-template-columns: 1fr; }
  .partner-inner { width: calc(100% - 36px); }
  .partner-goals { grid-template-columns: 1fr; }
  .partner-goal + .partner-goal { border-top: 2px solid var(--line); border-left: 0; }
  .page-heading,
  .settings-band { align-items: flex-start; flex-direction: column; padding: 24px 18px; }
  .history-summary { padding: 15px 18px; }
  .calendar-toolbar { padding: 20px 18px 10px; }
  .calendar-toolbar > div { min-width: 140px; }
  .calendar-wrap { margin-right: 8px; margin-left: 8px; }
  .calendar-day,
  .calendar-blank { min-height: 82px; }
  .calendar-day { gap: 4px; padding: 4px; }
  .calendar-day .day-number { font-size: 0.66rem; }
  .calendar-person { grid-template-columns: 14px minmax(0, 1fr) 12px; gap: 1px; min-height: 20px; padding: 1px 2px; font-size: 0.52rem; }
  .calendar-person svg { width: 10px; height: 10px; }
  .calendar-detail { padding: 22px 18px 30px; }
  .calendar-detail-people { grid-template-columns: 1fr; }
  .detail-person + .detail-person { border-top: 2px solid var(--line); border-left: 0; }
  .memo-editor { margin-top: 28px; padding: 0 18px; }
  .memo-filter { margin-right: 18px; margin-left: 18px; }
  .memo-log { padding-right: 18px; padding-left: 18px; }
  .profile-settings,
  .sharing-settings,
  .settings-list,
  .settings-save { padding-right: 18px; padding-left: 18px; }
  .profile-fields { grid-template-columns: 1fr; }
  .sharing-row { align-items: flex-start; flex-direction: column; }
  .switch-row { align-items: flex-start; padding: 14px 0; }
  .switch-actions { align-items: flex-end; flex-direction: column-reverse; }
  .date-fields { grid-template-columns: 1fr; }
  .goal-editor-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 390px) {
  .brand small { display: none; }
  .date-banner { align-items: flex-start; flex-direction: column; gap: 8px; }
  .date-banner p { text-align: left; }
  .calendar-toolbar { gap: 10px; }
  .calendar-toolbar > div { min-width: 120px; }
  .calendar-day,
  .calendar-blank { min-height: 76px; }
  .calendar-day.pair-complete::after { width: 16px; height: 16px; font-size: 0.5rem; }
  .memo-editor-heading { align-items: flex-start; flex-direction: column; }
  .memo-entry { grid-template-columns: 36px minmax(0, 1fr) 40px; gap: 8px; }
  .memo-entry-avatar { width: 34px; height: 34px; }
  .dialog-footer { flex-direction: column-reverse; }
  .dialog-footer button { width: 100%; }
  .toast { right: 12px; left: 12px; justify-content: center; }
}

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