:root {
  color-scheme: light;
  --page-bg: #fff0f5;
  --bar-bg: #f39aae;
  --bar-text: #fff8fb;
  --accent: #e96385;
  --accent-soft: #ffb6c1;
  --text: #80384f;
  --muted: #b77a8d;
  --surface: rgba(255, 255, 255, 0.94);
  --line: rgba(233, 99, 133, 0.24);
  --theme-card: rgba(255, 255, 255, 0.88);
  --theme-card-strong: rgba(255, 255, 255, 0.94);
  --theme-border: rgba(255, 182, 193, 0.62);
  --theme-border-strong: rgba(255, 182, 193, 0.72);
  --theme-tint: rgba(255, 240, 245, 0.58);
  --theme-tint-strong: rgba(255, 182, 193, 0.5);
  --theme-active: rgba(255, 182, 193, 0.17);
  --theme-shadow: rgba(190, 89, 117, 0.08);
  --theme-accent-strong: #b55170;
  --theme-icon-filter: none;
  --top-height: 46px;
  --nav-height: 62px;
}

html[data-theme="baby-blue"] {
  --page-bg: #eef9ff;
  --bar-bg: #a9dcf7;
  --bar-text: #f8fcff;
  --accent: #55b8ed;
  --accent-soft: #ccecff;
  --text: #3f6d8c;
  --muted: #83a8be;
  --surface: rgba(255, 255, 255, 0.94);
  --line: rgba(85, 184, 237, 0.24);
  --theme-card: rgba(255, 255, 255, 0.88);
  --theme-card-strong: rgba(255, 255, 255, 0.95);
  --theme-border: rgba(137, 207, 244, 0.58);
  --theme-border-strong: rgba(137, 207, 244, 0.72);
  --theme-tint: rgba(226, 244, 254, 0.68);
  --theme-tint-strong: rgba(169, 220, 247, 0.5);
  --theme-active: rgba(85, 184, 237, 0.14);
  --theme-shadow: rgba(60, 137, 178, 0.09);
  --theme-accent-strong: #397fa7;
  --theme-icon-filter: hue-rotate(223deg) saturate(0.82) brightness(1.28);
}

html[data-theme="gray"] {
  --page-bg: #f3f4f6;
  --bar-bg: #c7cbd2;
  --bar-text: #ffffff;
  --accent: #8b939e;
  --accent-soft: #dfe2e7;
  --text: #505862;
  --muted: #8e959e;
  --surface: rgba(255, 255, 255, 0.95);
  --line: rgba(139, 147, 158, 0.24);
  --theme-card: rgba(255, 255, 255, 0.9);
  --theme-card-strong: rgba(255, 255, 255, 0.96);
  --theme-border: rgba(197, 202, 210, 0.68);
  --theme-border-strong: rgba(181, 187, 197, 0.76);
  --theme-tint: rgba(235, 237, 240, 0.72);
  --theme-tint-strong: rgba(202, 206, 213, 0.52);
  --theme-active: rgba(139, 147, 158, 0.14);
  --theme-shadow: rgba(75, 82, 91, 0.09);
  --theme-accent-strong: #69717c;
  --theme-icon-filter: grayscale(1) saturate(0) brightness(0.75);
}

.auth-pending > .login-screen,
.auth-pending > .app-shell {
  visibility: hidden;
}

.login-screen {
  position: fixed;
  z-index: 200;
  inset: 0;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 26%, rgba(255, 250, 252, 0.72) 0 13%, rgba(255, 231, 239, 0.56) 43%, transparent 69%),
    linear-gradient(155deg, #ffeaf0 0%, #ffdde7 54%, #ffe5ed 100%);
  color: #b75f78;
}

.login-screen[hidden],
.app-shell[hidden] {
  display: none !important;
}

.login-rose {
  position: absolute;
  z-index: 0;
  top: -7.5vw;
  left: 50%;
  width: min(108vw, 620px);
  height: auto;
  transform: translateX(-50%);
  opacity: 0.69;
  filter: saturate(0.94) brightness(1.15) contrast(0.85);
  pointer-events: none;
  user-select: none;
}

.login-panel {
  position: absolute;
  z-index: 1;
  top: clamp(286px, 54dvh, 520px);
  right: max(22px, env(safe-area-inset-right));
  left: max(22px, env(safe-area-inset-left));
  width: min(calc(100% - 44px), 410px);
  margin-inline: auto;
}

.login-panel h1 {
  margin: 0;
  color: #ed91aa;
  font-family: "Snell Roundhand", "Brush Script MT", "Segoe Script", cursive;
  font-size: clamp(37px, 12vw, 54px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-align: center;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.95);
}

.login-flourish {
  display: flex;
  width: min(58%, 210px);
  height: 22px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px auto 10px;
  color: #f09ab1;
}

.login-flourish span {
  width: 58px;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
}

.login-flourish span:last-child {
  transform: scaleX(-1);
}

.login-flourish b {
  font-size: 14px;
  font-weight: 400;
}

.login-form {
  display: grid;
  gap: 11px;
}

.login-password {
  min-height: 52px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  padding: 0 11px 0 15px;
  border: 1px solid rgba(236, 137, 163, 0.66);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.login-password:focus-within {
  border-color: #e97897;
  box-shadow: 0 0 0 3px rgba(233, 120, 151, 0.11);
}

.login-password__lock {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: #ed91aa;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-password input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #984a62;
  font: inherit;
  font-size: 16px;
}

.login-password input::placeholder {
  color: rgba(221, 115, 144, 0.72);
}

.login-password__toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(224, 112, 143, 0.72);
  font: inherit;
  font-size: 18px;
  line-height: 1;
}

.login-password__toggle.is-revealed {
  color: #d9587c;
}

.login-status {
  min-height: 15px;
  margin: -6px 5px -5px;
  color: #b77a8d;
  font-size: 11px;
  text-align: center;
}

.login-status.is-error {
  color: #bf355b;
}

.login-submit {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(100deg, #efa0b5, #e989a5);
  box-shadow: 0 10px 28px rgba(221, 105, 138, 0.2);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.17em;
}

.login-submit span {
  display: inline-block;
  margin-left: 7px;
  font-size: 22px;
  letter-spacing: 0;
  vertical-align: -1px;
}

.login-submit:disabled {
  opacity: 0.62;
}

@media (max-height: 600px) {
  .login-rose {
    top: -48px;
    width: min(101vw, 430px);
    opacity: 0.73;
  }

  .login-panel {
    top: 292px;
  }

  .login-panel h1 {
    font-size: 37px;
  }

  .login-flourish {
    height: 17px;
    margin: 5px auto 7px;
  }

  .login-password,
  .login-submit {
    min-height: 48px;
  }
}

@media (max-width: 340px) {
  .login-panel {
    right: 18px;
    left: 18px;
    width: calc(100% - 36px);
  }
}

[data-ui-text-key] {
  cursor: text;
}

[data-ui-text-key]:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
  border-radius: 6px;
}

.page--sl [data-ui-text-key]:focus-visible {
  outline-color: rgba(233, 99, 133, 0.58);
}

.ui-text-editor {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 18px;
  place-items: center;
  background: rgba(122, 58, 78, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ui-text-editor[hidden] {
  display: none;
}

.ui-text-editor__card {
  width: min(100%, 330px);
  padding: 18px;
  border: 1px solid rgba(255, 182, 193, 0.86);
  border-radius: 20px;
  background: #fff8fb;
  box-shadow: 0 18px 48px rgba(151, 69, 94, 0.2);
}

.ui-text-editor__card label {
  display: grid;
  gap: 9px;
}

.ui-text-editor__label {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.ui-text-editor__input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 182, 193, 0.88);
  border-radius: 13px;
  outline: none;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.ui-text-editor__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 99, 133, 0.12);
}

.ui-text-editor__status {
  min-height: 16px;
  padding-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.ui-text-editor__status.is-error {
  color: #bf355b;
}

.ui-text-editor__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ui-text-editor__actions button {
  min-width: 74px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 182, 193, 0.88);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.ui-text-editor__actions button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ui-text-editor__actions button:disabled {
  opacity: 0.55;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--page-bg);
}

body {
  min-height: 100dvh;
  overflow: hidden;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--page-bg);
}

.top-bar {
  position: fixed;
  z-index: 20;
  top: max(6px, env(safe-area-inset-top));
  right: 10px;
  left: 10px;
  height: var(--top-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 15px;
  background: var(--bar-bg);
  box-shadow: 0 5px 16px rgba(207, 92, 126, 0.14);
  color: var(--bar-text);
}

.top-bar__brand {
  grid-column: 2;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.menu-toggle {
  grid-column: 1;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 6px;
  align-content: center;
  justify-self: start;
  gap: 3px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--bar-text);
  cursor: pointer;
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.menu-toggle:focus-visible,
.top-menu button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.top-menu {
  position: fixed;
  z-index: 30;
  top: calc(max(6px, env(safe-area-inset-top)) + var(--top-height) + 6px);
  left: 10px;
  width: min(230px, calc(100vw - 20px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 26px rgba(156, 64, 91, 0.18);
}

.top-menu[hidden] {
  display: none;
}

.top-menu button {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: default;
}

.top-menu button + button {
  margin-top: 2px;
}

.top-menu button:hover {
  background: rgba(255, 182, 193, 0.18);
}

.menu-view {
  position: fixed;
  z-index: 40;
  inset: 0;
  padding:
    calc(max(10px, env(safe-area-inset-top)) + 8px)
    16px
    calc(var(--nav-height) + max(22px, env(safe-area-inset-bottom)));
  overflow-y: auto;
  background: var(--page-bg);
}

.menu-view[hidden] {
  display: none;
}

.menu-view__header {
  display: grid;
  height: 42px;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
}

.menu-view__header button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font-size: 21px;
}

.menu-view__header strong {
  grid-column: 2;
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.menu-view__body {
  display: flex;
  margin-top: 12px;
  flex-direction: column;
  gap: 10px;
}

.menu-search-box,
.menu-feedback-card {
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.08);
}

.menu-search-box {
  min-height: 44px;
  padding: 14px;
  color: var(--muted);
  font-size: 10px;
}

.menu-feedback-card {
  display: flex;
  min-height: 88px;
  padding: 15px;
  flex-direction: column;
}

.menu-feedback-card strong {
  color: var(--text);
  font-size: 12px;
}

.menu-feedback-card span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.menu-feedback-card i {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--usage), rgba(255, 182, 193, 0.25) var(--usage));
}

.menu-feedback-card small,
.menu-log-card small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
}

