:root {
  --worrybin-blue: #35a3bb;
  --worrybin-blue-deep: #167f9c;
  --worrybin-paper: #ffffff;
  --worrybin-ink: #1c3842;
}

@media (hover: hover) and (pointer: fine) {
  html,
  body,
  body * {
    cursor: url("./assets/worrybin-cursor-round-v5.png") 2 2, default !important;
  }

  html body :is(
    a,
    button,
    [role="button"],
    .ocean-tool,
    .cover-bubble,
    .sea-glass,
    .floating-glass
  ),
  html body :is(
    a,
    button,
    [role="button"],
    .ocean-tool,
    .cover-bubble,
    .sea-glass,
    .floating-glass
  ) * {
    cursor: url("./assets/worrybin-cursor-round-v5.png") 2 2, default !important;
  }

  input,
  textarea {
    cursor: url("./assets/worrybin-text-cursor-v2.png") 5 13, text !important;
  }
}

.worrybin-click-sparkles {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10001;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.worrybin-click-sparkles span {
  position: absolute;
  top: -2px;
  left: -2px;
  width: var(--spark-size, 4px);
  height: var(--spark-size, 4px);
  border-radius: 50%;
  background: var(--spark-color, #25a5c1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.58);
  opacity: 0;
  transform: translate(0, 0) scale(0.35);
  animation: worrybinSparkScatter 520ms cubic-bezier(0.18, 0.72, 0.22, 1) var(--spark-delay, 0ms) forwards;
}

.worrybin-click-sparkles span.is-star {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.worrybin-click-sparkles span.is-star::before,
.worrybin-click-sparkles span.is-star::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  content: "";
  background: var(--spark-color, #25a5c1);
  transform: translate(-50%, -50%) rotate(var(--spark-turn, 0deg));
}

.worrybin-click-sparkles span.is-star::after {
  transform: translate(-50%, -50%) rotate(calc(var(--spark-turn, 0deg) + 90deg));
}

body.auth-pending {
  background: #ffffff;
}

body.auth-pending > :not(.login-gate) {
  visibility: hidden;
}

.login-gate[hidden] {
  display: none;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  min-width: 320px;
  min-height: 100dvh;
  place-items: center;
  overflow: auto;
  padding: max(2rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  color: var(--worrybin-ink);
  background-color: var(--worrybin-paper);
  opacity: 1;
  transition: opacity 380ms ease, transform 500ms cubic-bezier(0.32, 0.72, 0.24, 1);
}

.login-gate::before {
  content: none;
}

.login-gate.is-leaving {
  pointer-events: none;
  opacity: 0;
  transform: translateY(-10px);
}

.login-gate__layout {
  position: relative;
  display: grid;
  width: min(50rem, 100%);
  grid-template-columns: minmax(10rem, 14rem) minmax(19rem, 27rem);
  align-items: center;
  justify-content: center;
  gap: clamp(3rem, 8vw, 6rem);
}

.login-gate__mascot {
  position: relative;
  align-self: end;
  transform: rotate(-2.4deg) translateY(1.15rem);
  transform-origin: 50% 90%;
}

.login-gate__mascot img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 7px rgba(34, 91, 104, 0.09));
  user-select: none;
}

.login-gate__mascot span {
  position: absolute;
  right: -0.7rem;
  bottom: -1.45rem;
  color: var(--worrybin-blue-deep);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 0.82rem;
  transform: rotate(4deg);
}

.login-gate.is-approved .login-gate__mascot {
  animation: worrybinLoginNod 480ms cubic-bezier(0.18, 0.78, 0.24, 1) both;
}

.login-gate__content {
  min-width: 0;
}

.login-gate__title {
  margin: 0;
  color: #152f38;
  font-family: var(--font-dict, "PingFang SC", sans-serif);
  font-size: clamp(2.2rem, 4.4vw, 3.35rem);
  font-weight: 450;
  line-height: 1.05;
  letter-spacing: 0;
}

.login-gate__title span {
  display: inline-block;
  margin-left: 0.45rem;
  color: var(--worrybin-blue-deep);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 0.38em;
  font-weight: 600;
  transform: rotate(-3deg) translateY(-0.25em);
}

.login-gate__tagline {
  max-width: 24rem;
  margin: 1rem 0 0;
  color: #315966;
  font-size: 1.02rem;
  line-height: 1.65;
}

.login-gate__intro {
  max-width: 24rem;
  margin: 0.35rem 0 0;
  color: #62767c;
  font-size: 0.86rem;
  line-height: 1.65;
}

.login-form {
  display: grid;
  margin-top: 2.1rem;
  gap: 0;
}

.login-form__title {
  margin: 0 0 1rem;
  color: #294f5a;
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 1.08rem;
}

.login-form__label {
  margin: 0 0 0.55rem;
  color: #37545d;
  font-size: 0.82rem;
  font-weight: 600;
}

.brand-field {
  position: relative;
  display: block;
  isolation: isolate;
}

.brand-field::before {
  position: absolute;
  inset: -10px -12px;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: url("./assets/worrybin-crayon-field-frame-v1.png") center / 100% 100% no-repeat;
  opacity: 0.82;
  transition: filter 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.brand-field:focus-within::before {
  filter: saturate(1.2) contrast(1.08);
  opacity: 1;
  transform: scale(1.006);
}

.brand-field.is-invalid::before {
  filter: hue-rotate(125deg) saturate(1.5);
  animation: worrybinFieldNudge 260ms ease both;
}

.login-form__field {
  display: flex;
  align-items: center;
  min-height: 3.6rem;
}

.login-form__country {
  flex: 0 0 auto;
  margin-left: 0.85rem;
  padding-right: 0.75rem;
  color: #52717a;
  border-right: 1px solid rgba(37, 165, 193, 0.35);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.login-form__field input {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 3.6rem;
  padding: 0.8rem 0.9rem;
  color: #183842;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0;
}

.login-form__field input::placeholder {
  color: #94a8ad;
}

.login-form__code-block {
  margin-top: 1.2rem;
}

.login-form__code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem;
  align-items: center;
  gap: 1rem;
}

.login-form__code-field input {
  font-variant-numeric: tabular-nums;
}

.login-form__send {
  min-height: 2.75rem;
  padding: 0.35rem 0.2rem;
  color: var(--worrybin-blue-deep);
  border: 0;
  border-bottom: 2px solid rgba(37, 165, 193, 0.48);
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.login-form__send:hover:not(:disabled) {
  color: #0f7089;
  border-color: var(--worrybin-blue);
  transform: translateY(-1px) rotate(-0.4deg);
}

.login-form__send:disabled {
  cursor: default;
  opacity: 0.55;
}

.login-form__hint,
.login-form__status,
.login-form__error {
  min-height: 1.25rem;
  margin: 0.65rem 0 0;
  font-size: 0.74rem;
  line-height: 1.45;
}

.login-form__hint {
  color: #728a91;
}

.login-form__status {
  margin-top: 0.1rem;
  color: var(--worrybin-blue-deep);
}

.login-form__error {
  margin-top: 0.1rem;
  color: #b65052;
  pointer-events: none;
}

.login-form__status:empty,
.login-form__error:empty {
  display: none;
}

.login-form__submit {
  position: relative;
  isolation: isolate;
  justify-self: start;
  min-width: 10.5rem;
  min-height: 3.25rem;
  margin-top: 1.15rem;
  padding: 0.65rem 1.5rem;
  color: #146f88;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: rgba(212, 244, 248, 0.5);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
  transition: color 150ms ease, transform 150ms ease, background-color 150ms ease;
}

.login-form__submit::before {
  position: absolute;
  inset: -8px -11px;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: url("./assets/worrybin-crayon-field-frame-v1.png") center / 100% 100% no-repeat;
  opacity: 0.9;
}

.login-form__submit:hover:not(:disabled) {
  color: #0e6379;
  background: rgba(199, 239, 245, 0.72);
  transform: translateY(-1px) rotate(-0.35deg);
}

/* Nickname + password prototype login. */
.login-form__rows-art {
  display: none;
}

.login-form__row {
  min-height: 4.7rem;
}

.login-form__label {
  color: rgba(30, 145, 172, 0.96);
  font-family: "default_font", var(--font-hand, "HanziPen SC", "Kaiti SC", cursive);
  font-size: clamp(1rem, 1.55vw, 1.32rem);
  font-weight: 400;
  line-height: 1.08;
}

.login-form__field {
  min-height: 3.85rem;
  border: clamp(3px, 0.35vw, 5px) solid rgba(44, 163, 188, 0.94);
  border-radius: 0.35rem 0.55rem 0.3rem 0.6rem;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.login-form__code-row {
  grid-template-columns: minmax(0, 1fr) 3.4rem;
  gap: 0.7rem;
  align-items: center;
}

.login-form__send {
  position: relative;
  min-width: 3.4rem;
  min-height: 3.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.login-form__send span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.25rem;
  height: 1.45rem;
  border: 3px solid rgba(38, 159, 185, 0.92);
  border-radius: 55% 45% 55% 45% / 62% 62% 38% 38%;
  transform: translate(-50%, -50%) rotate(-4deg);
}

.login-form__send span::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.62rem;
  height: 0.62rem;
  border: 2px solid rgba(38, 159, 185, 0.92);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.login-form__send[aria-pressed="true"] span::after {
  position: absolute;
  top: 50%;
  left: -0.2rem;
  width: 2.6rem;
  height: 3px;
  background: rgba(38, 159, 185, 0.92);
  content: "";
  transform: rotate(-28deg);
}

.login-form__submit:active {
  transform: translate(1px, 1px);
}

.login-form__submit:disabled {
  cursor: default;
  opacity: 0.62;
}

.login-form__submit:focus-visible,
.login-form__send:focus-visible,
.brand-back:focus-visible {
  outline: 3px solid rgba(37, 165, 193, 0.3);
  outline-offset: 5px;
}

.worry-entry__label.brand-field::before {
  inset: -4px -7px;
  filter: brightness(1.26) saturate(0.9);
  opacity: 0.88;
}

.worry-entry__label.brand-field textarea {
  padding-right: 0.65rem;
  padding-left: 0.65rem;
  border: 0;
}

.back-link.brand-back {
  position: relative;
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  color: var(--worrybin-blue-deep);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0.92;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.back-link.brand-back::before {
  content: none;
}

.brand-back__glyph,
.brand-back__glyph::before,
.brand-back__glyph::after {
  position: absolute;
  display: block;
  content: "";
  background: var(--worrybin-blue);
  border-radius: 999px;
}

.back-link .brand-back__glyph {
  display: block;
}

.brand-back__glyph {
  top: 50%;
  left: 50%;
  width: 1.65rem;
  height: 3px;
  transform: translate(-42%, -50%) rotate(-1.5deg);
}

.brand-back__glyph::before,
.brand-back__glyph::after {
  left: -0.02rem;
  width: 0.82rem;
  height: 3px;
  transform-origin: left center;
}

.brand-back__glyph::before {
  transform: rotate(42deg);
}

.brand-back__glyph::after {
  transform: rotate(-42deg);
}

.back-link.brand-back:hover {
  color: var(--worrybin-blue-deep);
  background: transparent;
  opacity: 1;
  transform: translateX(-3px) rotate(-1deg);
}

@keyframes worrybinLoginNod {
  0% { transform: rotate(-2deg) translateY(1.4rem); }
  42% { transform: rotate(3deg) translateY(1.62rem) scaleY(0.96); }
  100% { transform: rotate(-1deg) translateY(1.2rem); }
}

@keyframes worrybinFieldNudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-4px) rotate(-0.2deg); }
  70% { transform: translateX(3px) rotate(0.2deg); }
}

@keyframes worrybinSparkScatter {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.35) rotate(0deg);
  }
  22% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(var(--spark-x), var(--spark-y)) scale(0.12) rotate(var(--spark-rotate));
  }
}

