@font-face {
  font-family: "LXGW WenKai Lite";
  src: url("lxgwwenkai-common.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

html.daylog-auth-checking {
  background: #edf4ee;
}

html.daylog-auth-checking body {
  overflow: hidden;
}

html.daylog-auth-checking body > *:not(.auth-gate):not(.auth-settings-layer):not(.daylog-boot-loading) {
  visibility: hidden !important;
}

.daylog-boot-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding:
    max(22px, env(safe-area-inset-top))
    20px
    max(22px, env(safe-area-inset-bottom));
  color: #213b30;
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  background:
    radial-gradient(circle at 16% 12%, #ffffffbf 0 9rem, transparent 24rem),
    radial-gradient(circle at 85% 78%, #d4e9da99 0 12rem, transparent 30rem),
    linear-gradient(145deg, #edf5ed 0%, #f8fbf7 49%, #e7f0e9 100%);
}

.daylog-boot-loading-card {
  width: min(390px, 100%);
  padding: 27px;
  background: #fcfefaed;
  border: 1px solid #d6e4d9;
  border-radius: 24px;
  box-shadow:
    0 28px 80px #1c463424,
    0 3px 12px #1c463410,
    inset 0 1px 0 #fff;
  backdrop-filter: blur(18px);
}

.daylog-boot-loading-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.daylog-boot-loading-brand > span:last-child {
  display: grid;
  gap: 5px;
}

.daylog-boot-loading-brand b {
  font: 700 22px/1.1 "LXGW WenKai Lite", "STKaiti", "KaiTi", serif;
  letter-spacing: 2px;
}

.daylog-boot-loading-brand small {
  color: #829287;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .19em;
}

.daylog-boot-loading-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  color: #fff;
  font: 600 20px/1 "LXGW WenKai Lite", "STKaiti", "KaiTi", serif;
  border-radius: 13px;
  background: #24654f;
  box-shadow: inset 0 0 0 1px #ffffff1f, 0 7px 18px #214a3726;
}

.daylog-boot-loading-copy {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
  color: #48685a;
  background: #f0f6f1;
  border: 1px solid #dce8df;
  border-radius: 14px;
}

.daylog-boot-loading-copy > span:last-child {
  display: grid;
  gap: 4px;
}

.daylog-boot-loading-copy b {
  color: #244738;
  font-size: 14px;
  font-weight: 700;
}

.daylog-boot-loading-copy small {
  color: #71847a;
  font-size: 12px;
  line-height: 1.55;
}

.auth-gate,
.auth-settings-layer {
  --auth-ink: #213b30;
  --auth-muted: #65786d;
  --auth-line: #d9e5dc;
  --auth-green: #24654f;
  --auth-mint: #e8f2ea;
  --auth-error: #a14f43;
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(22px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  color: var(--auth-ink);
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  background:
    radial-gradient(circle at 16% 12%, #ffffffbf 0 9rem, transparent 24rem),
    radial-gradient(circle at 85% 78%, #d4e9da99 0 12rem, transparent 30rem),
    linear-gradient(145deg, #edf5ed 0%, #f8fbf7 49%, #e7f0e9 100%);
}

.auth-gate::before,
.auth-settings-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .42;
  background-image: radial-gradient(#779183a8 .6px, transparent .6px);
  background-size: 8px 8px;
  mask-image: linear-gradient(135deg, #000, transparent 72%);
}

.auth-gate::after,
.auth-settings-layer::after {
  content: "";
  position: fixed;
  width: min(52vw, 620px);
  aspect-ratio: 1;
  right: -23vw;
  bottom: -31vw;
  border: 1px solid #8eb29c36;
  border-radius: 50%;
  box-shadow:
    0 0 0 46px #8eb29c0c,
    0 0 0 92px #8eb29c0a;
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(470px, 100%);
  padding: clamp(27px, 5vw, 42px);
  overflow: hidden;
  background: #fcfefaed;
  border: 1px solid #d6e4d9;
  border-radius: 27px;
  box-shadow:
    0 32px 90px #1c463428,
    0 3px 12px #1c463410,
    inset 0 1px 0 #fff;
  backdrop-filter: blur(18px);
  animation: auth-card-in .42s cubic-bezier(.2, .72, .22, 1) both;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(#2f765a, #a3c5ad 58%, #d8e8dc);
}

.auth-card::after {
  content: "";
  position: absolute;
  width: 154px;
  aspect-ratio: 1;
  right: -87px;
  top: -92px;
  border: 1px solid #b6cbbd66;
  border-radius: 50%;
  box-shadow: 0 0 0 24px #edf4ee70;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 31px;
}

.auth-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  color: #fff;
  font: 600 20px/1 "LXGW WenKai Lite", "STKaiti", "KaiTi", serif;
  letter-spacing: 1px;
  border-radius: 13px;
  background: #24654f;
  box-shadow: inset 0 0 0 1px #ffffff1f, 0 7px 18px #214a3726;
}

.auth-brand-name {
  display: block;
  font: 700 22px/1.1 "LXGW WenKai Lite", "STKaiti", "KaiTi", serif;
  letter-spacing: 2px;
}

.auth-brand-sub {
  display: block;
  margin-top: 5px;
  color: #829287;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .19em;
}

.auth-eyebrow {
  margin: 0 0 9px;
  color: #5b806b;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .12em;
}

.auth-card h1 {
  margin: 0;
  color: #203b30;
  font: 600 clamp(29px, 5vw, 38px)/1.28 "LXGW WenKai Lite", "STKaiti", "KaiTi", serif;
  letter-spacing: .01em;
}

.auth-copy {
  margin: 13px 0 25px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.8;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-field {
  display: grid;
  gap: 7px;
  color: #52685b;
  font-size: 13px;
  font-weight: 620;
}

.auth-input {
  display: flex;
  align-items: center;
  min-height: 50px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  box-shadow: inset 0 1px 2px #193a2809;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.auth-input:focus-within {
  border-color: #76a78b;
  box-shadow:
    0 0 0 4px #8dbda426,
    inset 0 1px 2px #193a2809;
}

.auth-input input {
  min-width: 0;
  width: 100%;
  padding: 13px 14px;
  color: #203b30;
  font-size: 16px;
  line-height: 1.4;
  background: transparent;
  border: 0;
  outline: 0;
}

.auth-reveal {
  flex: none;
  align-self: stretch;
  padding: 0 14px;
  color: #6e8377;
  font-size: 12px;
  font-weight: 650;
}

.auth-reveal:hover {
  color: var(--auth-green);
  background: var(--auth-mint);
}

.auth-error,
.auth-success {
  min-height: 20px;
  margin: -2px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.auth-secondary {
  min-height: 46px;
  padding: 10px 16px;
  color: #315f4b;
  font-size: 14px;
  font-weight: 650;
  background: #edf5ef;
  border: 1px solid #cddfd2;
  border-radius: 12px;
}

.auth-secondary:hover {
  background: #e2f0e5;
}

.auth-secondary:disabled {
  opacity: .58;
}

.auth-network {
  margin-top: 16px;
  padding: 10px 12px;
  color: #587263;
  font-size: 12px;
  line-height: 1.65;
  background: #f0f6f1;
  border: 1px solid #dfeae1;
  border-radius: 10px;
}

.auth-network.is-offline {
  color: #885d35;
  background: #fff8ed;
  border-color: #edddc6;
}

.auth-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
  color: #48685a;
  background: #f0f6f1;
  border: 1px solid #dce8df;
  border-radius: 14px;
}

.auth-loading > span:last-child {
  display: grid;
  gap: 4px;
}

.auth-loading b {
  color: #244738;
  font-size: 14px;
  font-weight: 700;
}

.auth-loading small {
  color: #71847a;
  font-size: 12px;
  line-height: 1.55;
}

.auth-spinner {
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid #c8dbce;
  border-top-color: #24654f;
  border-radius: 50%;
  animation: auth-spin .75s linear infinite;
}

.auth-local-rescue {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e3ebe5;
}

.auth-local-rescue summary {
  color: #6a7d72;
  font-size: 12px;
  cursor: pointer;
}

.auth-local-rescue p {
  margin: 10px 0;
  color: #7f8e86;
  font-size: 12px;
  line-height: 1.65;
}

.auth-local-rescue .auth-secondary {
  width: 100%;
}

.auth-recovery-sheet {
  padding: 16px;
  background: #edf6ef;
  border: 1px solid #ccdfd2;
  border-radius: 14px;
}

.auth-recovery-label {
  margin-bottom: 9px;
  color: #557766;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
}

.auth-recovery-sheet code {
  display: block;
  padding: 13px;
  color: #173e30;
  font: 700 14px/1.7 "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
  user-select: all;
  background: #fff;
  border: 1px solid #d9e7dd;
  border-radius: 10px;
}

.auth-recovery-sheet p {
  margin: 11px 0 0;
  color: #60776b;
  font-size: 12px;
  line-height: 1.65;
}

.auth-recovery-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.auth-enter-after-recovery {
  width: 100%;
  margin-top: 8px;
}

.auth-account-summary {
  display: grid;
  gap: 9px;
  margin-bottom: 22px;
  padding: 13px;
  background: #f2f7f3;
  border: 1px solid #dfeae2;
  border-radius: 12px;
}

.auth-account-summary div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #708077;
  font-size: 12px;
}

.auth-account-summary b {
  max-width: 66%;
  color: #2b4e3e;
  font-weight: 650;
  text-align: right;
  overflow-wrap: anywhere;
}

.auth-settings-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e3ebe5;
}

.auth-error {
  color: var(--auth-error);
}

.auth-success {
  color: var(--auth-green);
}

.auth-submit {
  min-height: 49px;
  padding: 11px 18px;
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .04em;
  background: #24654f;
  border-radius: 12px;
  box-shadow: 0 9px 24px #245a442b;
  transition: background-color .18s ease, transform .18s ease, opacity .18s ease;
}

.auth-submit:hover {
  filter: none;
  background: #1f5945;
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-submit:disabled {
  opacity: .64;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 28px;
}

.auth-link {
  padding: 5px 0;
  color: #537765;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: #aec6b6;
  text-underline-offset: 4px;
}

.auth-link:hover {
  color: var(--auth-green);
}

.auth-note {
  margin: 20px 0 0;
  padding-top: 18px;
  color: #819087;
  font-size: 12px;
  line-height: 1.75;
  border-top: 1px solid #e3ebe5;
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  color: #687c70;
  font-size: 20px;
  border-radius: 50%;
}

.auth-close:hover {
  background: var(--auth-mint);
}

.auth-gate.is-leaving {
  pointer-events: none;
  animation: auth-gate-out .2s ease both;
}

.auth-gate.is-leaving .auth-card {
  animation: auth-card-out .2s ease both;
}

.auth-card.is-shaking {
  animation: auth-shake .32s ease;
}

@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes auth-card-out {
  to { opacity: 0; transform: translateY(-7px) scale(.99); }
}

@keyframes auth-gate-out {
  to { opacity: 0; }
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

@media (max-height: 850px) {
  .auth-gate,
  .auth-settings-layer {
    align-items: start;
  }
}

@media (max-height: 850px) and (min-width: 521px) {
  .auth-gate,
  .auth-settings-layer {
    padding-top: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .auth-card {
    padding: 24px 34px 22px;
    border-radius: 22px;
  }

  .auth-brand {
    margin-bottom: 16px;
  }

  .auth-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .auth-brand-name {
    font-size: 21px;
  }

  .auth-eyebrow {
    margin-bottom: 7px;
  }

  .auth-card h1 {
    font-size: 31px;
  }

  .auth-copy {
    margin: 8px 0 16px;
    font-size: 13px;
    line-height: 1.6;
  }

  .auth-form {
    gap: 11px;
  }

  .auth-field {
    gap: 5px;
  }

  .auth-input,
  .auth-submit {
    min-height: 45px;
  }

  .auth-input input {
    padding: 10px 13px;
  }

  .auth-local-rescue {
    margin-top: 12px;
    padding-top: 10px;
  }

  .auth-note {
    margin-top: 12px;
    padding-top: 10px;
    line-height: 1.5;
  }
}

@media (max-width: 520px) {
  .daylog-boot-loading {
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .daylog-boot-loading-card {
    padding: 24px 22px;
    border-radius: 22px;
  }

  .auth-gate,
  .auth-settings-layer {
    align-items: start;
    padding: 14px 12px max(14px, env(safe-area-inset-bottom));
  }

  .auth-card {
    width: 100%;
    padding: 25px 22px 22px;
    border-radius: 22px;
  }

  .auth-brand {
    margin-bottom: 24px;
  }

  .auth-card h1 {
    font-size: 29px;
  }

  .auth-copy {
    margin-bottom: 21px;
  }

  .auth-settings-actions,
  .auth-recovery-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) and (max-height: 650px) {
  .auth-gate,
  .auth-settings-layer {
    padding-top: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .auth-card {
    padding: 18px 18px 16px;
    border-radius: 18px;
  }

  .auth-brand {
    margin-bottom: 15px;
  }

  .auth-mark {
    width: 38px;
    height: 38px;
    font-size: 18px;
    border-radius: 11px;
  }

  .auth-brand-name {
    font-size: 20px;
  }

  .auth-eyebrow {
    margin-bottom: 6px;
  }

  .auth-card h1 {
    font-size: 26px;
  }

  .auth-copy {
    margin: 8px 0 14px;
    font-size: 13px;
    line-height: 1.55;
  }

  .auth-form {
    gap: 10px;
  }

  .auth-field {
    gap: 5px;
  }

  .auth-input,
  .auth-submit {
    min-height: 44px;
  }

  .auth-input input {
    padding: 10px 12px;
  }

  .auth-note {
    margin-top: 12px;
    padding-top: 10px;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-gate.is-leaving,
  .auth-gate.is-leaving .auth-card,
  .auth-card.is-shaking,
  .auth-spinner {
    animation: none;
  }
}

/* Single taps and pinch gestures remain available on touch screens. */
html, body, main, section, nav, dialog, form, button, a, input, textarea, select, [contenteditable] {
  touch-action: manipulation;
}