.menu-empty {
  padding: 24px 14px;
  border: 1px solid rgba(255, 182, 193, 0.55);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.menu-empty--error {
  color: #b55170;
}

.menu-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.menu-search-form .menu-search-box {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  outline: none;
  color: var(--text);
}

.menu-search-form button,
.menu-notification-card button {
  padding: 0 14px;
  border: 1px solid rgba(255, 182, 193, 0.75);
  border-radius: 15px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
}

.menu-search-results,
.menu-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-search-result {
  display: flex;
  width: 100%;
  padding: 12px 13px;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(255, 182, 193, 0.62);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font: inherit;
  text-align: left;
}

.menu-search-result__head {
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 700;
}

.menu-search-result__snippet {
  font-size: 10px;
  line-height: 1.5;
}

.menu-toggle-card,
.menu-notification-card,
.menu-log-card {
  border: 1px solid rgba(255, 182, 193, 0.68);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.06);
}

.menu-toggle-card {
  display: flex;
  min-height: 68px;
  padding: 13px 14px;
  align-items: center;
  justify-content: space-between;
}

.menu-proactive-mode {
  display: flex;
  min-height: 58px;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--theme-border);
  border-radius: 17px;
  background: var(--theme-card);
}

.menu-proactive-mode > strong {
  color: var(--text);
  font-size: 11px;
}

.menu-proactive-mode__options {
  display: flex;
  gap: 5px;
}

.menu-proactive-mode__options button {
  min-width: 58px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  background: var(--theme-card-strong);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.menu-proactive-mode__options button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--theme-active);
  color: var(--theme-accent-strong);
}

.menu-proactive-mode__options button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.menu-toggle-card > div,
.menu-notification-card {
  display: flex;
  flex-direction: column;
}

.menu-toggle-card strong,
.menu-notification-card strong {
  color: var(--text);
  font-size: 11px;
}

.menu-toggle-card span,
.menu-notification-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.menu-switch {
  position: relative;
  width: 38px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(205, 177, 185, 0.52);
}

.menu-switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(121, 69, 84, 0.22);
  content: "";
  transition: transform 0.16s ease;
}

.menu-switch[aria-checked="true"] {
  background: var(--accent);
}

.menu-switch[aria-checked="true"]::after {
  transform: translateX(16px);
}

.menu-config-note {
  padding: 0 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.menu-log-card {
  padding: 12px 13px;
}

.menu-log-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.menu-log-card__head time,
.menu-log-card__head b {
  color: var(--muted);
  font-size: 8px;
}

.menu-log-card__head b {
  color: var(--accent-strong);
}

.menu-log-card p {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.menu-log-card .menu-log-card__error {
  color: #b55170;
}

.menu-notification-card {
  min-height: 128px;
  padding: 15px;
}

.menu-notification-card button {
  min-height: 38px;
  margin-top: 18px;
  align-self: flex-start;
}

.chat-message--search-hit {
  animation: chat-search-pulse 1.8s ease;
}

@keyframes chat-search-pulse {
  0%, 100% { filter: none; }
  35% { filter: drop-shadow(0 0 7px rgba(236, 107, 144, 0.55)); }
}

.top-bar__clock {
  grid-column: 3;
  display: flex;
  justify-self: end;
  align-items: flex-end;
  font-size: 8px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: 0.02em;
  opacity: 0.9;
  flex-direction: column;
}

#top-bar-time {
  font-size: 10px;
}

.page-stage {
  height: 100dvh;
  min-height: 100dvh;
  overflow-y: auto;
  padding:
    calc(var(--top-height) + max(18px, env(safe-area-inset-top)))
    16px
    calc(var(--nav-height) + max(20px, env(safe-area-inset-bottom)));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.page-stage::-webkit-scrollbar {
  display: none;
}

.page {
  min-height: calc(
    100dvh - var(--top-height) - var(--nav-height) -
      max(38px, env(safe-area-inset-top) + env(safe-area-inset-bottom))
  );
}

.page-placeholder {
  display: grid;
  min-height: inherit;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.56;
}

.sl-home {
  position: relative;
  display: flex;
  min-height: inherit;
  padding: 12px 0 10px;
  flex-direction: column;
  gap: 12px;
}

.couple-summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr);
  align-items: start;
  padding: 4px 4px 0;
}

.profile {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.profile__avatar {
  display: grid;
  width: clamp(64px, 22vw, 88px);
  aspect-ratio: 1;
  overflow: hidden;
  place-items: center;
  border: 2px solid var(--accent-soft);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-soft);
  box-shadow: 0 5px 14px rgba(190, 89, 117, 0.1);
}

button.profile__avatar {
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.profile__avatar svg {
  width: 70%;
  height: 70%;
}

.profile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile__name {
  max-width: 100%;
  margin-top: 7px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile__signature {
  max-width: 100%;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relationship {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding-top: 20px;
  text-align: center;
}

.relationship__link {
  display: flex;
  width: 100%;
  align-items: center;
  color: var(--accent);
}

.relationship__link::before,
.relationship__link::after {
  height: 1px;
  flex: 1;
  background: var(--accent-soft);
  content: "";
}

.relationship__heart {
  width: 24px;
  height: 24px;
  margin: 0 5px;
}

.relationship__meta {
  margin-top: 7px;
  color: var(--text);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.35;
}

.relationship__days {
  margin-top: 1px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.info-card,
.anniversary-card {
  border: 1px solid rgba(255, 182, 193, 0.72);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.08);
}

.info-card {
  display: flex;
  min-height: 91px;
  max-height: 91px;
  padding: 11px 12px;
  border-radius: 16px;
  flex-direction: column;
  overflow: hidden;
}

.info-card__heading {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
  flex: 0 0 auto;
}

.info-card__icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
}

.info-card__value {
  margin-top: 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 760;
}

.weather-card .info-card__value {
  margin-top: 2px;
}

.info-card__detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.weather-city {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.weather-reading {
  display: block;
  margin-top: 2px;
}

.reminder-lines {
  display: grid;
  gap: 4px;
  color: var(--text);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
}

.info-card__scroll {
  min-height: 0;
  margin-top: 7px;
  padding-right: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(233, 99, 133, 0.38) transparent;
  scrollbar-width: thin;
}

.info-card__scroll::-webkit-scrollbar {
  width: 3px;
}

.info-card__scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(233, 99, 133, 0.38);
}

.health-lines {
  display: flex;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
  flex-direction: column;
  gap: 3px;
}

.health-lines strong {
  color: var(--text);
  font-size: 14px;
}

.reminder-line {
  display: grid;
  width: 100%;
  padding: 0;
  grid-template-columns: minmax(0, 1fr) auto 8px;
  gap: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.reminder-line > b {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  line-height: 10px;
}

button.reminder-line {
  cursor: pointer;
}

button.reminder-line:hover span {
  color: var(--accent-strong, var(--accent));
}

.reminder-line time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}

.reminder-line--empty {
  display: block;
  color: var(--muted);
  font-weight: 550;
}

.reminder-open {
  display: grid;
  width: 18px;
  height: 22px;
  margin-left: auto;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.reminder-detail {
  position: absolute;
  z-index: 12;
  inset: 0;
  min-height: 100%;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 18px;
  background: var(--page-bg);
}

.reminder-detail[hidden] {
  display: none;
}

.reminder-detail__bar {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
}

.reminder-detail__bar > button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font-size: 21px;
}

.reminder-detail__bar strong {
  grid-column: 2;
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.reminder-form {
  display: grid;
  margin-top: 14px;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 7px;
  padding: 11px;
  border: 1px solid rgba(255, 182, 193, 0.66);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.88);
}

.reminder-form input {
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(255, 182, 193, 0.58);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 240, 245, 0.58);
  color: var(--text);
  font: inherit;
  font-size: 10px;
}

.reminder-form input:focus {
  border-color: var(--accent);
}

.reminder-form__actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 7px;
}

.reminder-completed-field {
  display: flex;
  min-height: 34px;
  grid-column: 1 / -1;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 10px;
}

.reminder-completed-field[hidden] {
  display: none;
}

.reminder-completed-field input {
  width: 17px;
  height: 17px;
  padding: 0;
  accent-color: var(--accent);
}

.reminder-form__actions button,
.reminder-item__actions button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 999px;
  background: white;
  color: var(--text);
  font: inherit;
  font-size: 9px;
}

.reminder-form__actions button[type="submit"] {
  background: var(--accent);
  color: white;
}

.reminder-form__actions .reminder-delete-edit {
  margin-right: auto;
  border-color: rgba(181, 81, 112, 0.34);
  color: #b55170;
}

.reminder-status {
  min-height: 22px;
  padding: 6px 4px 2px;
  color: var(--muted);
  font-size: 9px;
}

.reminder-status.is-error {
  color: #b55170;
}

.reminder-detail__list {
  display: flex;
  padding-bottom: 10px;
  flex-direction: column;
  gap: 8px;
}

.reminder-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(255, 182, 193, 0.62);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.reminder-item:hover {
  border-color: var(--accent);
}

.reminder-check {
  display: grid;
  width: 21px;
  height: 21px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: white;
  color: white;
  font-size: 12px;
}