@media (max-width: 640px) {
  .login-gate {
    place-items: start center;
    padding-top: max(2.1rem, calc(env(safe-area-inset-top) + 1.5rem));
  }

  .login-gate__layout {
    width: min(22rem, 100%);
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .login-gate__mascot {
    width: 5.4rem;
    align-self: auto;
    justify-self: end;
    margin-right: 0.45rem;
    transform: rotate(2deg) translateY(0.3rem);
  }

  .login-gate__mascot span {
    right: 0;
    bottom: -0.9rem;
    font-size: 0.7rem;
  }

  .login-gate__title {
    font-size: 2.12rem;
  }

  .login-gate__tagline {
    margin-top: 0.7rem;
    font-size: 0.94rem;
  }

  .login-gate__intro {
    margin-top: 0.28rem;
    font-size: 0.82rem;
  }

  .login-form {
    margin-top: 1.45rem;
  }

  .login-form__code-row {
    grid-template-columns: minmax(0, 1fr) 6.9rem;
    gap: 0.75rem;
  }

  .login-form__field,
  .login-form__field input {
    min-height: 3.35rem;
  }

  .login-form__send {
    font-size: 0.8rem;
  }

  .login-form__submit {
    width: 100%;
    min-height: 3.2rem;
    justify-self: stretch;
  }
}

@media (max-width: 640px) {
  .login-form__row {
    min-height: 4.1rem;
    grid-template-columns: 5.6rem minmax(0, 1fr);
  }

  .login-form__label {
    font-size: 0.86rem;
  }

  .login-form__code-row {
    grid-template-columns: minmax(0, 1fr) 2.8rem;
    gap: 0.35rem;
  }

  .login-form__send {
    min-width: 2.8rem;
    min-height: 2.8rem;
    padding: 0;
  }

  .login-form__send span {
    width: 1.8rem;
    height: 1.15rem;
  }

  .login-form__status,
  .login-form__error {
    margin-left: 6.2rem;
  }

  .login-form__submit {
    width: calc(100% - 6.2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-gate,
  .login-gate__mascot,
  .brand-field::before,
  .login-form__send,
  .login-form__submit,
  .back-link.brand-back,
  .worrybin-click-sparkles span {
    animation: none !important;
    transition-duration: 0.001ms !important;
  }
}

/* PSD source-layer composition: login, worry note, and profile return. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.login-gate {
  padding: max(1.5rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: #fff url("./assets/source-layers/page-paper.png?v=20260828-psd-layers-v1") center / cover no-repeat;
}

.login-gate__layout {
  width: min(68rem, 94vw);
  grid-template-columns: minmax(10rem, 14rem) minmax(29rem, 35rem);
  gap: clamp(2.75rem, 6vw, 6.5rem);
}

.login-gate__mascot {
  width: 100%;
  align-self: center;
  transform: rotate(-1.4deg);
}

.login-gate__mascot img {
  filter: none;
}

.login-gate__content {
  position: relative;
  width: 100%;
}

.login-gate__title-art {
  display: block;
  width: clamp(11.5rem, 23vw, 21.3rem);
  max-width: 70%;
  height: auto;
  margin: 0 0 clamp(1.4rem, 3vh, 2.6rem) clamp(7rem, 21%, 8.75rem);
  user-select: none;
}

.login-form {
  margin: 0;
}

.login-form__rows {
  position: relative;
  display: grid;
  gap: 0.35rem;
}

.login-form__rows-art {
  position: absolute;
  top: -0.15rem;
  right: 0;
  width: calc(100% - 8.2rem);
  height: calc(100% + 0.3rem);
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.login-form__row {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 4.25rem;
  grid-template-columns: 7.3rem minmax(0, 1fr);
  align-items: center;
  column-gap: 0.9rem;
}

.login-form__label {
  margin: 0;
  color: var(--worrybin-blue-deep);
  font-family: var(--font-dict, "PingFang SC", sans-serif);
  font-size: clamp(1.65rem, 2.4vw, 2.1rem);
  font-weight: 500;
  text-align: right;
}

.login-form__field,
.login-form__field input {
  min-height: 3.8rem;
}

.login-form__field {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  align-items: center;
  cursor: text;
}

.login-form__field.is-invalid {
  animation: worrybinFieldNudge 260ms ease both;
}

.login-form__field input {
  position: relative;
  z-index: 2;
  padding: 0.7rem 0.85rem;
  color: rgba(47, 132, 151, 0.92);
  caret-color: var(--worrybin-blue);
  cursor: url("./assets/worrybin-text-cursor-v2.png") 5 13, text !important;
  font-family: var(--font-hand, "HanziPen SC", "Hannotate SC", "Kaiti SC", cursive);
  font-size: 1.25rem;
  pointer-events: auto;
}

.login-form__field input::placeholder {
  color: rgba(46, 128, 151, 0.42);
}

.login-form__field input:-webkit-autofill,
.login-form__field input:-webkit-autofill:hover,
.login-form__field input:-webkit-autofill:focus,
.login-form__field input:-webkit-autofill:active {
  -webkit-text-fill-color: rgba(47, 132, 151, 0.92) !important;
  background-color: transparent !important;
  -webkit-background-clip: text;
  background-clip: text;
  caret-color: var(--worrybin-blue);
  cursor: url("./assets/worrybin-text-cursor-v2.png") 5 13, text !important;
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset !important;
  transition: background-color 99999s ease-out 0s;
}

.login-form__field input:autofill {
  color: rgba(47, 132, 151, 0.92) !important;
  background-color: transparent !important;
  background-clip: text;
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset !important;
}

.login-form__country {
  margin-left: 0.75rem;
  color: rgba(43, 118, 139, 0.65);
  border-right-color: rgba(37, 165, 193, 0.28);
}

.login-form__code-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(8.5rem, 38%);
  gap: 0;
}

.login-form__send {
  min-height: 3.8rem;
  padding: 0.5rem 0.65rem;
  color: #fff;
  border: 0;
  font-family: var(--font-dict, "PingFang SC", sans-serif);
  font-size: clamp(1.12rem, 1.45vw, 1.35rem);
  font-weight: 500;
  white-space: nowrap;
  text-shadow: 0 1px rgba(17, 104, 128, 0.16);
}

.login-form__send:hover:not(:disabled) {
  color: #fff;
  border: 0;
  transform: translateY(-1px) rotate(-0.5deg);
}

.login-form__status,
.login-form__error {
  margin-left: 8.2rem;
  font-family: "Kaiti SC", "STKaiti", serif;
}

.login-form__submit {
  display: block;
  width: calc(100% - 8.2rem);
  max-width: none;
  min-height: 0;
  margin: 0.55rem 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.login-form__submit::before {
  content: none;
}

.login-form__submit img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.login-form__submit.is-busy img {
  animation: worrybinLoginButtonListening 900ms ease-in-out infinite alternate;
}

.login-form__submit:hover:not(:disabled) {
  background: transparent;
  transform: translateY(-2px) rotate(-0.35deg);
  filter: saturate(1.08);
}

.worry-entry {
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: rgba(31, 90, 105, 0.14);
  backdrop-filter: blur(2px);
}

.worry-entry__panel {
  --worry-paper-scale: 0.66;
  --worry-paper-entry-scale: 0.634;
  width: min(64rem, calc(100vw - 2rem));
  min-height: 0;
  padding: clamp(2.7rem, 5.4vw, 4.8rem) clamp(2.6rem, 6vw, 5.5rem) clamp(2rem, 4vw, 3.6rem);
  border: 0;
  border-radius: 0;
  background: #fff url("./assets/source-layers/worry-paper-fast.webp?v=20261015-auth-entry-route-v1") center / 100% 100% no-repeat;
  box-shadow: none;
  backdrop-filter: none;
  transform: translateY(8vh) rotate(-0.8deg) scale(var(--worry-paper-entry-scale));
  transition: transform 460ms cubic-bezier(0.18, 0.82, 0.22, 1), opacity 260ms ease;
}

.worry-entry.is-open .worry-entry__panel {
  transform: translateY(0) rotate(0deg) scale(var(--worry-paper-scale));
}

.worry-entry__prompt {
  display: block;
  width: min(31rem, 50%);
  height: auto;
  margin: 0 0 clamp(1rem, 2.5vw, 1.8rem) 0.2rem;
  opacity: 0.88;
  user-select: none;
}

.worry-entry__close {
  top: clamp(1.4rem, 4vw, 3rem);
  right: clamp(1.5rem, 4.5vw, 3.8rem);
  width: 2.75rem;
  height: 2.75rem;
  color: transparent;
  transition: transform 160ms ease, filter 160ms ease;
}

.worry-entry__close img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.worry-entry__close:hover {
  transform: rotate(7deg) scale(1.04);
  filter: saturate(1.12);
}

.worry-entry__label {
  display: block;
  padding: clamp(1rem, 2vw, 1.45rem) clamp(1.2rem, 2.6vw, 2.2rem);
  background: url("./assets/source-layers/worry-field.png?v=20260828-psd-layers-v1") center / 100% 100% no-repeat;
}

.worry-entry textarea {
  min-height: clamp(8.5rem, 18vh, 11.5rem);
  padding: 0;
  color: rgba(47, 132, 151, 0.92);
  border: 0;
  background: transparent;
  font-family: var(--font-hand, "HanziPen SC", "Hannotate SC", "Kaiti SC", cursive);
  font-size: clamp(1.35rem, 2.25vw, 1.75rem);
  line-height: 1.75;
  caret-color: var(--worrybin-blue-deep);
  box-shadow: none;
  appearance: none;
}

.worry-entry textarea::placeholder {
  color: rgba(47, 139, 160, 0.58);
}

.worry-entry textarea:focus {
  border: 0;
}

.worry-full[hidden] { display: none; }

.worry-full {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 280ms ease;
}

.worry-full.is-open { opacity: 1; }

.worry-full__shade {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(96, 160, 182, 0.28);
  backdrop-filter: blur(6px);
}

.worry-full__paper {
  position: relative;
  width: min(42rem, 92vw);
  min-height: min(22rem, 56vh);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0;
  padding: clamp(4rem, 10vw, 6.5rem) clamp(2rem, 7vw, 5rem);
  color: #259db8;
  text-align: center;
  background: url("./assets/profile-note-paper-user-fast.webp?v=20260926-mobile-fast-v1") center / 100% 100% no-repeat;
  filter: drop-shadow(0 1rem 1.8rem rgba(38, 94, 116, 0.2));
  transform: translateY(1.2rem) rotate(-0.35deg) scale(0.96);
  transition: transform 360ms cubic-bezier(0.18, 0.8, 0.25, 1);
}

.worry-full.is-open .worry-full__paper { transform: translateY(0) rotate(-0.35deg) scale(1); }

.worry-full__message,
.worry-full__aside {
  margin: 0;
  font-family: "default_font", var(--font-hand, "HanziPen SC", "Kaiti SC", cursive);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.worry-full__message { font-size: clamp(1.75rem, 4.5vw, 3.3rem); }
.worry-full__aside { font-size: clamp(1.05rem, 2.4vw, 1.65rem); opacity: 0.78; }

.worry-full__close {
  position: absolute;
  /* The paper already contains the small hand-drawn close icon. */
  top: 15.8%;
  left: 89.1%;
  width: clamp(2.75rem, 4.5vw, 3.35rem);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.worry-full__close:focus,
.worry-full__close:focus-visible {
  outline: none;
  box-shadow: none;
}

.worry-entry__footer {
  display: grid;
  min-height: 0;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: clamp(0.8rem, 2vw, 1.25rem);
}

.worry-entry__count {
  color: rgba(47, 132, 151, 0.92);
  font-family: var(--font-hand, "HanziPen SC", "Hannotate SC", "Kaiti SC", cursive);
}

.worry-entry__send {
  grid-column: 2;
  width: clamp(10.5rem, 22vw, 14.5rem);
  min-height: clamp(2.8rem, 5vw, 3.6rem);
  padding: 0.55rem 2rem;
  border: 0;
  border-radius: 0;
  background: url("./assets/source-layers/worry-submit-bg.png?v=20260828-psd-layers-v1") center / 100% 100% no-repeat;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.worry-entry__send img {
  display: block;
  width: 72%;
  max-height: 1.8rem;
  margin: auto;
  object-fit: contain;
}

.worry-entry__send:hover:not(:disabled) {
  transform: translateY(-2px) rotate(-0.45deg);
  filter: saturate(1.08);
}

.worry-entry__send:active:not(:disabled) {
  transform: translate(1px, 1px) scale(0.99);
}

.back-link.brand-back {
  width: clamp(2.75rem, 5.4vw, 3.5rem);
  height: clamp(2.75rem, 5.4vw, 3.5rem);
  flex-basis: clamp(2.75rem, 5.4vw, 3.5rem);
  background: url("./assets/source-layers/paper-back.png?v=20260828-psd-layers-v1") center / contain no-repeat;
  opacity: 1;
  transition: transform 180ms ease, filter 180ms ease;
}

.back-link.brand-back:hover {
  background: url("./assets/source-layers/paper-back.png?v=20260828-psd-layers-v1") center / contain no-repeat;
  transform: translateX(-3px) rotate(-4deg);
  filter: saturate(1.08) drop-shadow(0 4px 7px rgba(24, 82, 97, 0.08));
}

.back-link.brand-back .brand-back__glyph {
  display: none;
}

@media (max-width: 640px) {
  .login-gate {
    width: 100%;
    min-height: 100dvh;
    place-items: start center;
    padding:
      max(0.75rem, env(safe-area-inset-top))
      max(1rem, env(safe-area-inset-right))
      max(1rem, env(safe-area-inset-bottom))
      max(1rem, env(safe-area-inset-left));
    overflow-x: hidden;
    background-position: center;
    background-size: cover;
  }

  .login-gate__layout {
    position: relative;
    display: block;
    width: min(100%, 23rem);
    margin-top: clamp(8rem, 23dvh, 11.5rem);
    padding-top: 9.15rem;
  }

  .login-gate__mascot {
    position: absolute;
    top: 0;
    left: 0.35rem;
    width: clamp(6.8rem, 31vw, 7.7rem);
    margin: 0;
    transform: rotate(-2deg);
  }

  .login-gate__title-art {
    position: absolute;
    top: 3.9rem;
    right: 0.4rem;
    width: clamp(8.7rem, 39vw, 9.8rem);
    max-width: 48%;
    margin: 0;
  }

  .login-gate__content {
    position: static;
    width: 100%;
  }

  .login-form {
    margin: 0;
  }

  .login-form__rows-art {
    width: calc(100% - 4.95rem);
  }

  .login-form__row {
    min-height: 3.8rem;
    grid-template-columns: 4.35rem minmax(0, 1fr);
    column-gap: 0.6rem;
  }

  .login-form__label {
    font-size: 1.08rem;
    line-height: 1;
  }

  .login-form__field,
  .login-form__field input,
  .login-form__send {
    min-height: 3.4rem;
  }

  .login-form__field input {
    padding: 0.55rem 0.65rem;
    font-size: 1rem;
  }

  .login-form__country {
    display: none;
  }

  .login-form__code-row {
    grid-template-columns: minmax(0, 1fr) minmax(6.6rem, 37%);
  }

  .login-form__send {
    padding-right: 0.35rem;
    padding-left: 0.35rem;
    font-size: 0.96rem;
  }

  .login-form__status,
  .login-form__error {
    margin-left: 4.9rem;
  }

  .login-form__submit {
    width: calc(100% - 4.95rem);
    max-width: none;
    margin-top: 0.5rem;
  }

  .worry-entry {
    place-items: center;
    padding:
      max(1.25rem, env(safe-area-inset-top))
      max(1rem, env(safe-area-inset-right))
      max(4.5rem, env(safe-area-inset-bottom))
      max(1rem, env(safe-area-inset-left));
  }

  .worry-entry__panel {
    --worry-paper-scale: 0.9;
    --worry-paper-entry-scale: 0.864;
    width: min(calc(100vw - 1.5rem), 27rem);
    max-height: none;
    padding: 2.65rem 1.15rem 1.2rem;
    background-size: 100% 100%;
    box-shadow: none;
  }

  .worry-entry__prompt {
    width: min(68%, 18rem);
    margin: 0 0 0.75rem 0.1rem;
  }

  .worry-entry__close {
    top: 0.85rem;
    right: 0.95rem;
    width: 2.75rem;
    height: 2.75rem;
  }

  .worry-entry__label {
    padding: 0.8rem 0.9rem;
  }

  .worry-entry textarea {
    min-height: clamp(6.4rem, 17dvh, 7.6rem);
    max-height: 8rem;
    font-size: 1.05rem;
    line-height: 1.65;
  }

  .worry-entry__footer {
    padding-top: 0.65rem;
  }

  .worry-entry__send {
    width: 9.4rem;
    min-height: 2.75rem;
    padding: 0.45rem 1.3rem;
  }
}

@media (max-width: 640px) and (max-height: 700px) {
  .login-gate__layout {
    margin-top: 0.75rem;
    padding-top: 8rem;
  }

  .login-gate__mascot {
    width: 6.35rem;
  }

  .login-gate__title-art {
    top: 3.35rem;
    width: 8.4rem;
  }

  .worry-entry__panel {
    padding-top: 2.35rem;
  }

  .worry-entry textarea {
    min-height: 5.4rem;
  }
}

@keyframes worrybinLoginButtonListening {
  from { opacity: 0.64; transform: translateY(0); }
  to { opacity: 0.94; transform: translateY(-1px); }
}

/* Final nickname/password layout overrides. */
.login-form__rows-art { display: none; }
.login-form__row {
  min-height: 4.7rem;
  grid-template-columns: 11.5rem minmax(0, 1fr);
}
.login-form__label {
  color: rgba(30, 145, 172, 0.96);
  font-family: "default_font", var(--font-hand, "HanziPen SC", "Kaiti SC", cursive);
  font-size: clamp(1rem, 1.55vw, 1.32rem);
  font-weight: 600;
  line-height: 1.08;
  text-shadow: 0 0.5px 0 rgba(30, 145, 172, 0.36);
  white-space: nowrap;
}
.login-form__field {
  min-height: 3.85rem;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}
.login-form__field::before {
  position: absolute;
  inset: 0;
  z-index: 3;
  content: "";
  pointer-events: none;
  background: url("./assets/source-layers/login-fields.png?v=20260828-psd-layers-v1") center top / 100% 200% no-repeat;
}
.login-form__code-row {
  grid-template-columns: minmax(0, 1fr) 3.4rem;
  gap: 0.7rem;
  align-items: center;
}
.login-form__send {
  position: relative;
  min-width: 3.4rem;
  min-height: 3.4rem;
  padding: 0;
  color: transparent;
  border: 0;
  background: transparent;
}
.login-form__send span {
  position: absolute;
  top: 50%; left: 50%;
  width: 2.25rem; height: 0.82rem;
  border: 0;
  border-bottom: 3px solid rgba(38, 159, 185, 0.92);
  border-radius: 0 0 55% 45% / 0 0 90% 90%;
  transform: translate(-50%, -50%) rotate(-4deg);
}
.login-form__send span::before {
  position: absolute;
  top: 0.5rem; left: 50%;
  width: 3px; height: 0.38rem;
  border: 0;
  border-radius: 999px;
  background: rgba(38, 159, 185, 0.92);
  box-shadow: -0.68rem -0.08rem 0 rgba(38, 159, 185, 0.92), 0.68rem -0.08rem 0 rgba(38, 159, 185, 0.92);
  content: "";
  transform: translateX(-50%);
}
.login-form__send[aria-pressed="true"] span {
  height: 1.45rem;
  border: 3px solid rgba(38, 159, 185, 0.92);
  border-radius: 55% 45% 55% 45% / 62% 62% 38% 38%;
}
.login-form__send[aria-pressed="true"] span::before {
  top: 50%; left: 50%;
  width: 0.62rem; height: 0.62rem;
  border: 2px solid rgba(38, 159, 185, 0.92);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%);
}
.login-form__send[aria-pressed="true"] span::after {
  display: none;
  content: "";
}

@media (max-width: 640px) {
  .login-form__row {
    min-height: 4.1rem;
    grid-template-columns: 8.4rem minmax(0, 1fr);
  }
  .login-form__label { font-size: 0.72rem; }
  .login-form__code-row {
    grid-template-columns: minmax(0, 1fr) 2.8rem;
    gap: 0.35rem;
  }
  .login-form__send {
    min-width: 2.8rem;
    min-height: 2.8rem;
    padding: 0;
  }
  .login-form__send span { width: 1.8rem; height: 1.15rem; }
  .login-form__status, .login-form__error { margin-left: 9rem; }
  .login-form__submit { width: calc(100% - 9rem); }
}

.login-form__submit {
  position: relative;
}

.login-form__launch-word {
  position: absolute;
  top: 50%;
  left: 5.5%;
  z-index: 2;
  display: grid;
  width: 20%;
  height: 68%;
  place-items: center;
  color: #fff;
  background: rgb(54, 164, 187);
  font-family: "Sea Glass Hand", "HanziPen SC", "Hannotate SC", "Kaiti SC", cursive;
  font-size: clamp(1.55rem, 2.35vw, 2.05rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-shadow:
    0.6px 0 rgba(255, 255, 255, 0.72),
    -0.45px 0.35px rgba(255, 255, 255, 0.54),
    0 0 1.2px rgba(255, 255, 255, 0.72);
  filter: blur(0.28px);
  transform: translateY(-50%) rotate(-1.5deg) scale(0.9, 1.04);
  pointer-events: none;
}

/* Invitation and sign-in share the original paper, ink and source-layer button. */
body.auth-dialog-open { overflow: hidden; }
.login-gate {
  --login-hand: "WorryBin Auth Xingchen", "WorryBin Xingchen", "Kaiti SC", "STKaiti", "KaiTi", serif;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgb(31 90 105 / 18%);
  backdrop-filter: blur(3px);
  place-items: center;
  color: #298fa5;
  font-family: var(--login-hand);
}
.auth-font-fallback .login-gate {
  --login-hand: "Kaiti SC", "STKaiti", "KaiTi", serif;
}
.login-gate [hidden] { display: none !important; }
.login-gate__layout {
  position: relative;
  display: grid;
  width: min(880px, 100%);
  min-height: 480px;
  grid-template-columns: minmax(100px, 175px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  margin: 0;
  padding: 64px 65px 52px 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  isolation: isolate;
  box-shadow: none;
  filter: drop-shadow(0 18px 24px rgb(12 59 70 / 13%));
}
.login-gate__mascot { position: relative; z-index: 1; display: block; width: 100%; aspect-ratio: 386 / 462; margin: 0; transform: rotate(-2deg); align-self: center; }
.login-gate__mascot img { aspect-ratio: 386 / 462; }
.login-gate__content { position: relative; z-index: 1; width: 100%; min-width: 0; }
.login-gate__content.is-switching { animation: none; }
.login-gate__title-art { display: none; }
.login-gate #loginTitle {
  margin: 0 0 28px;
  color: #2699b0;
  font: 600 clamp(23px, 3.1vw, 31px)/1.5 var(--login-hand);
  text-align: center;
  letter-spacing: 1px;
  text-shadow: .35px .3px rgb(38 153 176 / 28%);
}
.login-close {
  position: absolute;
  z-index: 2;
  right: 26px; top: 23px;
  width: 44px; height: 44px;
  padding: 6px;
  border: 0;
  background: transparent;
  transition: transform 180ms ease;
}
.login-close img { display: block; width: 100%; height: 100%; object-fit: contain; }
.login-close:hover { transform: rotate(7deg); }
.login-gate .login-form { margin: 0; }
.login-gate .login-form__rows { gap: 12px; }
.login-gate .login-form__row { grid-template-columns: 1fr; gap: 7px; min-height: 0; margin: 0; }
.login-gate .login-form__label, .invite-step label {
  margin: 0;
  color: #298fa5;
  font: 600 clamp(17px, 2vw, 20px)/1.5 var(--login-hand);
  text-align: left;
  text-shadow: .3px .2px rgb(38 153 176 / 22%);
  white-space: normal;
}
.invite-step { display: grid; gap: 14px; padding: 10px 0 12px; }
.login-gate .login-form__field { min-height: 58px; }
.login-gate .login-form__field input {
  min-height: 58px;
  padding: 12px 19px;
  border: 0; outline: 0;
  font: 400 21px/1.4 var(--login-hand);
}
.login-gate #inviteCode { font-size: clamp(16px, 2.2vw, 21px); letter-spacing: 1px; text-transform: uppercase; }
.login-gate .login-form__field:focus-within { filter: saturate(1.3); }
.login-gate .login-form__field.is-invalid { filter: hue-rotate(135deg) saturate(.7); }
.login-gate .login-form__code-row { grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; }
.login-gate .login-form__send { min-width: 44px; min-height: 44px; }
.login-gate .login-form__status, .login-gate .login-form__error {
  min-height: 0; height: auto;
  margin: 15px 0 0;
  font: 400 16px/1.7 var(--login-hand);
  white-space: normal;
  text-align: center;
}
.login-gate .login-form__error { color: #a76169; }
.login-gate .login-form__submit {
  display: block;
  justify-self: center;
  width: min(100%, 420px);
  min-height: 44px; height: auto;
  margin: 26px auto 0; padding: 0;
  border: 0; border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: transform 180ms ease, filter 180ms ease;
}
.login-gate .login-form__submit img { display: block; width: 100%; height: auto; }
.login-gate .login-form__submit:hover:not(:disabled) { background: transparent; transform: translateY(-2px) rotate(-.5deg); }
.login-gate .login-form__submit:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.login-gate .login-form__submit.is-busy { opacity: .68; }
.login-gate button:focus-visible { outline: 2px dashed #329bb0; outline-offset: 5px; }
@media (max-width: 640px) {
  .login-gate { padding: 18px 12px; }
  .login-gate__layout { display: grid; grid-template-columns: 1fr; width: min(100%, 430px); min-height: 0; gap: 14px; margin: 0; padding: 34px 24px 30px; }
  .login-gate__mascot { position: static; display: block; width: 68px; margin: 0 auto; transform: rotate(-2deg); }
  .login-close { top: 15px; right: 14px; }
  .login-gate #loginTitle { font-size: 23px; margin-bottom: 23px; letter-spacing: 0; }
  .login-gate .login-form__field, .login-gate .login-form__field input { min-height: 54px; }
  .login-gate .login-form__field input { font-size: 19px; padding: 11px 14px; }
  .login-gate .login-form__status, .login-gate .login-form__error { font-size: 15px; margin-top: 12px; }
  .login-gate .login-form__submit { margin-top: 22px; }
}
@media (max-height: 640px) {
  .login-gate { place-items: start center; }
  .login-gate__layout { padding-top: 38px; padding-bottom: 24px; }
  .login-gate__mascot { display: none; }
  .login-gate__layout { grid-template-columns: 1fr; max-width: 580px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-gate__content.is-switching { animation: none; }
}

/* Use the supplied photograph directly; clip its texture without stretching it.
   The existing alpha silhouette contributes only the paper's torn outline. */
.login-paper-texture {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  overflow: hidden;
  pointer-events: none;
  background: #fff;
  -webkit-mask: url("./assets/source-layers/worry-paper-mask-fast.webp?v=20261009-auth-fast-v1") center / 100% 100% no-repeat;
  mask: url("./assets/source-layers/worry-paper-mask-fast.webp?v=20261009-auth-fast-v1") center / 100% 100% no-repeat;
}
.login-paper-texture img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.12);
  transform-origin: center top;
  user-select: none;
}

@media (min-width: 641px) {
  .login-gate[data-mode="invite"] .login-gate__layout { min-height: 400px; }
}

.login-gate .login-form__mode-switch {
  display: block;
  min-height: 44px;
  margin: 10px auto 0;
  padding: 8px 12px;
  border: 0;
  color: #298fa5;
  background: transparent;
  font: 400 clamp(15px, 1.8vw, 17px)/1.5 var(--login-hand);
  text-align: center;
  text-decoration: underline;
  text-decoration-color: rgb(41 143 165 / 48%);
  text-underline-offset: 5px;
  touch-action: manipulation;
  transition: color 160ms ease, transform 160ms ease, opacity 160ms ease;
}
.login-gate .login-form__mode-switch:hover:not(:disabled) {
  color: #167f9c;
  transform: translateY(-1px);
}
.login-gate .login-form__mode-switch:active:not(:disabled) {
  transform: translateY(1px);
}
.login-gate .login-form__mode-switch:disabled {
  opacity: .52;
}

/* Original hand-drawn log in art, shared by registration and returning login. */
.login-gate #loginTitle .login-gate__title-art {
  display: block;
  position: static;
  width: clamp(150px, 18vw, 230px);
  max-width: 65%;
  height: auto;
  margin: 0 auto;
}

/* The image title is decorative. Keep a matching text title ready so a slow
   or failed image never leaves a broken-image icon in the login paper. */
.login-gate #loginTitle:focus,
.login-gate #loginTitle:focus-visible {
  outline: none;
}
.login-gate #loginTitle .login-gate__title-fallback {
  display: none;
  margin: 0;
  color: #2699b0;
  font: 600 clamp(28px, 4vw, 38px)/1.2 var(--login-hand);
  letter-spacing: 0.14em;
  transform: none;
}
.auth-visual-fallback .login-gate #loginTitle .login-gate__title-art {
  display: none;
}
.auth-visual-fallback .login-gate #loginTitle .login-gate__title-fallback {
  display: block;
}

/* Intercept repeated taps while the paper/font bundle is becoming paintable.
   This also prevents partly loaded form controls from flashing over the sea. */
.login-gate.is-preparing .login-gate__layout {
  visibility: hidden;
  opacity: 0;
}
.login-gate.is-preparing::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "海风正在把纸带来…";
  color: #298fa5;
  font: 500 clamp(18px, 3.5vw, 25px)/1.5 var(--login-hand);
  letter-spacing: 0.05em;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.login-gate .login-form__privacy {
  max-width: 34rem;
  margin: 12px auto 0;
  color: rgb(39 111 128 / 82%);
  font: 400 clamp(12px, 1.5vw, 14px)/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: center;
}
.login-gate .login-form__privacy a {
  margin: 0 .2em;
  color: #167f9c;
  text-underline-offset: 3px;
}
.login-gate .login-form__privacy a:focus-visible {
  outline: 2px solid #167f9c;
  outline-offset: 3px;
}
