html {
  scroll-behavior: smooth;
  min-height: 100%;
  background: #817e8c;
  overflow-x: clip;
}

/* Shared premium space design system */
:root{--space-bg:#030713;--space-bg-2:#070d1d;--space-card:rgba(7,16,32,.88);--space-card-strong:rgba(8,18,37,.96);--space-border:rgba(93,119,171,.38);--space-purple:#a23cff;--space-violet:#6822dd;--space-magenta:#d05cff;--space-text:#f8f9ff;--space-muted:#aeb8cc;--space-success:#31c986;--space-warning:#f2bc54;--space-radius:22px;--space-shadow:0 18px 48px rgba(0,0,0,.32);--space-glow:0 0 24px rgba(153,55,255,.25);--space-ease:220ms ease}
html{min-height:100%;background:var(--space-bg)!important;overflow-x:hidden}
body{min-height:100vh;min-height:100dvh;color:var(--space-text)!important;background:radial-gradient(circle at 78% 9%,rgba(104,34,221,.25),transparent 30%),radial-gradient(circle at 8% 70%,rgba(53,77,156,.17),transparent 34%),radial-gradient(rgba(255,255,255,.22) .7px,transparent 1px),linear-gradient(180deg,var(--space-bg-2),var(--space-bg))!important;background-size:auto,auto,74px 74px,auto!important;overflow-x:hidden}
body :is(h1,h2,h3,h4,h5,h6,label,strong){color:var(--space-text)}
body :is(p,small,.subtitle,.description,.helper-text){color:var(--space-muted)}
body :is(input,textarea,select){color:var(--space-text)!important;background:rgba(5,12,26,.82)!important;border-color:var(--space-border)!important;caret-color:var(--space-magenta)}
body :is(input,textarea,select)::placeholder{color:#8490a8!important;opacity:1}
body :is(input,textarea,select):focus{outline:2px solid rgba(173,74,255,.62)!important;outline-offset:2px;box-shadow:var(--space-glow)!important}
body :is(.card,.glass-card,.header-card,.mission-card,.reward-card,.planet-card,.journal-card,.insight-card,.settings-card,.modal,.popup-content,.dialog){color:var(--space-text)!important;background:linear-gradient(145deg,var(--space-card-strong),var(--space-card))!important;border-color:var(--space-border)!important;box-shadow:var(--space-shadow),inset 0 1px rgba(255,255,255,.04)!important;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
body :is(.save-btn,.primary-btn,.gradient-btn,.upgrade-btn,.submit-btn,.confirm-btn){color:#fff!important;background:linear-gradient(100deg,var(--space-violet),var(--space-purple))!important;border-color:rgba(193,118,255,.45)!important;box-shadow:0 8px 23px rgba(112,31,219,.3)!important}
body button,body [role=button]{min-height:44px;transition:transform var(--space-ease),box-shadow var(--space-ease),background var(--space-ease)}
body button:active,body [role=button]:active{transform:scale(.975)}
body :is(button,a,input,textarea,select):focus-visible{outline:2px solid #c866ff!important;outline-offset:3px}
.toast,[class*=toast]{position:fixed!important;z-index:1000!important;max-width:min(90vw,420px);pointer-events:none}
@media (hover:hover) and (pointer:fine){body :is(.card,.glass-card,.journal-card,.insight-card,button):hover{transform:translateY(-2px)}}
@media (max-width:480px){body{padding-bottom:max(8px,env(safe-area-inset-bottom))}body :is(.card,.glass-card,.journal-card,.insight-card){border-radius:18px!important}}

/* Natural floating star field shared by every application page. */
html::before,
html::after {
  content: "";
  position: fixed;
  z-index: 900;
  inset: -14vh -10vw;
  width: 120vw;
  height: 128vh;
  pointer-events: none;
  mix-blend-mode: screen;
  transform: translateZ(0);
  will-change: transform, opacity;
}

html::before {
  background-image:
    radial-gradient(circle at 17% 29%, rgba(255,255,255,.96) 0 .8px, transparent 1.6px),
    radial-gradient(circle at 71% 13%, rgba(196,163,255,.76) 0 1.15px, transparent 2px),
    radial-gradient(circle at 43% 82%, rgba(139,196,255,.62) 0 .65px, transparent 1.45px),
    radial-gradient(circle at 89% 61%, rgba(255,255,255,.74) 0 .5px, transparent 1.25px),
    radial-gradient(circle at 8% 74%, rgba(218,174,255,.68) 0 .9px, transparent 1.7px),
    radial-gradient(circle at 56% 46%, rgba(166,215,255,.55) 0 .45px, transparent 1.1px);
  background-position: 11px 19px, 73px 41px, 29px 97px, 133px 17px, 51px 121px, 109px 77px;
  background-size: 113px 127px, 173px 191px, 229px 211px, 307px 283px, 397px 359px, 487px 443px;
  opacity: .58;
  animation:
    appStarsDrift 52s linear infinite,
    appStarsTwinkle 7s ease-in-out infinite;
}

html::after {
  background-image:
    radial-gradient(circle at 23% 67%, rgba(255,255,255,.8) 0 .65px, transparent 1.35px),
    radial-gradient(circle at 78% 31%, rgba(206,126,255,.64) 0 .95px, transparent 1.8px),
    radial-gradient(circle at 52% 91%, rgba(125,183,255,.48) 0 .5px, transparent 1.2px),
    radial-gradient(circle at 94% 8%, rgba(255,255,255,.65) 0 .4px, transparent 1px);
  background-position: 37px 59px, 149px 23px, 83px 137px, 191px 101px;
  background-size: 197px 181px, 269px 251px, 353px 331px, 461px 419px;
  opacity: .38;
  filter: drop-shadow(0 0 3px rgba(169,101,255,.42));
  animation:
    appStarsDriftFar 78s linear infinite,
    appStarsTwinkleFar 11s ease-in-out infinite reverse;
}

@keyframes appStarsDrift {
  0% { transform: translate3d(0,0,0) rotate(.001deg); }
  50% { transform: translate3d(18px,-34px,0) rotate(.15deg); }
  100% { transform: translate3d(36px,-68px,0) rotate(.3deg); }
}

@keyframes appStarsDriftFar {
  0% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(-24px,-22px,0); }
  100% { transform: translate3d(-48px,-44px,0); }
}

@keyframes appStarsTwinkle {
  0%,100% { opacity: .34; }
  45% { opacity: .5; }
  72% { opacity: .39; }
}

@keyframes appStarsTwinkleFar {
  0%,100% { opacity: .19; }
  50% { opacity: .34; }
}

@media (prefers-reduced-motion: reduce) {
  html::before,
  html::after {
    animation: none !important;
  }
}

.main-space-stars {
  position: absolute !important;
  z-index: 5 !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  pointer-events: none !important;
  contain: strict;
}

.main-space-stars i {
  position: absolute;
  left: var(--star-x);
  top: var(--star-y);
  width: var(--star-size);
  height: var(--star-size);
  border-radius: 50%;
  background: rgba(255,255,255,var(--star-alpha));
  box-shadow: 0 0 5px rgba(255,255,255,.72);
  animation: mainStarFloat var(--star-speed) var(--star-delay) ease-in-out infinite alternate;
}

.main-space-stars i.lavender {
  background: rgba(212,163,255,var(--star-alpha));
  box-shadow: 0 0 7px rgba(180,96,255,.85);
}

.main-space-stars i.blue {
  background: rgba(151,205,255,var(--star-alpha));
  box-shadow: 0 0 6px rgba(105,171,255,.75);
}

@keyframes mainStarFloat {
  0% { transform: translate3d(-2px,5px,0) scale(.78); opacity: .38; }
  47% { opacity: 1; }
  100% { transform: translate3d(7px,-16px,0) scale(1.18); opacity: .56; }
}

@media (prefers-reduced-motion: reduce) {
  .main-space-stars i { animation: none !important; }
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

button,
a,
input,
textarea {
  touch-action: manipulation;
}

.journal-option,
.save-main-button,
.emoji-button,
.modal-action,
.close-modal-button,
.journal-modal {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

/* Remove the duplicate Saved Quotes entry from the right-side Mindset Menu. */
.anime-menu-list .anime-menu-item[data-menu-action="saved"] {
  display: none !important;
}

/* =============================================
   JOURNAL HISTORY CALENDAR NOTE ENHANCEMENT
============================================= */

body.journal-history-page #dayDetails.calendar-note-clickable {
  position: relative;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

body.journal-history-page #dayDetails.calendar-note-clickable:hover {
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 9px 22px rgba(98, 65, 74, 0.1);
}

body.journal-history-page #dayDetails.calendar-note-clickable:active {
  transform: scale(0.992);
}

body.journal-history-page .calendar-note-open {
  display: flex;
  align-items: center;
  gap: 11px;

  width: 100%;
  min-height: 58px;
  margin-top: 14px;
  padding: 12px 14px;

  border: 1px solid rgba(118, 78, 87, 0.16);
  border-radius: 18px;

  color: #403238;
  background:
    linear-gradient(
      135deg,
      rgba(244, 207, 202, 0.88),
      rgba(210, 168, 170, 0.72)
    );

  text-align: left;

  box-shadow:
    0 7px 17px rgba(93, 60, 69, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);

  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

body.journal-history-page .calendar-note-open:active {
  transform: translateY(2px) scale(0.99);
}

body.journal-history-page .calendar-note-open-icon {
  display: grid;
  place-items: center;

  width: 34px;
  min-width: 34px;
  height: 34px;

  border-radius: 12px;

  color: white;
  background:
    linear-gradient(
      145deg,
      #c98b85,
      #8f6867
    );

  font-size: 22px;
  font-weight: 400;

  box-shadow: 0 5px 11px rgba(92, 58, 66, 0.2);
}

body.journal-history-page .calendar-note-open strong,
body.journal-history-page .calendar-note-open small {
  display: block;
}

body.journal-history-page .calendar-note-open strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.2;
}

body.journal-history-page .calendar-note-open small {
  margin-top: 3px;

  font-size: 10px;
  line-height: 1.35;

  color: rgba(58, 43, 49, 0.61);
}

body.journal-history-page .calendar-note-editor {
  margin-top: 15px;
  padding: 15px;

  border: 1px solid rgba(116, 78, 87, 0.15);
  border-radius: 21px;

  cursor: default;

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.88),
      rgba(241, 218, 220, 0.78)
    );

  box-shadow:
    0 8px 22px rgba(94, 61, 70, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body.journal-history-page .calendar-note-editor-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}

body.journal-history-page .calendar-note-editor-icon {
  display: grid;
  place-items: center;

  width: 42px;
  min-width: 42px;
  height: 42px;

  border-radius: 15px;

  font-size: 22px;

  background:
    linear-gradient(
      145deg,
      #efb7ad,
      #b78684
    );

  box-shadow:
    0 6px 13px rgba(104, 67, 75, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

body.journal-history-page .calendar-note-editor-heading h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

body.journal-history-page .calendar-note-editor-heading p {
  margin-top: 3px;

  font-size: 10px;
  line-height: 1.35;

  color: rgba(57, 43, 49, 0.58);
}

body.journal-history-page .calendar-note-label {
  display: block;

  margin: 14px 0 8px;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

body.journal-history-page .calendar-note-textarea {
  display: block;

  width: 100%;
  min-height: 145px;
  resize: vertical;

  padding: 13px 14px;

  border: 1px solid rgba(110, 74, 82, 0.18);
  border-radius: 16px;
  outline: none;

  color: #2d2529;
  background: rgba(255, 255, 255, 0.87);

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.55;

  box-shadow:
    inset 0 2px 8px rgba(94, 63, 71, 0.05),
    0 1px 0 rgba(255, 255, 255, 0.82);

  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

body.journal-history-page .calendar-note-textarea:focus {
  border-color: rgba(174, 107, 106, 0.55);

  background: rgba(255, 255, 255, 0.98);

  box-shadow:
    0 0 0 4px rgba(202, 133, 132, 0.11),
    inset 0 2px 7px rgba(94, 63, 71, 0.04);
}

body.journal-history-page .calendar-note-textarea::placeholder {
  color: rgba(65, 49, 56, 0.4);
}

body.journal-history-page .calendar-note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  min-height: 22px;
  margin-top: 6px;
}

body.journal-history-page .calendar-note-status {
  color: #8e6463;

  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

body.journal-history-page .calendar-note-count {
  margin-left: auto;

  color: rgba(55, 42, 48, 0.46);

  font-size: 10px;
}

body.journal-history-page .calendar-note-actions {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 9px;

  margin-top: 10px;
}

body.journal-history-page .calendar-note-clear,
body.journal-history-page .calendar-note-save {
  min-height: 48px;
  padding: 10px 12px;

  border-radius: 999px;

  font-size: 13px;
  font-weight: 800;

  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease;
}

body.journal-history-page .calendar-note-clear:active,
body.journal-history-page .calendar-note-save:active {
  transform: translateY(2px) scale(0.986);
}

body.journal-history-page .calendar-note-clear {
  border: 1px solid rgba(67, 50, 56, 0.19);

  color: #46383d;
  background: rgba(255, 255, 255, 0.72);

  box-shadow:
    0 4px 10px rgba(63, 45, 52, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body.journal-history-page .calendar-note-save {
  color: white;
  background:
    linear-gradient(
      110deg,
      #c78a84,
      #916968
    );

  box-shadow:
    0 6px 14px rgba(99, 64, 70, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.29);
}

body.journal-history-page .calendar-note-save:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 370px) {
  body.journal-history-page .calendar-note-editor {
    padding: 13px;
  }

  body.journal-history-page .calendar-note-actions {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* Reusable app-wide animated space background */
html,
body {
  min-width: 100%;
  min-height: 100%;
  background: #02050f !important;
  overscroll-behavior-x: none;
}

body {
  position: relative;
  isolation: isolate;
  background: transparent !important;
}

.global-space-background {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  pointer-events: none;
  z-index: -1;
  transform: translateZ(0);
  contain: strict;
}

body > :not(.global-space-background) {
  position: relative;
}

@media (prefers-reduced-motion: reduce) {
  .global-space-background {
    transform: none;
  }
}