.reminder-item.is-complete .reminder-check {
  background: var(--accent);
}

.reminder-item__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.reminder-item__copy strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 10px;
  line-height: 1.4;
}

.reminder-item__copy time {
  color: var(--muted);
  font-size: 8px;
}

.reminder-item.is-complete .reminder-item__copy strong {
  text-decoration: line-through;
  opacity: 0.55;
}

.reminder-item__actions {
  display: flex;
  gap: 5px;
}

.reminder-item__actions button {
  min-height: 27px;
  padding: 0 9px;
}

.reminder-detail__empty {
  padding: 30px 12px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.itinerary-card {
  padding: 13px 14px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.08);
}

.itinerary-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.itinerary-card__head strong {
  color: var(--text);
  font-size: 11px;
}

.itinerary-card__head button {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font: inherit;
  font-size: 16px;
}

.itinerary-preview {
  display: flex;
  margin-top: 9px;
  flex-direction: column;
  gap: 5px;
}

.itinerary-preview button {
  display: grid;
  width: 100%;
  min-height: 30px;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.itinerary-preview__icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 214, 224, 0.62);
  font-size: 13px;
}

.itinerary-preview strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.itinerary-preview time {
  color: var(--muted);
  font-size: 8px;
}

.itinerary-preview__empty {
  padding: 8px 0 3px;
  color: var(--muted);
  font-size: 9px;
}

.itinerary-detail {
  position: absolute;
  z-index: 13;
  inset: 0;
  min-height: 100%;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 18px;
  background: var(--page-bg);
}

.itinerary-detail[hidden] {
  display: none;
}

.itinerary-detail__bar {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
}

.itinerary-detail__bar button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font-size: 21px;
}

.itinerary-detail__bar strong {
  grid-column: 2;
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.itinerary-form {
  display: grid;
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(255, 182, 193, 0.66);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.88);
}

.itinerary-form label {
  display: flex;
  min-width: 0;
  color: var(--muted);
  font-size: 8px;
  flex-direction: column;
  gap: 4px;
}

.itinerary-form__wide,
.itinerary-form__actions {
  grid-column: 1 / -1;
}

.itinerary-form input,
.itinerary-form select {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 182, 193, 0.58);
  border-radius: 11px;
  outline: none;
  background: rgba(255, 240, 245, 0.58);
  color: var(--text);
  font: inherit;
  font-size: 10px;
}

.itinerary-form input:focus,
.itinerary-form select:focus {
  border-color: var(--accent);
}

.itinerary-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.itinerary-form__actions button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 999px;
  background: white;
  color: var(--text);
  font: inherit;
  font-size: 9px;
}

.itinerary-form__actions button[type="submit"] {
  background: var(--accent);
  color: white;
}

.itinerary-form__actions .itinerary-delete {
  margin-right: auto;
  border-color: rgba(181, 81, 112, 0.34);
  color: #b55170;
}

.itinerary-status {
  min-height: 23px;
  padding: 7px 4px 2px;
  color: var(--muted);
  font-size: 9px;
}

.itinerary-status.is-error {
  color: #b55170;
}

.itinerary-detail__list {
  display: flex;
  padding-bottom: 12px;
  flex-direction: column;
  gap: 7px;
}

.itinerary-item {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: 34px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 182, 193, 0.62);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font: inherit;
  text-align: left;
}

.itinerary-item__icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 214, 224, 0.62);
  font-size: 17px;
}

.itinerary-item__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.itinerary-item__copy strong,
.itinerary-item__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.itinerary-item__copy strong {
  font-size: 10px;
}

.itinerary-item__copy small {
  color: var(--muted);
  font-size: 8px;
}

.itinerary-item > b {
  color: var(--accent);
  font-size: 16px;
  font-weight: 500;
}

