:root {
  color-scheme: light;
  --line-green: #06c755;
  --line-green-dark: #04a946;
  --line-chat: #8fa9c6;
  --line-chat-deep: #7898bb;
  --line-ink: #17202a;
  --line-muted: #697581;
  --line-surface: #ffffff;
  --line-canvas: #eef1f4;
  --line-rule: #e5e9ed;
  --line-shadow: 0 14px 40px rgba(27, 44, 61, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.reminder-page,
body.portal-page {
  margin: 0;
  min-height: 100vh;
  background: var(--line-canvas);
  color: var(--line-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}

.app-topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  min-height: 62px;
  padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(18, 34, 48, 0.1);
  box-shadow: 0 2px 12px rgba(22, 36, 49, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-topbar__back,
.app-topbar__action {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--line-ink);
  background: transparent;
  text-decoration: none;
  font-size: 25px;
  line-height: 1;
}

.app-topbar__back:hover,
.app-topbar__action:hover {
  background: #f0f3f5;
}

.app-topbar__title {
  min-width: 0;
  text-align: center;
}

.app-topbar__title strong,
.app-topbar__title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-topbar__title strong {
  font-size: 15px;
  line-height: 1.35;
}

.app-topbar__title span {
  margin-top: 1px;
  color: #7a858f;
  font-size: 11px;
  line-height: 1.3;
}

.line-logo {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: var(--line-green);
  box-shadow: 0 5px 16px rgba(6, 199, 85, 0.26);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

body.reminder-page main {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 72px;
}

body.reminder-page main > header {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 30px clamp(22px, 5vw, 44px);
  border: 1px solid #dfe5e9;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--line-shadow);
}

body.reminder-page main > header::after {
  position: absolute;
  top: -54px;
  right: -42px;
  width: 170px;
  height: 170px;
  border-radius: 52px;
  background: linear-gradient(135deg, rgba(6, 199, 85, 0.2), rgba(6, 199, 85, 0.04));
  content: "";
  transform: rotate(18deg);
}

body.reminder-page h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  color: var(--line-ink);
  font-size: clamp(24px, 4vw, 37px);
  line-height: 1.3;
  letter-spacing: -0.025em;
}

body.reminder-page .lead {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--line-muted);
  font-size: 14px;
}

body.reminder-page .note {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 0;
  border-left: 4px solid var(--line-green);
  border-radius: 0 10px 10px 0;
  color: #59656f;
  background: #f4f7f5;
  font-size: 13px;
}

.timeline-nav {
  position: sticky;
  z-index: 80;
  top: 63px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 18px -4px 0;
  padding: 9px 4px 13px;
  scrollbar-width: none;
}

.timeline-nav::-webkit-scrollbar {
  display: none;
}

.timeline-nav a {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid #dce2e6;
  border-radius: 999px;
  color: #46535e;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 14px rgba(27, 44, 61, 0.07);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.timeline-nav a:hover,
.timeline-nav a:focus-visible {
  border-color: var(--line-green);
  color: var(--line-green-dark);
}

body.reminder-page .creative {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid #dfe5e9;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--line-shadow);
}

body.reminder-page .creative h2 {
  margin: 0 0 4px;
  color: var(--line-ink);
  font-size: 18px;
}

body.reminder-page .creative p {
  margin: 0 0 14px;
  color: var(--line-muted);
  font-size: 13px;
}

body.reminder-page .creative img {
  display: block;
  width: min(100%, 760px);
  height: auto;
  border: 0;
  border-radius: 12px;
  background: #f3f5f7;
}

body.reminder-page .section {
  margin-top: 24px;
}

body.reminder-page .card {
  scroll-margin-top: 126px;
  overflow: hidden;
  margin-top: 26px;
  border: 1px solid #dce3e8;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--line-shadow);
}

body.reminder-page .card-head {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 18px 20px 17px 74px;
  border: 0;
  border-bottom: 1px solid #e8ecef;
  background: #fff;
}

body.reminder-page .card-head::before {
  position: absolute;
  top: 18px;
  left: 20px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--line-green);
  content: "S";
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(6, 199, 85, 0.24);
}

body.reminder-page .timing {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 0;
  border-radius: 999px;
  color: var(--line-green-dark);
  background: #eaf9f0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

body.reminder-page .card-head h2 {
  margin: 0;
  color: var(--line-ink);
  font-size: clamp(16px, 2.6vw, 20px);
  line-height: 1.45;
}

body.reminder-page .meta {
  margin: 0;
  color: #7b8790;
  font-size: 12px;
  line-height: 1.5;
}

body.reminder-page .message-wrap {
  display: flex;
  grid-template-columns: none;
  flex-direction: column;
  gap: 12px;
  padding: 25px 20px 28px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.12) 0 2px, transparent 3px),
    linear-gradient(145deg, var(--line-chat), var(--line-chat-deep));
  background-size: 28px 28px, auto;
}

body.reminder-page .type {
  align-self: center;
  margin: 2px 0;
  padding: 4px 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(44, 68, 91, 0.35);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  backdrop-filter: blur(8px);
}

body.reminder-page .bubble {
  position: relative;
  align-self: flex-start;
  width: min(100% - 58px, 760px);
  margin: 0 0 0 56px;
  padding: 15px 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 0;
  border-radius: 4px 16px 16px 16px;
  color: #1d252c;
  background: #fff;
  box-shadow: 0 4px 13px rgba(32, 53, 73, 0.13);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.72;
}

body.reminder-page .bubble::before,
body.reminder-page .visual::before {
  position: absolute;
  top: 0;
  left: -56px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #15d466, #05af49);
  content: "S";
  box-shadow: 0 3px 10px rgba(32, 53, 73, 0.2);
  font-size: 15px;
  font-weight: 900;
}

body.reminder-page .bubble::after,
body.reminder-page .visual::after {
  position: absolute;
  top: 0;
  left: -9px;
  width: 15px;
  height: 16px;
  background: #fff;
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  content: "";
}

body.reminder-page .visual {
  position: relative;
  align-self: flex-start;
  display: grid;
  width: min(100% - 58px, 560px);
  gap: 10px;
  margin: 0 0 0 56px;
  padding: 12px;
  border: 0;
  border-radius: 4px 16px 16px 16px;
  background: #fff;
  box-shadow: 0 4px 13px rgba(32, 53, 73, 0.13);
}

body.reminder-page .visual-title {
  color: var(--line-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

body.reminder-page .visual-body {
  color: #4f5a64;
  font-size: 13px;
}

body.reminder-page .visual-image,
body.reminder-page .visual-image.square {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: 9px;
  background: #f3f5f6;
}

body.reminder-page .button-preview {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--line-green);
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

body.reminder-page .button-preview:hover {
  background: var(--line-green-dark);
}

body.reminder-page .notify {
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  color: #65717b;
  background: #f1f4f5;
  font-size: 12px;
}

body.reminder-page .checklist {
  margin: 0;
  padding: 0;
  color: #57636d;
  font-size: 12px;
  list-style: none;
}

.message-actions {
  display: flex;
  width: min(100% - 58px, 760px);
  justify-content: flex-end;
  margin: -5px 0 2px 56px;
}

.copy-message {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  color: #fff;
  background: rgba(44, 68, 91, 0.38);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.copy-message:hover,
.copy-message:focus-visible {
  background: rgba(31, 53, 73, 0.58);
}

body.reminder-page .excluded {
  margin-top: 24px;
  padding: 15px 17px;
  border: 1px dashed #cbd3d9;
  border-radius: 14px;
  color: #6f7a83;
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 200;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(22, 31, 39, 0.9);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.portal-page {
  background: #f5f7f8;
}

body.portal-page .app-topbar {
  grid-template-columns: 48px minmax(0, 1fr) 48px;
}

.portal-main {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 0 0 58px;
  background: #fff;
  min-height: calc(100vh - 62px);
}

.portal-hero {
  padding: 26px 22px 20px;
  background: linear-gradient(180deg, #fff 0%, #f7faf8 100%);
  border-bottom: 8px solid #f0f2f4;
}

.portal-hero__eyebrow {
  margin: 0 0 8px;
  color: var(--line-green-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portal-hero h1 {
  margin: 0;
  color: var(--line-ink);
  font-size: clamp(25px, 7vw, 34px);
  line-height: 1.28;
  letter-spacing: -0.03em;
}

.portal-hero p {
  margin: 10px 0 0;
  color: var(--line-muted);
  font-size: 13px;
}

.chat-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-list__heading {
  margin: 0;
  padding: 15px 20px 9px;
  color: #828c95;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.chat-link {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 13px 18px;
  border: 0;
  border-bottom: 1px solid var(--line-rule);
  color: inherit;
  background: #fff;
  text-decoration: none;
  transition: background 140ms ease;
}

.chat-link:hover,
.chat-link:focus-visible {
  background: #f6f8f8;
}

.chat-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 19px;
  color: #fff;
  background: linear-gradient(145deg, #15d466, #04aa47);
  box-shadow: 0 6px 16px rgba(6, 199, 85, 0.2);
  font-size: 15px;
  font-weight: 900;
}

.chat-avatar--ai {
  background: linear-gradient(145deg, #4e8fff, #5c5ee8);
  box-shadow: 0 6px 16px rgba(76, 107, 231, 0.2);
}

.chat-copy {
  min-width: 0;
}

.chat-copy strong,
.chat-copy span {
  display: block;
}

.chat-copy strong {
  overflow: hidden;
  color: var(--line-ink);
  font-size: 15px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-copy span {
  overflow: hidden;
  margin-top: 4px;
  color: #7c8790;
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  color: #9aa2a9;
  font-size: 10px;
}

.chat-badge {
  display: grid;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--line-green);
  font-size: 10px;
  font-weight: 800;
}

.portal-footer {
  padding: 22px 20px;
  color: #8a949c;
  background: #f7f9fa;
  text-align: center;
  font-size: 11px;
}

@media (max-width: 680px) {
  body.reminder-page main {
    width: 100%;
    padding: 0 0 48px;
  }

  body.reminder-page main > header {
    padding: 24px 18px;
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
  }

  .timeline-nav {
    top: 61px;
    margin: 0;
    padding: 10px 12px;
    background: rgba(238, 241, 244, 0.92);
    backdrop-filter: blur(14px);
  }

  body.reminder-page .creative {
    margin: 14px 12px 0;
    padding: 14px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(27, 44, 61, 0.08);
  }

  body.reminder-page .section {
    margin-top: 14px;
  }

  body.reminder-page .card {
    margin-top: 14px;
    border-width: 1px 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.reminder-page .card-head {
    padding: 15px 14px 14px 64px;
  }

  body.reminder-page .card-head::before {
    top: 15px;
    left: 14px;
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  body.reminder-page .message-wrap {
    padding: 21px 12px 24px;
  }

  body.reminder-page .bubble,
  body.reminder-page .visual {
    width: calc(100% - 48px);
    margin-left: 46px;
  }

  body.reminder-page .bubble {
    padding: 13px 14px;
    font-size: 13px;
    line-height: 1.68;
  }

  body.reminder-page .bubble::before,
  body.reminder-page .visual::before {
    left: -46px;
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .message-actions {
    width: calc(100% - 48px);
    margin-left: 46px;
  }

  body.reminder-page .excluded {
    margin: 16px 12px 0;
  }

  .portal-main {
    min-height: calc(100vh - 62px);
  }

  .portal-hero {
    padding: 23px 18px 18px;
  }

  .chat-link {
    grid-template-columns: 50px minmax(0, 1fr) auto;
    min-height: 80px;
    padding: 12px 14px;
  }

  .chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