.itinerary-detail__empty {
  padding: 30px 12px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

@media (max-width: 420px) {
  .reminder-form {
    grid-template-columns: 1fr;
  }

  .reminder-form__actions {
    grid-column: 1;
  }

  .reminder-item {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .reminder-item__actions {
    grid-column: 2;
  }
}

.pulse-home {
  display: flex;
  min-height: inherit;
  padding: 10px 0 14px;
  flex-direction: column;
  gap: 10px;
}

.pulse-status,
.pulse-module {
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.08);
}

.pulse-status {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
}

.pulse-status__copy strong {
  display: block;
  font-size: 12px;
}

.pulse-status__copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.pulse-status__wake {
  display: block;
  margin-top: 7px;
  color: var(--accent);
  font-size: 10px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.pulse-status__last {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.static-toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(183, 122, 141, 0.26);
  box-shadow: inset 0 0 0 1px rgba(233, 99, 133, 0.2);
}

.static-toggle:disabled {
  cursor: wait;
  opacity: 0.55;
}

.static-toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(128, 56, 79, 0.2);
  content: "";
  transition: transform 150ms ease;
}

.static-toggle.is-on {
  background: var(--accent-soft);
}

.static-toggle.is-on::after {
  transform: translateX(16px);
}

.pulse-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.pulse-module {
  min-height: 105px;
  padding: 12px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pulse-module__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 750;
}

.pulse-module__icon {
  color: var(--accent);
  font-size: 15px;
}

.pulse-module__preview {
  margin-top: 17px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.module-more {
  display: block;
  margin-top: 7px;
  color: var(--accent);
  font-size: 8px;
}

.pulse-activity {
  display: flex;
  height: 105px;
  min-height: 105px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 16px;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.08);
}

.pulse-activity__header,
.pulse-activity__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pulse-activity__header > div {
  min-width: 0;
}

.pulse-activity__heading {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-activity__heading > div {
  min-width: 0;
}

.pulse-activity__header strong,
.pulse-activity__header span {
  display: block;
}

.pulse-activity__header strong {
  color: var(--text);
  font-size: 11px;
}

.pulse-activity__count {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.pulse-activity__header button {
  padding: 5px 9px;
  border: 1px solid rgba(233, 99, 133, 0.3);
  border-radius: 999px;
  background: rgba(255, 240, 245, 0.9);
  color: var(--accent);
  font: inherit;
  font-size: 8px;
  font-weight: 700;
}

.pulse-activity__header button:disabled {
  opacity: 0.5;
}

.pulse-activity__list {
  display: flex;
  min-height: 0;
  margin-top: 7px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.pulse-activity__list::-webkit-scrollbar { display: none; }

.pulse-activity__item {
  padding: 6px 7px;
  border: 1px solid rgba(255, 182, 193, 0.46);
  border-left: 3px solid rgba(233, 99, 133, 0.55);
  border-radius: 11px;
  background: rgba(255, 250, 252, 0.82);
}

.pulse-activity__item--qq {
  border-left-color: rgba(138, 112, 190, 0.62);
}

.pulse-activity__meta strong {
  color: var(--accent);
  font-size: 9px;
}

.pulse-activity__meta time {
  color: var(--muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.pulse-activity__item p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 9px;
  line-height: 1.45;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pulse-activity__empty {
  margin: 8px 0;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
}

.chat-home {
  position: relative;
  display: flex;
  height: 100%;
  min-height: 0;
  padding: 0 0 6px;
  overflow: hidden;
  flex-direction: column;
}

.page--chat {
  height: calc(100% + 6px);
  min-height: 0;
  margin-top: -6px;
  overflow: hidden;
}

.chat-couple {
  position: relative;
  z-index: 5;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 4px 0 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 18px;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.08);
}

.chat-header-action {
  position: absolute;
  top: 25px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 182, 193, 0.62);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent);
  font-size: 15px;
}

.chat-header-action--sessions {
  left: 7px;
  width: 55px;
  padding: 0 8px;
  grid-template-columns: auto auto;
  gap: 4px;
  border-radius: 999px;
  font-size: 11px;
}

.chat-header-action--sessions b {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.chat-header-action--new {
  right: 2px;
  font-size: 19px;
  font-weight: 300;
}

.chat-couple__avatars {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar {
  width: 56px;
  border-width: 2px;
  box-shadow: 0 4px 12px rgba(190, 89, 117, 0.09);
}

.chat-avatar + .chat-avatar {
  margin-left: -9px;
}

.chat-couple__name {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.chat-thread {
  display: flex;
  flex: 1;
  min-height: 0;
  width: calc(100% + 16px);
  margin-right: -16px;
  padding: 8px 16px 10px 1px;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  flex-direction: column;
  gap: 9px;
  -webkit-overflow-scrolling: touch;
}

.chat-thread::-webkit-scrollbar {
  display: none;
}

.chat-scroll-rail {
  position: fixed;
  z-index: 7;
  right: 2px;
  width: 11px;
  padding: 0 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  pointer-events: auto;
}

.chat-scroll-rail[hidden] {
  display: none;
}

.chat-scroll-thumb {
  display: block;
  width: 5px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(233, 99, 133, 0.72);
  box-shadow: 0 1px 4px rgba(128, 56, 79, 0.18);
  cursor: grab;
  touch-action: none;
}

.chat-scroll-thumb.is-dragging {
  width: 7px;
  margin-left: -1px;
  background: var(--accent);
  cursor: grabbing;
}

.chat-status {
  position: absolute;
  z-index: 8;
  top: 82px;
  right: 8px;
  left: 8px;
  min-height: 0;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
  pointer-events: none;
}

.chat-status:empty {
  display: none;
}

.chat-status:not(:empty) {
  width: max-content;
  max-width: calc(100% - 16px);
  margin: 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 9px rgba(128, 56, 79, 0.08);
}

.chat-status.is-error {
  color: #c9506d;
}

.chat-empty {
  margin: auto;
  padding: 30px 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
}

.chat-message--me {
  align-items: flex-end;
}

.chat-message > .chat-bubble + .chat-bubble {
  margin-top: 8px;
}

.chat-message__time {
  margin: 3px 5px 0;
  color: var(--muted);
  font-size: 7px;
  font-style: normal;
  opacity: 0.72;
}

.chat-message__actions {
  display: flex;
  margin: 3px 4px 0;
  gap: 6px;
  opacity: 0.66;
}

.chat-message__actions button {
  padding: 1px 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
}

.chat-message__actions button[data-starred="1"] {
  color: var(--accent);
}

.chat-message__attachments {
  display: flex;
  width: min(78%, 260px);
  margin-top: 5px;
  flex-direction: column;
  gap: 5px;
}

.chat-message--me .chat-message__attachments {
  align-items: flex-end;
}

.chat-attachment {
  position: relative;
  display: flex;
  max-width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 182, 193, 0.55);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 8px;
}

.chat-attachment img {
  display: block;
  width: min(180px, 100%);
  max-height: 180px;
  border-radius: 8px;
  object-fit: cover;
}

.chat-attachment[data-photo-memory-source] img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.chat-attachment audio {
  width: min(210px, 100%);
  height: 30px;
}

.chat-attachment details {
  max-width: 180px;
}

.chat-attachment details summary {
  color: var(--accent);
  cursor: pointer;
}

.chat-attachment details p {
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.chat-attachment__file {
  color: var(--accent);
  font-size: 17px;
}

.chat-tools {
  display: flex;
  width: min(84%, 280px);
  margin-top: 5px;
  flex-direction: column;
  gap: 4px;
}

.chat-tools:empty {
  display: none;
}

.chat-tool {
  padding: 6px 8px;
  border: 1px solid rgba(255, 182, 193, 0.48);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 8px;
}

.chat-tool.is-error {
  border-color: rgba(201, 80, 109, 0.45);
}

.chat-tool summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
}

.chat-tool pre {
  max-height: 130px;
  margin: 6px 0 0;
  overflow: auto;
  font: 7px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-thinking {
  max-width: 100%;
  margin: -1px 0 5px;
  padding: 0 0 5px;
  border: 0;
  border-bottom: 1px solid rgba(178, 137, 148, 0.18);
  border-radius: 0;
  background: transparent;
  font-size: 9px;
}

.chat-thinking summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-weight: 400;
  list-style: none;
}

.chat-thinking summary::-webkit-details-marker {
  display: none;
}

.chat-thinking__icon {
  flex: 0 0 auto;
  font-size: 10px;
}

.chat-thinking__preview {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thinking[open] .chat-thinking__preview {
  display: none;
}

.chat-thinking pre {
  max-height: 150px;
  margin-top: 5px;
}

.chat-message--streaming .chat-bubble::after {
  display: inline-block;
  width: 4px;
  height: 10px;
  margin-left: 3px;
  background: var(--accent);
  content: "";
  vertical-align: -1px;
  animation: chat-cursor 850ms steps(1) infinite;
}

@keyframes chat-cursor {
  50% { opacity: 0; }
}

.chat-message--error .chat-bubble {
  border-color: rgba(201, 80, 109, 0.5);
}

.chat-system {
  align-self: center;
  max-width: 90%;
  margin: 4px auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
  text-align: center;
}

.chat-system--location {
  background: rgba(255, 182, 193, 0.24);
  color: var(--accent);
}

.chat-bubble {
  width: fit-content;
  max-width: 78%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 182, 193, 0.55);
  border-radius: 17px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 4px 12px rgba(190, 89, 117, 0.07);
}

.chat-bubble--partner {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
}

.chat-bubble--me {
  align-self: flex-end;
  border-color: rgba(243, 154, 174, 0.5);
  border-bottom-right-radius: 6px;
  background: rgba(255, 182, 193, 0.5);
}

.chat-composer {
  z-index: 4;
  flex: 0 0 auto;
  display: flex;
  min-height: 92px;
  padding: 11px 9px 8px 13px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  flex-direction: column;
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.08);
}

.chat-composer.is-dragging-file {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(233, 99, 133, 0.12);
}

.chat-attachment-preview {
  display: flex;
  max-height: 62px;
  margin-bottom: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 5px;
  scrollbar-width: none;
}

.chat-attachment-preview[hidden] {
  display: none;
}

.chat-attachment-preview::-webkit-scrollbar {
  display: none;
}

.chat-attachment--pending {
  min-width: 76px;
  max-width: 130px;
  height: 56px;
  flex: 0 0 auto;
  padding-right: 20px;
}

.chat-attachment--pending img {
  width: 42px;
  height: 42px;
  object-fit: cover;
}

.chat-attachment--pending button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  padding: 0;
  border-radius: 50%;
  background: rgba(128, 56, 79, 0.68);
  color: white;
  font-size: 12px;
  line-height: 1;
}

.chat-composer__message {
  width: 100%;
  min-height: 35px;
  max-height: 110px;
  padding: 2px 0;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 768px) {
  .chat-composer__message {
    font-size: 16px;
  }
}

.chat-composer__tools {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.composer-tool,
.model-pill,
.chat-composer__send {
  border: 0;
  font: inherit;
  cursor: default;
}

.composer-tool:disabled {
  cursor: default;
  opacity: 0.35;
}

.composer-tool--mic.is-recording {
  border-radius: 50%;
  background: rgba(233, 99, 133, 0.18);
  color: #d04467;
  animation: mic-pulse 1s ease-in-out infinite alternate;
}

@keyframes mic-pulse {
  to { transform: scale(1.08); }
}

.composer-tool {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  background: transparent;
  color: var(--text);
}

.composer-tool--plus {
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
}

.composer-tool--mic svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.model-pill {
  width: max-content;
  max-width: 142px;
  height: 29px;
  overflow: hidden;
  padding: 0 10px;
  flex: 0 1 auto;
  border: 1px solid rgba(128, 56, 79, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-composer__send {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: white;
  font-size: 15px;
  font-weight: 700;
  margin-left: auto;
}

.chat-composer__send:disabled {
  opacity: 0.45;
}

.chat-floating-panel {
  position: fixed;
  z-index: 18;
  top: calc(var(--top-height) + max(20px, env(safe-area-inset-top)));
  right: 16px;
  bottom: calc(var(--nav-height) + max(18px, env(safe-area-inset-bottom)));
  left: 16px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 18px;
  background: rgba(255, 240, 245, 0.97);
  box-shadow: 0 12px 32px rgba(128, 56, 79, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  -webkit-overflow-scrolling: touch;
}

.chat-floating-panel[hidden] {
  display: none;
}

.chat-sessions-panel {
  right: auto;
  width: calc(50vw - 16px);
  min-width: 160px;
}

.chat-model-panel {
  top: auto;
  max-height: min(50vh, 320px);
}

.chat-rename-panel,
.chat-photo-memory-panel {
  top: auto;
  max-height: min(50%, 280px);
}

.chat-panel__bar {
  position: sticky;
  z-index: 2;
  top: -12px;
  display: flex;
  margin: -12px -12px 10px;
  padding: 12px;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 240, 245, 0.97);
}

.chat-panel__bar strong {
  font-size: 12px;
}

.chat-panel__bar button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 182, 193, 0.62);
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font-size: 17px;
}

.chat-new-session {
  width: 100%;
  margin-bottom: 9px;
}

.chat-panel__hint {
  margin: -2px 1px 10px;
  color: var(--muted);
  font-size: 9px;
}

.chat-session-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.chat-session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 5px;
}

.chat-session-rename {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
}

.chat-session-rename:active {
  background: rgba(255, 182, 193, 0.2);
}

.chat-session-item {
  display: flex;
  width: 100%;
  min-height: 48px;
  padding: 9px 11px;
  align-items: flex-start;
  justify-content: center;
  border: 1px solid rgba(255, 182, 193, 0.52);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  flex-direction: column;
  text-align: left;
}

.chat-session-item.is-active {
  border-color: var(--accent-soft);
  background: rgba(255, 182, 193, 0.2);
}

.chat-session-item strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-session-item span,
.chat-panel-empty {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.chat-rename-actions {
  display: flex;
  margin-top: 12px;
  justify-content: flex-end;
  gap: 8px;
}

.chat-rename-actions button {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(255, 182, 193, 0.65);
  border-radius: 999px;
  background: white;
  color: var(--text);
  font: inherit;
  font-size: 9px;
}

.chat-photo-memory-choice button{width:100%;min-height:40px;padding:0 14px;border:1px solid rgba(255,182,193,.65);border-radius:13px;background:white;color:var(--text);font:inherit;font-size:10px;text-align:left}.chat-photo-memory-form label{display:flex;color:var(--muted);font-size:9px;flex-direction:column;gap:5px}.chat-photo-memory-form textarea{width:100%;padding:9px;border:1px solid rgba(255,182,193,.6);border-radius:12px;background:white;color:var(--text);font:inherit;font-size:10px;resize:vertical}.chat-photo-memory-status{min-height:18px;margin-top:7px;color:var(--accent);font-size:9px}

.chat-setting-field,
.chat-setting-check {
  display: flex;
  margin-top: 9px;
  padding: 10px 11px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 182, 193, 0.55);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-size: 10px;
}

.chat-setting-field select {
  max-width: 66%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: right;
}

.memory-home {
  position: relative;
  display: flex;
  min-height: inherit;
  padding: 10px 0 14px;
  flex-direction: column;
  gap: 11px;
}

.memory-card {
  display: flex;
  min-height: 96px;
  justify-content: center;
  padding: 17px 16px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  flex-direction: column;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.08);
}

.memory-card__title {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.memory-card__count {
  margin-top: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.memory-detail {
  max-height: calc(
    100dvh - var(--top-height) - var(--nav-height) -
      max(38px, env(safe-area-inset-top) + env(safe-area-inset-bottom))
  );
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.memory-detail::-webkit-scrollbar {
  display: none;
}

.memory-detail__status {
  min-height: 16px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.memory-detail__status.is-error {
  color: #c9506d;
}

.memory-detail__body {
  display: flex;
  margin-top: 8px;
  padding-bottom: 8px;
  flex-direction: column;
  gap: 10px;
}

.memory-detail__toolbar,
.memory-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.memory-search-field {
  width: 100%;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(128, 56, 79, 0.14);
  border-radius: 999px;
  outline: none;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-family: inherit;
  font-size: 10px;
}

.memory-photo-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.memory-action {
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid rgba(233, 99, 133, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 9px;
  font-weight: 650;
}

.memory-action.is-primary {
  background: var(--accent-soft);
  color: white;
}

.memory-action.is-danger {
  color: #c9506d;
}

.memory-action:disabled {
  opacity: 0.5;
}

.memory-record-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-edit-row,
.memory-message-card,
.memory-photo-form,
.memory-photo-card {
  padding: 11px;
  border: 1px solid rgba(255, 182, 193, 0.6);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.memory-edit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 8px;
}

.memory-edit-row .memory-field {
  grid-column: 1 / -1;
}

.memory-edit-row .memory-row-meta {
  align-self: center;
}

.memory-field {
  width: 100%;
  min-height: 68px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid rgba(128, 56, 79, 0.14);
  border-radius: 11px;
  outline: none;
  background: rgba(255, 240, 245, 0.58);
  color: var(--text);
  font-family: inherit;
  font-size: 10px;
  line-height: 1.5;
}

.memory-field:focus {
  border-color: rgba(233, 99, 133, 0.55);
}

.memory-row-meta {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
}

.memory-message-card p {
  margin: 8px 0 10px;
  color: var(--text);
  font-size: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.memory-photo-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-file-pick {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(233, 99, 133, 0.45);
  border-radius: 12px;
  color: var(--accent);
  font-size: 10px;
  cursor: pointer;
}

.memory-file-pick input {
  display: none;
}

.memory-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.memory-photo-grid .module-detail__empty {
  grid-column: 1 / -1;
}

.memory-photo-card {
  min-width: 0;
  padding: 7px;
}

.memory-photo-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  background: rgba(255, 182, 193, 0.15);
  object-fit: cover;
  cursor: zoom-in;
}

.memory-photo-viewer {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  min-height: 100%;
  padding: 48px 12px 18px;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 240, 245, 0.96);
  backdrop-filter: blur(6px);
}

.memory-photo-viewer[hidden] {
  display: none;
}

.memory-photo-viewer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font-size: 20px;
}

.memory-photo-viewer__image {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - var(--top-height) - var(--nav-height) - 120px);
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 10px 28px rgba(128, 56, 79, 0.14);
}

.memory-photo-viewer__status {
  align-self: start;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.memory-photo-card__note {
  min-height: 58px;
  margin-top: 7px;
}

.memory-photo-card .memory-row-meta {
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-photo-card .memory-inline-actions {
  margin-top: 7px;
  flex-wrap: wrap;
}

.memory-summary-controls {
  display: flex;
  padding: 8px 10px;
  justify-content: space-between;
  border: 1px solid rgba(255, 182, 193, 0.6);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 10px;
}

.memory-summary-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.memory-summary-text {
  min-height: 220px;
}

.module-detail {
  position: absolute;
  z-index: 10;
  inset: 0;
  min-height: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 18px;
  background: var(--page-bg);
}

.module-detail[hidden] {
  display: none;
}

.module-detail__bar {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
}

.module-detail__bar button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font-size: 21px;
}

.module-detail__title {
  grid-column: 2;
  text-align: center;
  font-size: 13px;
}

.module-detail__content {
  display: flex;
  margin-top: 16px;
  flex-direction: column;
  gap: 9px;
}

.module-detail__content article {
  padding: 13px;
  border: 1px solid rgba(255, 182, 193, 0.6);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.module-detail__content article time {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.module-detail__content article strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 11px;
}

.module-detail__content article p {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 10px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.module-detail__empty {
  margin: 24px 0;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.pulse-home {
  position: relative;
}

.pulse-detail {
  max-height: calc(
    100dvh - var(--top-height) - var(--nav-height) -
      max(38px, env(safe-area-inset-top) + env(safe-area-inset-bottom))
  );
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.pulse-detail::-webkit-scrollbar {
  display: none;
}

.pulse-entry__actions {
  display: flex;
  margin-top: 9px;
  justify-content: flex-end;
}

.pulse-entry__delete {
  padding: 5px 9px;
  border: 1px solid rgba(233, 99, 133, 0.32);
  border-radius: 999px;
  background: rgba(255, 240, 245, 0.9);
  color: var(--accent);
  font-size: 9px;
  font-weight: 650;
}

.pulse-entry__delete:disabled {
  opacity: 0.55;
}

.avatar-editor {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(128, 56, 79, 0.2);
  flex-direction: column;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.avatar-editor[hidden] {
  display: none;
}

.avatar-editor__preview {
  width: 150px;
  height: 150px;
  overflow: hidden;
  border: 4px solid white;
  border-radius: 50%;
  background: var(--page-bg);
  box-shadow: 0 12px 28px rgba(128, 56, 79, 0.2);
}

.avatar-editor__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-editor__actions {
  display: flex;
  margin-top: 15px;
  gap: 9px;
}

.avatar-editor__actions button {
  min-width: 76px;
  min-height: 36px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 999px;
  background: white;
  color: var(--text);
  font: inherit;
  font-size: 11px;
}

.avatar-editor__actions button:last-child {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: white;
}

.together-home {
  position: relative;
  display: flex;
  min-height: inherit;
  padding: 10px 0 14px;
  flex-direction: column;
  gap: 11px;
}

.mood-card {
  display: grid;
  min-height: 168px;
  grid-template-columns: minmax(0, 1fr) 88px;
  align-items: center;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.08);
}

.mood-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.mood-title button {
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}

.mood-person + .mood-person {
  margin-top: 12px;
}

.mood-person__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  color: var(--text);
  font-size: 10px;
}

.mood-state {
  color: var(--accent);
  font-size: 9px;
}

.mood-percent {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.mood-range {
  width: 100%;
  height: 14px;
  margin: 5px 0 0;
  appearance: none;
  background: transparent;
}

.mood-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--mood-value), rgba(255, 182, 193, 0.35) var(--mood-value));
}

.mood-range::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  appearance: none;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 5px rgba(128, 56, 79, 0.22);
}

.mood-range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 182, 193, 0.35);
}

.mood-range::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.mood-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--accent);
}

.mood-couple {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mood-avatar {
  width: 43px;
  flex: 0 0 auto;
  border-width: 1px;
}

.mood-avatar + .mood-heart + .mood-avatar {
  margin-left: -5px;
}

.mood-heart {
  position: relative;
  z-index: 2;
  display: grid;
  width: 24px;
  height: 24px;
  margin-right: -5px;
  margin-left: -5px;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.mood-detail__form {
  display: flex;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 182, 193, 0.66);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.94);
  flex-direction: column;
  gap: 16px;
}

.mood-detail__date {
  display: flex;
  color: var(--muted);
  font-size: 8px;
  flex-direction: column;
  gap: 4px;
}

.mood-detail__date input {
  width: 100%;
  min-height: 35px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 182, 193, 0.58);
  border-radius: 11px;
  outline: none;
  background: rgba(255, 240, 245, 0.58);
  color: var(--text);
  font: inherit;
  font-size: 10px;
}

.mood-detail__date input:focus {
  border-color: var(--accent);
}

.schedule-card {
  padding: 14px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.08);
}

.schedule-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.schedule-card__head strong {
  color: var(--text);
  font-size: 13px;
}

.schedule-card > p {
  color: var(--muted);
  font-size: 8px;
}

.schedule-card__head button {
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font: inherit;
  font-size: 16px;
}

.schedule-table {
  display: flex;
  margin-top: 12px;
  flex-direction: column;
  gap: 5px;
}

.schedule-rows{display:flex;flex-direction:column;gap:5px}

.schedule-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  align-items: center;
}

.schedule-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  font-style: normal;
  font-weight: 650;
  text-align: center;
}

.schedule-row i {
  display: flex;
  min-width: 0;
  min-height: 31px;
  padding: 3px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  border: 1px solid rgba(255, 182, 193, 0.46);
  border-radius: 6px;
  background: rgba(255, 240, 245, 0.78);
  font-style: normal;
}

.schedule-row i.has-course {
  background: rgba(255, 205, 218, 0.72);
}

.schedule-row i span,
.schedule-row i b {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 6px;
  font-weight: 650;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-preview-course{display:block;width:100%;min-width:0;padding:3px 2px;border:0;border-radius:4px;background:rgba(255,255,255,.58);overflow:hidden;color:var(--text);font:inherit;font-size:6px;font-weight:650;line-height:1.15;text-align:center;text-overflow:ellipsis;white-space:nowrap}

.schedule-row:nth-child(3) i:nth-child(odd),
.schedule-row:nth-child(4) i:nth-child(even) {
  background: rgba(255, 214, 224, 0.58);
}

.schedule-card > p {
  margin: 10px 0 0;
  text-align: right;
}

.schedule-detail {
  position: absolute;
  z-index: 12;
  inset: 0;
  min-height: 100%;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 18px;
  background: var(--page-bg);
}

.schedule-detail[hidden] {
  display: none;
}

.schedule-detail__bar {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
}

.schedule-detail__bar button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font-size: 21px;
}

.schedule-detail__bar strong {
  grid-column: 2;
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.schedule-form {
  display: grid;
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(255, 182, 193, 0.66);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.88);
}

.schedule-form label {
  display: flex;
  min-width: 0;
  color: var(--muted);
  font-size: 8px;
  flex-direction: column;
  gap: 4px;
}

.schedule-form input,
.schedule-form select,
.schedule-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 35px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 182, 193, 0.58);
  border-radius: 11px;
  outline: none;
  background: rgba(255, 240, 245, 0.58);
  color: var(--text);
  font: inherit;
  font-size: 10px;
}

.schedule-form textarea {
  min-height: 52px;
  resize: vertical;
}

.schedule-form input:focus,
.schedule-form select:focus,
.schedule-form textarea:focus {
  border-color: var(--accent);
}

.schedule-form__wide,
.schedule-form__actions {
  grid-column: 1 / -1;
}

.schedule-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.schedule-form__actions button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 999px;
  background: white;
  color: var(--text);
  font: inherit;
  font-size: 9px;
}

.schedule-form__actions button[type="submit"] {
  background: var(--accent);
  color: white;
}

.schedule-form__actions .schedule-delete {
  margin-right: auto;
  border-color: rgba(181, 81, 112, 0.34);
  color: #b55170;
}

.schedule-status {
  min-height: 23px;
  padding: 7px 4px 2px;
  color: var(--muted);
  font-size: 9px;
}

.schedule-status.is-error {
  color: #b55170;
}

.schedule-detail__list {
  display: flex;
  padding-bottom: 12px;
  flex-direction: column;
  gap: 11px;
}

.schedule-day-group h3 {
  margin: 0 0 5px 4px;
  color: var(--accent-strong, var(--accent));
  font-size: 10px;
}

.schedule-course-row {
  display: grid;
  width: 100%;
  min-height: 55px;
  grid-template-columns: 70px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 182, 193, 0.62);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font: inherit;
  text-align: left;
}

.schedule-course-row + .schedule-course-row {
  margin-top: 6px;
}

.schedule-course-row time {
  color: var(--muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.schedule-course-row > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.schedule-course-row strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-course-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-course-row > b {
  color: var(--accent);
  font-size: 16px;
  font-weight: 500;
}

.schedule-detail__empty {
  padding: 30px 12px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.together-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.together-link {
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  box-shadow: 0 5px 15px rgba(190, 89, 117, 0.08);
}

.together-link span:last-child {
  color: var(--accent);
  font-size: 22px;
  font-weight: 400;
}

.together-detail {
  position: absolute;
  z-index: 10;
  inset: 0;
  min-height: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 18px;
  background: var(--page-bg);
}

.together-detail[hidden] {
  display: none;
}

.together-detail__bar {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
}

.together-detail__bar button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 182, 193, 0.72);
  border-radius: 50%;
  background: white;
  color: var(--accent);
  font-size: 21px;
}

.together-detail__title {
  grid-column: 2;
  text-align: center;
  font-size: 13px;
}

.together-detail__empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
}

.diary-widget{padding:13px 14px;border:1px solid rgba(255,182,193,.72);border-radius:18px;background:rgba(255,255,255,.88);box-shadow:0 5px 15px rgba(190,89,117,.08)}
.diary-widget__head,.anniversary-section__head,.together-calendar__nav{display:flex;align-items:center;justify-content:space-between;gap:9px}
.diary-widget__head strong{color:var(--text);font-size:13px}
.diary-widget__head button,.anniversary-section__head button{padding:5px 9px;border:1px solid rgba(255,182,193,.6);border-radius:999px;background:white;color:var(--accent);font:inherit;font-size:9px}
.diary-widget__preview{margin-top:8px}
.diary-preview-line{display:grid;width:100%;grid-template-columns:38px minmax(0,1fr);gap:8px;padding:7px 2px;border:0;background:transparent;color:var(--text);font:inherit;font-size:9px;text-align:left}
.diary-preview-line+.diary-preview-line{border-top:1px solid rgba(255,182,193,.3)}
.diary-preview-line time{color:var(--accent);font-variant-numeric:tabular-nums}.diary-preview-line span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.together-feature-detail{position:fixed;z-index:19;top:calc(var(--top-height) + max(14px,env(safe-area-inset-top)));right:10px;bottom:calc(var(--nav-height) + max(14px,env(safe-area-inset-bottom)));left:10px;min-height:0;padding:12px;overflow-x:hidden;overflow-y:auto;border:1px solid rgba(255,182,193,.72);border-radius:18px;background:var(--page-bg);box-shadow:0 8px 28px rgba(190,89,117,.12);overscroll-behavior:contain}
.together-feature-detail[hidden],.diary-editor[hidden],.diary-read-view[hidden],.diary-detail__list[hidden]{display:none}.together-detail-add{grid-column:3}
.together-status{min-height:22px;padding:7px 3px 2px;color:var(--muted);font-size:9px}.together-status.is-error{color:#b55170}.together-empty{padding:14px 5px;color:var(--muted);font-size:9px;text-align:center}
.diary-detail__list{display:flex;flex-direction:column;gap:7px;padding-bottom:12px}
.diary-list-item{display:flex;width:100%;padding:11px 12px;border:1px solid rgba(255,182,193,.62);border-radius:14px;background:rgba(255,255,255,.88);color:var(--text);font:inherit;text-align:left;flex-direction:column;gap:5px}
.diary-list-item time{color:var(--accent);font-size:9px}.diary-list-item span{display:-webkit-box;overflow:hidden;font-size:10px;line-height:1.45;white-space:pre-wrap;-webkit-box-orient:vertical;-webkit-line-clamp:3}.diary-editor{position:sticky;z-index:2;bottom:0;padding-top:6px;background:var(--page-bg)}
.diary-read-view{display:flex;flex-direction:column;gap:10px}.diary-read-view__head{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px}.diary-read-view__head button{padding:6px 9px;border:1px solid rgba(255,182,193,.62);border-radius:999px;background:white;color:var(--accent);font:inherit;font-size:9px}.diary-read-view__head time{color:var(--muted);font-size:9px}.diary-read-entries{display:flex;flex-direction:column;gap:10px}.diary-read-view section{padding:12px;border:1px solid rgba(255,182,193,.62);border-radius:15px;background:rgba(255,255,255,.9)}.diary-entry-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.diary-entry-head button{padding:4px 8px;border:1px solid rgba(255,182,193,.62);border-radius:999px;background:white;color:var(--accent);font:inherit;font-size:8px}.diary-read-view section strong{color:var(--accent);font-size:10px}.diary-read-view section p{margin:7px 0 0;color:var(--text);font-size:10px;line-height:1.65;white-space:pre-wrap}.diary-floating-add{position:fixed;z-index:21;right:24px;bottom:calc(var(--nav-height) + max(24px,env(safe-area-inset-bottom)));width:44px;height:44px;border:0;border-radius:50%;background:var(--accent);box-shadow:0 6px 18px rgba(190,89,117,.3);color:white;font:inherit;font-size:24px;line-height:1}
.together-form{display:flex;padding:11px;border:1px solid rgba(255,182,193,.66);border-radius:17px;background:rgba(255,255,255,.94);flex-direction:column;gap:8px}
.together-form label{display:flex;color:var(--muted);font-size:8px;flex-direction:column;gap:4px}.together-form input,.together-form textarea{width:100%;min-height:35px;padding:7px 9px;border:1px solid rgba(255,182,193,.58);border-radius:11px;outline:none;background:rgba(255,240,245,.58);color:var(--text);font:inherit;font-size:10px}.together-form textarea{resize:vertical}.together-form input:focus,.together-form textarea:focus{border-color:var(--accent)}
.together-form__actions{display:flex;justify-content:flex-end;gap:7px}.together-form__actions button{min-height:30px;padding:0 12px;border:1px solid rgba(255,182,193,.72);border-radius:999px;background:white;color:var(--text);font:inherit;font-size:9px}.together-form__actions button[type=submit]{background:var(--accent);color:white}.together-form__actions .together-delete{margin-right:auto;color:#b55170}
.together-calendar__nav{margin:14px 0 8px}.together-calendar__nav strong{color:var(--text);font-size:13px}.together-calendar__nav button{width:30px;height:30px;padding:0;border:0;background:transparent;color:var(--accent);font-size:22px}
.together-calendar__grid{display:grid;grid-template-columns:repeat(7,1fr);gap:5px 3px}.together-calendar__grid>i{min-height:36px}.together-calendar__weekday{padding:4px 0;color:var(--muted);font-size:8px;font-weight:700;text-align:center}
.together-calendar__day{position:relative;display:flex;min-width:0;aspect-ratio:1;align-items:center;justify-content:center;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.72);color:var(--text);font:inherit;font-size:10px}.together-calendar__day.is-today{box-shadow:inset 0 0 0 1px var(--accent)}.together-calendar__day.is-selected{background:var(--accent-soft);color:white}.together-calendar__day b{position:absolute;right:1px;bottom:0;color:var(--accent);font-size:8px;line-height:1}.together-calendar__day.is-selected b{color:white}
.anniversary-section{margin-top:14px;padding-top:12px;border-top:1px solid rgba(255,182,193,.45)}.anniversary-section__head>div{display:flex;flex-direction:column;gap:2px}.anniversary-section__head small{color:var(--muted);font-size:8px}.anniversary-section__head strong{color:var(--text);font-size:10px}.anniversary-day-list{display:flex;margin:9px 0;flex-direction:column;gap:6px}
.anniversary-row{display:grid;width:100%;grid-template-columns:20px minmax(0,1fr);align-items:center;gap:7px;padding:9px 10px;border:1px solid rgba(255,182,193,.62);border-radius:13px;background:rgba(255,255,255,.88);color:var(--text);font:inherit;text-align:left}.anniversary-row>span:first-child{color:var(--accent);font-size:14px}.anniversary-row>span:last-child{display:flex;min-width:0;flex-direction:column;gap:2px}.anniversary-row strong{font-size:10px}.anniversary-row small{overflow:hidden;color:var(--muted);font-size:8px;text-overflow:ellipsis;white-space:nowrap}.anniversary-form{margin-top:8px}.anniversary-repeat{display:grid!important;grid-template-columns:18px 1fr;align-items:center}.anniversary-repeat input{width:16px;min-height:16px;padding:0}

.anniversary-card {
  display: flex;
  height: 112px;
  min-height: 112px;
  padding: 15px 14px;
  border-radius: 17px;
  flex-direction: column;
  overflow: hidden;
}

.anniversary-card__title {
  color: var(--text);
  font-size: 11px;
  font-weight: 760;
}

.anniversary-list {
  display: grid;
  min-height: 0;
  margin: 9px 0 0;
  padding: 0 4px 2px 0;
  overflow-x: hidden;
  overflow-y: auto;
  gap: 10px;
  list-style: none;
  overscroll-behavior: contain;
  scrollbar-color: rgba(233, 99, 133, 0.35) transparent;
  scrollbar-width: thin;
}

.anniversary-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.anniversary-item strong {
  color: var(--accent);
  font-size: 11px;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 10px;
  bottom: max(6px, env(safe-area-inset-bottom));
  left: 10px;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(190, 89, 117, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-item {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  transition: color 150ms ease, background-color 150ms ease;
}

.nav-item img {
  width: 22px;
  height: 22px;
  opacity: 0.72;
  transition: opacity 150ms ease, transform 150ms ease;
}

.nav-item::after {
  position: absolute;
  right: 24%;
  bottom: 4px;
  left: 24%;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.5);
  transition: opacity 150ms ease, transform 150ms ease;
}

.nav-item[aria-current="page"] {
  background: rgba(255, 182, 193, 0.17);
  color: var(--accent);
}

.nav-item[aria-current="page"] img {
  opacity: 1;
  transform: translateY(-1px);
}

.nav-item[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

@media (max-width: 360px), (max-height: 650px) {
  :root {
    --top-height: 42px;
    --nav-height: 56px;
  }

  .top-bar,
  .bottom-nav {
    right: 7px;
    left: 7px;
  }

  .top-bar {
    padding: 0 12px;
    border-radius: 13px;
  }

  .top-menu {
    left: 7px;
    width: min(220px, calc(100vw - 14px));
  }

  .bottom-nav {
    border-radius: 16px;
  }

  .nav-item {
    gap: 1px;
    font-size: 8px;
  }

  .nav-item img {
    width: 20px;
    height: 20px;
  }

  .sl-home {
    gap: 9px;
    padding-top: 7px;
  }

  .couple-summary {
    grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr);
  }

  .relationship {
    padding-top: 17px;
  }

  .info-card {
    min-height: 82px;
    padding: 9px 10px;
  }

  .widget-grid {
    margin-top: 14px;
  }

  .anniversary-card {
    height: 118px;
    min-height: 118px;
    padding: 15px 13px;
  }

  .info-card__value {
    margin-top: 5px;
    font-size: 14px;
  }
}

.menu-action-card {
  display: flex;
  width: 100%;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--theme-border-strong);
  border-radius: 15px;
  align-items: center;
  justify-content: space-between;
  background: var(--theme-card);
  color: var(--text);
  font: inherit;
  text-align: left;
  box-shadow: 0 5px 15px var(--theme-shadow);
}

.menu-action-card span,
.appearance-options button span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.menu-action-card strong,
.appearance-options strong {
  font-size: 10px;
}

.menu-action-card small,
.appearance-options small {
  color: var(--muted);
  font-size: 8px;
}

.menu-action-card > b {
  color: var(--accent);
  font-size: 20px;
  font-weight: 400;
}

.appearance-options {
  display: grid;
  gap: 8px;
}

.appearance-options button {
  display: grid;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--theme-border);
  border-radius: 15px;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  background: var(--theme-card);
  color: var(--text);
  font: inherit;
  text-align: left;
  box-shadow: 0 4px 12px var(--theme-shadow);
}

.appearance-options button.is-active {
  border-color: var(--accent);
  background: var(--theme-tint);
}

.appearance-options button > b {
  color: var(--accent);
  font-size: 13px;
  opacity: 0;
}

.appearance-options button.is-active > b {
  opacity: 1;
}

.appearance-swatch {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(70, 74, 82, 0.14);
}

.appearance-swatch--pink { background: linear-gradient(135deg, #fff0f5 0 48%, #f39aae 49% 100%); }
.appearance-swatch--blue { background: linear-gradient(135deg, #eef9ff 0 48%, #a9dcf7 49% 100%); }
.appearance-swatch--gray { background: linear-gradient(135deg, #f3f4f6 0 48%, #c7cbd2 49% 100%); }

.nav-item img {
  filter: var(--theme-icon-filter);
}

html[data-theme]:not([data-theme="pink"]) :is(.top-menu, .menu-view, .bottom-nav) {
  border-color: var(--theme-border-strong);
  background: var(--theme-card-strong);
  box-shadow: 0 6px 18px var(--theme-shadow);
}

html[data-theme]:not([data-theme="pink"]) :is(
  .info-card,
  .itinerary-card,
  .anniversary-card,
  .weather-card,
  .pulse-status,
  .pulse-module,
  .pulse-activity,
  .pulse-activity__item,
  .menu-toggle-card,
  .menu-notification-card,
  .menu-feedback-card,
  .menu-log-card,
  .menu-search-box,
  .menu-search-result,
  .chat-composer,
  .chat-floating-panel,
  .chat-tool,
  .chat-attachment,
  .memory-card,
  .memory-message-card,
  .memory-photo-card,
  .memory-detail__body,
  .diary-widget,
  .diary-list-item,
  .diary-read-view section,
  .reminder-item,
  .schedule-card,
  .schedule-course-row,
  .mood-detail__form,
  .together-form,
  .anniversary-row,
  .together-link,
  .together-calendar__day,
  .mood-card,
  .module-detail,
  .pulse-detail,
  .together-detail,
  .itinerary-detail,
  .schedule-detail,
  .memory-detail,
  .diary-read-view
) {
  border-color: var(--theme-border);
  background: var(--theme-card);
  box-shadow: 0 5px 15px var(--theme-shadow);
}

html[data-theme]:not([data-theme="pink"]) :is(
  .reminder-form,
  .itinerary-form,
  .schedule-form,
  .together-form,
  .memory-photo-form,
  .memory-photo-search,
  .memory-search-field,
  .chat-photo-memory-form
) :is(input, textarea, select),
html[data-theme]:not([data-theme="pink"]) :is(.chat-session-rename, .chat-photo-memory-choice button) {
  border-color: var(--theme-border);
  background: var(--theme-tint);
  color: var(--text);
}

html[data-theme]:not([data-theme="pink"]) :is(
  .chat-bubble--partner,
  .chat-system,
  .chat-status:not(:empty)
) {
  border-color: var(--theme-border);
  background: var(--theme-card-strong);
  box-shadow: 0 4px 12px var(--theme-shadow);
}

html[data-theme]:not([data-theme="pink"]) :is(
  .chat-bubble--me,
  .chat-system--location,
  .nav-item[aria-current="page"],
  .chat-session-item.is-active,
  .appearance-options button.is-active
) {
  border-color: var(--theme-border);
  background: var(--theme-tint-strong);
}

html[data-theme]:not([data-theme="pink"]) :is(
  .info-card__icon,
  .itinerary-preview__icon,
  .itinerary-item__icon,
  .pulse-module__icon,
  .memory-card__count
) {
  color: var(--accent);
  background: var(--theme-tint);
}

html[data-theme]:not([data-theme="pink"]) :is(
  .itinerary-detail__bar,
  .schedule-detail__bar,
  .reminder-detail__bar,
  .module-detail__bar,
  .together-detail__bar,
  .memory-detail__toolbar,
  .chat-panel__bar
) {
  border-color: var(--theme-border);
  background: var(--theme-tint);
}

html[data-theme]:not([data-theme="pink"]) :is(
  .composer-tool,
  .chat-header-action,
  .memory-action,
  .pulse-entry__actions button,
  .mood-title button,
  .schedule-card__head button,
  .schedule-detail__bar button,
  .diary-widget__head button,
  .diary-read-view__head button,
  .diary-entry-head button,
  .anniversary-section__head button,
  .together-form button,
  .schedule-form button,
  .itinerary-form button,
  .reminder-form button
) {
  border-color: var(--theme-border);
  color: var(--accent);
}

html[data-theme]:not([data-theme="pink"]) .mood-range::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--accent) var(--mood-value), var(--theme-border) var(--mood-value));
}

html[data-theme]:not([data-theme="pink"]) .mood-range::-moz-range-track {
  background: var(--theme-border);
}

html[data-theme]:not([data-theme="pink"]) .schedule-row i {
  border-color: var(--theme-border);
  background: var(--theme-tint);
}

html[data-theme]:not([data-theme="pink"]) .schedule-row i.has-course {
  background: var(--theme-tint-strong);
}

html[data-theme]:not([data-theme="pink"]) :is(
  .schedule-row:nth-child(3) i:nth-child(odd),
  .schedule-row:nth-child(4) i:nth-child(even)
) {
  background: var(--theme-tint);
}

html[data-theme]:not([data-theme="pink"]) .schedule-preview-course {
  background: var(--theme-card-strong);
}

html[data-theme]:not([data-theme="pink"]) :is(
  .diary-preview-line + .diary-preview-line,
  .anniversary-section
) {
  border-color: var(--theme-border);
}

html[data-theme]:not([data-theme="pink"]) .together-feature-detail {
  border-color: var(--theme-border-strong);
  box-shadow: 0 8px 28px var(--theme-shadow);
}

.background-settings { display: grid; gap: 12px; margin-top: 16px; padding: 16px; border: 1px solid var(--theme-border); border-radius: 18px; background: var(--theme-card); }
.background-settings button, .background-choose { min-height: 44px; padding: 10px 12px; border: 1px solid var(--theme-border); border-radius: 12px; background: var(--theme-card-strong); color: var(--text); font: inherit; }
.background-settings, .background-settings > * { min-width: 0; }
.background-choose { display: block; position: relative; cursor: pointer; }
.background-choose input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.background-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.background-actions button { flex: 1 1 120px; min-width: 0; font-size: 13px; }
.background-actions button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.background-settings p { margin: 0; color: var(--muted); font-size: 12px; }
.background-settings button:disabled { opacity: .5; }

/* Wallpaper is scoped to the signed-in shell. Existing themes remain unchanged. */
html:root[data-custom-background] {
  --page-bg: #202531; --text: #f5f6fa; --text-color: #f5f6fa; --muted: #d2d6e1;
  --bar-text: #fff; --accent: #e7c5dc; --accent-soft: #c2c9dc;
  --glass-surface: rgba(22, 27, 42, .48); --glass-inner: rgba(26, 31, 46, .23);
  --glass-border: rgba(255,255,255,.28); --glass-overlay: rgba(5,10,23,.3);
  --theme-card: var(--glass-surface); --theme-card-strong: var(--glass-surface);
  --theme-border: var(--glass-border); --theme-border-strong: var(--glass-border);
  --theme-tint: var(--glass-inner); --theme-tint-strong: rgba(95,109,145,.38);
  --theme-active: rgba(255,255,255,.15); --theme-shadow: rgba(0,0,0,.12);
  --theme-accent-strong: #e7c5dc; --line: var(--glass-border); --border: var(--glass-border);
  --surface: var(--glass-surface); --bar-bg: var(--glass-surface); --card-bg: var(--glass-surface);
  --theme-icon-filter: grayscale(.3) brightness(1.65);
}
html:root[data-custom-background="light"] {
  --page-bg: #e6e8ed; --text: #333b4a; --text-color: #333b4a; --muted: #555e70;
  --bar-text: #333b4a; --accent: #885875; --accent-soft: #b8a1b2;
  --glass-surface: rgba(255,255,255,.48); --glass-inner: rgba(255,255,255,.22);
  --glass-border: rgba(255,255,255,.6); --glass-overlay: rgba(255,255,255,.17);
  --theme-tint-strong: rgba(236,215,230,.42); --theme-active: rgba(255,255,255,.32);
  --theme-accent-strong: #885875; --theme-icon-filter: grayscale(.3);
}
html:root[data-custom-background] .app-shell { isolation: isolate; background: transparent; }
html:root[data-custom-background] .app-shell::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--glass-overlay),var(--glass-overlay)), var(--custom-wallpaper);
  background-position: center; background-size: cover; background-repeat: no-repeat;
}
html:root[data-custom-background] :is(
  .top-bar,.bottom-nav,.top-menu,.menu-view,.chat-couple,.chat-composer,.chat-bubble,
  .info-card,.itinerary-card,.anniversary-card,.weather-card,.pulse-status,.pulse-module,.pulse-activity,
  .menu-action-card,.menu-toggle-card,.menu-notification-card,.menu-feedback-card,.menu-log-card,.menu-search-box,.menu-search-result,
  .chat-floating-panel,.chat-tool,.chat-attachment,.chat-system,.memory-card,.memory-message-card,.memory-photo-card,
  .memory-detail__body,.diary-widget,.reminder-item,.schedule-card,.mood-card,.together-link,.background-settings,
  .module-detail,.pulse-detail,.together-detail,.itinerary-detail,.schedule-detail,.memory-detail,.diary-read-view,.together-feature-detail,
  .draw-card,.ui-text-editor__card,.avatar-editor__card,.chat-photo-memory-panel
) {
  background: var(--glass-surface); border-color: var(--glass-border); color: var(--text);
  box-shadow: 0 5px 18px var(--theme-shadow);
}
/* Blur only main surfaces; nested items use translucent fills without extra blur. */
html:root[data-custom-background] :is(
  .top-bar,.bottom-nav,.top-menu,.menu-view,.chat-couple,.chat-composer,.chat-bubble,
  .info-card,.itinerary-card,.anniversary-card,.weather-card,.pulse-status,.pulse-module,.pulse-activity,
  .memory-card,.diary-widget,.schedule-card,.mood-card,.together-link,.draw-card,
  .module-detail,.pulse-detail,.together-feature-detail
) { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
html:root[data-custom-background] :is(
  .pulse-activity__item,.diary-list-item,.diary-read-view section,.schedule-course-row,.anniversary-row,.together-calendar__day,
  .mood-detail__form,.together-form,.chat-session-item,.chat-session-rename,.chat-photo-memory-choice button,
  .appearance-options button,.background-settings button,.background-choose,.draw-page button,.draw-page input,.draw-page select,
  .menu-view__header button,.chat-header-action,.model-pill,.ui-text-editor__actions button,.avatar-editor__actions button,
  .schedule-form,.reminder-form,.itinerary-form,.memory-photo-form,.memory-photo-search,.chat-photo-memory-form
) { background: var(--glass-inner); border-color: var(--glass-border); color: var(--text); }
html:root[data-custom-background] .app-shell :is(input,textarea,select) { color: var(--text); background-color: var(--glass-inner); border-color: var(--glass-border); }
html:root[data-custom-background] .app-shell :is(input,textarea)::placeholder { color: var(--muted); opacity: .9; }
html:root[data-custom-background] :is(.chat-bubble--me,.nav-item[aria-current="page"],.chat-session-item.is-active) { background: var(--theme-tint-strong); }
html:root[data-custom-background] .draw-svg { background: #fff; }
@supports not ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  html:root[data-custom-background="dark"] { --glass-surface: rgba(22,27,42,.86); }
  html:root[data-custom-background="light"] { --glass-surface: rgba(255,255,255,.86); }
}

/* Remaining Chat chrome follows the selected preset; wallpaper has its own rules. */
html:is([data-theme="baby-blue"], [data-theme="gray"]):not([data-custom-background]) :is(.chat-couple, .model-pill) {
  border-color: var(--theme-border-strong);
}
html:is([data-theme="baby-blue"], [data-theme="gray"]):not([data-custom-background]) .chat-couple {
  box-shadow: 0 5px 15px var(--theme-shadow);
}
html:is([data-theme="baby-blue"], [data-theme="gray"]):not([data-custom-background]) .chat-scroll-thumb {
  background: var(--accent);
  opacity: .72;
  box-shadow: 0 1px 4px var(--theme-shadow);
}
html:is([data-theme="baby-blue"], [data-theme="gray"]):not([data-custom-background]) .chat-scroll-thumb.is-dragging {
  background: var(--accent);
  opacity: 1;
}

/* Neutral controls in wallpaper mode, including fixed pink legacy styles. */
html:root[data-custom-background] {
  --accent: #eceff5; --accent-soft: #cbd1dc; --theme-accent-strong: #eceff5;
  --theme-tint-strong: rgba(210,218,233,.2);
  --theme-icon-filter: brightness(0) invert(1);
  --glass-control: #e5e9f1; --glass-control-rest: rgba(229,233,241,.28);
}
html:root[data-custom-background="light"] {
  --accent: #626b79; --accent-soft: #959da9; --theme-accent-strong: #626b79;
  --theme-tint-strong: rgba(105,115,132,.17);
  --theme-icon-filter: brightness(0) invert(.4);
  --glass-control: #687383; --glass-control-rest: rgba(104,115,131,.25);
}
html:root[data-custom-background] .app-shell img[src*="/icons/"] { filter: var(--theme-icon-filter); }
html:root[data-custom-background] :is(.info-card__icon,.itinerary-preview__icon,.itinerary-item__icon,.pulse-module__icon) {
  color: var(--accent); filter: grayscale(1); background: transparent;
}
html:root[data-custom-background] :is(
  .mood-title button,.mood-heart,.schedule-card__head button,.schedule-detail__bar button,
  .diary-widget__head button,.anniversary-section__head button,.diary-read-view__head button,.diary-entry-head button,
  .composer-tool,.memory-action,.pulse-entry__actions button
) { color: var(--accent); background: var(--glass-inner); border-color: var(--glass-border); }
html:root[data-custom-background] :is(.memory-card__count,.memory-row-meta,.memory-photo-card__note,.schedule-card > p) {
  color: var(--muted); background: transparent;
}
html:root[data-custom-background] .chat-scroll-thumb {
  background: var(--glass-control-rest); box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
html:root[data-custom-background] .chat-scroll-thumb.is-dragging { background: var(--glass-control); }
html:root[data-custom-background] .mood-range { background: transparent; }
html:root[data-custom-background] .mood-range::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--glass-control) var(--mood-value), var(--glass-control-rest) var(--mood-value));
}
html:root[data-custom-background] .mood-range::-webkit-slider-thumb {
  background: var(--glass-control); border-color: var(--glass-border); box-shadow: 0 2px 5px rgba(0,0,0,.18);
}
html:root[data-custom-background] .mood-range::-moz-range-track { background: var(--glass-control-rest); }
html:root[data-custom-background] .mood-range::-moz-range-progress { background: var(--glass-control); }
html:root[data-custom-background] .mood-range::-moz-range-thumb { background: var(--glass-control); border-color: var(--glass-border); }
html:root[data-custom-background] :is(
  .schedule-row i,.schedule-row i.has-course,
  .schedule-row:nth-child(3) i:nth-child(odd),.schedule-row:nth-child(4) i:nth-child(even)
) { background: var(--glass-inner); border-color: var(--glass-border); }
html:root[data-custom-background] .schedule-row:nth-child(n) i.has-course { background: var(--theme-tint-strong); }
html:root[data-custom-background] .schedule-preview-course { background: var(--glass-inner); color: var(--text); }
html:root[data-custom-background] :is(.info-card__scroll,.anniversary-list) { scrollbar-color: var(--glass-control-rest) transparent; }
html:root[data-custom-background] .info-card__scroll::-webkit-scrollbar-thumb { background: var(--glass-control-rest); }

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