:root {
  color-scheme: light;
  --bg: #f4efe5;
  --bg-deep: #ede6d9;
  --surface: #fffdf8;
  --surface-soft: #f8f4eb;
  --ink: #1d2a24;
  --ink-soft: #34443c;
  --muted: #7c8178;
  --line: rgba(29, 42, 36, 0.11);
  --line-strong: rgba(29, 42, 36, 0.18);
  --accent: #d86643;
  --accent-soft: #f0a27b;
  --accent-wash: rgba(216, 102, 67, 0.1);
  --green: #346c56;
  --green-deep: #15271f;
  --danger: #a94c39;
  --shadow-sm: 0 6px 18px rgba(51, 43, 31, 0.055);
  --shadow-md: 0 18px 44px rgba(51, 43, 31, 0.1);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-display: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 2%, rgba(216, 102, 67, 0.09), transparent 25rem),
    radial-gradient(circle at 100% 42%, rgba(52, 108, 86, 0.08), transparent 24rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-booting {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

input {
  min-width: 0;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* Boot */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  background: var(--bg);
}

.boot-mark {
  font-size: 2.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.boot-mark span {
  color: var(--accent);
}

.boot-line {
  position: relative;
  width: 72px;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 42, 36, 0.1);
}

.boot-line::after {
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: inherit;
  background: var(--accent);
  content: "";
  animation: bootSlide 1.1s ease-in-out infinite;
}

@keyframes bootSlide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(260%);
  }
}

/* Login */

.login-view {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 75% 18%, rgba(218, 122, 83, 0.18), transparent 22rem),
    radial-gradient(circle at 8% 88%, rgba(80, 133, 108, 0.2), transparent 22rem),
    #17261f;
  color: #f8f2e7;
  isolation: isolate;
}

.login-view::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 74%);
  content: "";
}

.login-view :focus-visible {
  outline-color: var(--accent-soft);
}

.login-deco {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.deco-ring {
  position: absolute;
  display: block;
  border: 1px solid rgba(245, 237, 224, 0.13);
  border-radius: 50%;
}

.deco-ring-a {
  top: 7%;
  right: -145px;
  width: 320px;
  height: 320px;
}

.deco-ring-b {
  top: -130px;
  right: -210px;
  width: 560px;
  height: 560px;
  border-color: rgba(245, 237, 224, 0.075);
}

.deco-cross {
  position: absolute;
  width: 15px;
  height: 15px;
  opacity: 0.55;
}

.deco-cross::before,
.deco-cross::after {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent-soft);
  content: "";
}

.deco-cross::after {
  transform: rotate(90deg);
}

.deco-cross-a {
  top: 28%;
  left: 9%;
}

.deco-cross-b {
  right: 13%;
  bottom: 22%;
  transform: scale(0.7);
}

.deco-word {
  position: absolute;
  top: 4%;
  right: -18px;
  color: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(7rem, 28vw, 12rem);
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 1;
  opacity: 0.2;
  -webkit-text-stroke: 1px rgba(248, 242, 231, 0.32);
  transform: rotate(90deg) translateX(34%);
  transform-origin: right top;
}

.login-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(34px + env(safe-area-inset-top)) 26px
    calc(26px + env(safe-area-inset-bottom));
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: clamp(38px, 10vh, 86px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.brand-y {
  margin-right: 1px;
  color: var(--accent-soft);
  font-size: 1.72rem;
  font-style: italic;
  letter-spacing: 0;
}

.private-pill {
  align-self: center;
  margin-left: 12px;
  padding: 4px 8px 3px;
  border: 1px solid rgba(248, 242, 231, 0.2);
  border-radius: 999px;
  color: rgba(248, 242, 231, 0.52);
  font-family: var(--font-body);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
}

.login-kicker {
  margin: 0 0 12px;
  color: var(--accent-soft);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.login-title {
  margin: 0;
  color: #fbf6eb;
  font-family: var(--font-display);
  font-size: clamp(2.55rem, 11vw, 3.45rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1.15;
}

.login-title em {
  color: #efb18e;
  font-style: normal;
}

.login-lede {
  max-width: 19rem;
  margin: 18px 0 34px;
  color: rgba(248, 242, 231, 0.58);
  font-size: 0.88rem;
  line-height: 1.75;
}

.login-form {
  width: 100%;
}

.field-label {
  display: block;
  margin: 0 0 9px 3px;
  color: rgba(248, 242, 231, 0.7);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.key-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 16px;
  border: 1px solid rgba(248, 242, 231, 0.16);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.055);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.key-field:focus-within {
  border-color: rgba(240, 162, 123, 0.72);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(240, 162, 123, 0.09);
}

.field-icon {
  flex: none;
  width: 19px;
  height: 19px;
  color: rgba(248, 242, 231, 0.36);
}

#access-key {
  flex: 1;
  width: 100%;
  height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fbf6eb;
  font-size: 16px;
  letter-spacing: 0.035em;
}

#access-key::placeholder {
  color: rgba(248, 242, 231, 0.32);
}

#access-key:-webkit-autofill,
#access-key:-webkit-autofill:hover,
#access-key:-webkit-autofill:focus {
  -webkit-text-fill-color: #fbf6eb;
  box-shadow: 0 0 0 1000px #24342c inset;
  transition: background-color 9999s ease-out;
}

.reveal-button {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: rgba(248, 242, 231, 0.45);
  transition:
    color 160ms ease,
    background 160ms ease;
}

.reveal-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 242, 231, 0.78);
}

.reveal-button svg {
  width: 19px;
  height: 19px;
}

.form-error {
  margin: 10px 2px 0;
  color: #f0a088;
  font-size: 0.78rem;
  line-height: 1.5;
}

.login-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  margin-top: 16px;
  padding: 8px 9px 8px 21px;
  overflow: hidden;
  border-radius: 17px;
  background: #f0a27b;
  color: #1b2a23;
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.login-button:hover {
  background: #f4b08d;
}

.login-button:active {
  transform: scale(0.988);
}

.button-arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(23, 38, 31, 0.88);
  color: #fbf6eb;
}

.button-arrow svg {
  width: 19px;
  height: 19px;
}

.button-spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin-right: 12px;
  border: 2px solid rgba(23, 38, 31, 0.25);
  border-top-color: #17261f;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.login-button.is-loading .button-arrow {
  display: none;
}

.login-button.is-loading .button-spinner {
  display: block;
}

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

.login-form.is-shaking .key-field {
  animation: shake 360ms ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  55% {
    transform: translateX(4px);
  }
  78% {
    transform: translateX(-2px);
  }
}

.login-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 22px 0 0;
  color: rgba(248, 242, 231, 0.36);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.live-dot {
  display: inline-block;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #73b995;
  box-shadow: 0 0 0 3px rgba(115, 185, 149, 0.11);
}

/* App shell */

.app-view {
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(15px + env(safe-area-inset-top)) 21px 10px;
  background: linear-gradient(
    to bottom,
    rgba(244, 239, 229, 0.97) 0%,
    rgba(244, 239, 229, 0.88) 72%,
    rgba(244, 239, 229, 0) 100%
  );
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.wordmark-y {
  color: var(--accent);
  font-size: 1.28rem;
  font-style: italic;
  letter-spacing: 0;
}

.topbar-date {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.62);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar-date .live-dot {
  width: 5px;
  height: 5px;
  background: var(--green);
  box-shadow: none;
}

.app-main {
  display: block;
}

.page {
  display: none;
  padding: 18px 20px 30px;
}

.page.is-active {
  display: block;
  animation: pageIn 320ms cubic-bezier(0.22, 0.72, 0.24, 1) both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-heading {
  margin-bottom: 22px;
}

.page-kicker {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.page-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2.12rem, 9.4vw, 2.72rem);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 1.16;
}

.page-subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.card-label {
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.card-label-light {
  color: rgba(248, 242, 231, 0.46);
}

/* Plan */

.progress-card {
  position: relative;
  margin-bottom: 14px;
  padding: 21px 21px 19px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(240, 162, 123, 0.17), transparent 15rem),
    linear-gradient(145deg, #243d32 0%, #172a22 58%, #13231c 100%);
  color: #f9f3e7;
  box-shadow: 0 18px 40px rgba(24, 42, 34, 0.2);
}

.progress-card::before {
  position: absolute;
  top: -70px;
  right: -50px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(249, 243, 231, 0.1);
  border-radius: 50%;
  content: "";
}

.progress-card::after {
  position: absolute;
  top: -24px;
  right: -12px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(249, 243, 231, 0.055);
  border-radius: 50%;
  content: "";
}

.progress-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-fraction {
  padding: 5px 9px;
  border: 1px solid rgba(249, 243, 231, 0.13);
  border-radius: 999px;
  color: rgba(249, 243, 231, 0.66);
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.progress-number {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  margin-top: 16px;
  font-size: clamp(3.8rem, 17vw, 4.8rem);
  font-weight: 580;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.percent-sign {
  margin-top: 6px;
  margin-left: 3px;
  color: var(--accent-soft);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0;
}

.progress-copy {
  position: relative;
  z-index: 1;
  max-width: 16rem;
  margin: 12px 0 18px;
  color: rgba(249, 243, 231, 0.55);
  font-size: 0.75rem;
  line-height: 1.6;
}

.progress-track {
  position: relative;
  z-index: 1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(249, 243, 231, 0.13);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d86643, #f0a27b);
  transition: width 420ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.add-plan {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.add-plan:focus-within {
  border-color: rgba(216, 102, 67, 0.45);
  box-shadow: 0 0 0 4px rgba(216, 102, 67, 0.07), var(--shadow-sm);
}

.add-plan input {
  flex: 1;
  width: 100%;
  height: 44px;
  padding: 0 8px 0 11px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.add-plan input::placeholder {
  color: #a2a399;
}

.add-button {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff8f1;
  box-shadow: 0 7px 16px rgba(216, 102, 67, 0.22);
  transition:
    transform 150ms ease,
    background 150ms ease;
}

.add-button svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.1;
}

.add-button:hover {
  background: #c95b3a;
}

.add-button:active {
  transform: scale(0.94);
}

.add-button:disabled {
  opacity: 0.55;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 2px 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-head span {
  color: var(--muted);
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    opacity 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.plan-item:hover {
  border-color: var(--line-strong);
}

.plan-item.is-completed {
  background: rgba(255, 253, 248, 0.58);
}

.plan-check {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid #bbbcb1;
  border-radius: 50%;
  color: #fff;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.plan-check svg {
  width: 15px;
  height: 15px;
  opacity: 0;
  stroke-width: 2.4;
  transform: scale(0.5);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.plan-check:hover {
  border-color: var(--green);
}

.plan-item.is-completed .plan-check {
  border-color: var(--green);
  background: var(--green);
}

.plan-item.is-completed .plan-check svg {
  opacity: 1;
  transform: scale(1);
}

.plan-text {
  flex: 1;
  margin: 0;
  padding: 9px 0;
  overflow-wrap: anywhere;
  font-size: 0.91rem;
  line-height: 1.48;
  transition: color 160ms ease;
}

.plan-item.is-completed .plan-text {
  color: #999b91;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.plan-delete {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #a5a69c;
  opacity: 0.62;
  transition:
    color 160ms ease,
    background 160ms ease,
    opacity 160ms ease;
}

.plan-delete:hover {
  background: rgba(169, 76, 57, 0.08);
  color: var(--danger);
  opacity: 1;
}

.plan-delete svg {
  width: 17px;
  height: 17px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 20px;
  border: 1px dashed rgba(29, 42, 36, 0.16);
  border-radius: 20px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
}

.empty-icon svg {
  width: 20px;
  height: 20px;
}

.empty-state p {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 600;
}

.empty-state > span:last-child {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
}

/* Supervision */

.focus-card {
  position: relative;
  padding: 19px 17px 17px;
  overflow: hidden;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 9%, rgba(240, 162, 123, 0.19), transparent 45%),
    linear-gradient(160deg, #1d3b2f 0%, #162a21 55%, #122219 100%);
  color: #f9f3e7;
  box-shadow: 0 20px 46px rgba(24, 42, 34, 0.2);
}

.focus-card::after {
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 200px;
  height: 200px;
  border: 1px solid rgba(249, 243, 231, 0.06);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.focus-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px;
}

.focus-label {
  color: rgba(249, 243, 231, 0.52);
  font-size: 0.59rem;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.focus-state {
  padding: 5px 9px;
  border: 1px solid rgba(249, 243, 231, 0.12);
  border-radius: 999px;
  color: rgba(249, 243, 231, 0.55);
  font-size: 0.62rem;
  font-weight: 600;
}

.focus-state.is-running {
  border-color: rgba(240, 162, 123, 0.3);
  background: rgba(240, 162, 123, 0.1);
  color: #f2b491;
}

.focus-visual {
  position: relative;
  width: min(218px, 62vw);
  margin: 10px auto 4px;
  aspect-ratio: 1;
}

.focus-ring {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-90deg);
}

.focus-track {
  fill: none;
  stroke: rgba(249, 243, 231, 0.1);
  stroke-width: 5;
}

.focus-fill {
  fill: none;
  stroke: #f0a27b;
  stroke-linecap: round;
  stroke-width: 5;
  transition: stroke-dashoffset 300ms linear;
}

.focus-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.focus-time {
  color: #fbf6eb;
  font-size: clamp(2.9rem, 14vw, 3.55rem);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
  line-height: 1;
}

.focus-unit {
  margin-top: 8px;
  color: rgba(249, 243, 231, 0.34);
  font-size: 0.51rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.focus-presets {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 9px 0 14px;
}

.focus-presets button {
  padding: 8px 12px;
  border: 1px solid rgba(249, 243, 231, 0.14);
  border-radius: 999px;
  color: rgba(249, 243, 231, 0.56);
  font-size: 0.68rem;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.focus-presets button:hover {
  border-color: rgba(249, 243, 231, 0.28);
  color: #f9f3e7;
}

.focus-presets button.is-selected {
  border-color: #f0a27b;
  background: #f0a27b;
  color: #182a21;
  font-weight: 700;
}

.focus-presets button:disabled {
  opacity: 0.38;
}

.focus-presets button.is-selected:disabled {
  opacity: 0.75;
}

.focus-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.focus-primary {
  min-height: 49px;
  padding: 0 18px;
  border-radius: 15px;
  background: #f0a27b;
  color: #17261f;
  font-size: 0.83rem;
  font-weight: 750;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.focus-primary:hover {
  background: #f4b08d;
}

.focus-primary:active {
  transform: scale(0.988);
}

.focus-secondary {
  min-height: 49px;
  padding: 0 16px;
  border: 1px solid rgba(249, 243, 231, 0.14);
  border-radius: 15px;
  color: rgba(249, 243, 231, 0.6);
  font-size: 0.76rem;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.focus-secondary:hover {
  background: rgba(249, 243, 231, 0.06);
  color: #f9f3e7;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 82px;
  padding: 14px 11px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.76);
}

.stat-value {
  color: var(--ink);
  font-size: 1.48rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.stat-label {
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.45;
}

.checkin-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.checkin-card::after {
  position: absolute;
  top: -42px;
  right: -29px;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(52, 108, 86, 0.1);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.checkin-copy {
  position: relative;
  z-index: 1;
}

.checkin-copy h2 {
  margin: 8px 0 7px;
  font-size: 1.22rem;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.checkin-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.6;
}

.checkin-button {
  position: relative;
  z-index: 1;
  min-height: 45px;
  padding: 0 16px;
  border-radius: 13px;
  background: var(--green);
  color: #fbf8ef;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.checkin-button:hover {
  background: #2c5e4a;
}

.checkin-button:active {
  transform: scale(0.97);
}

.checkin-button:disabled {
  opacity: 0.55;
}

.checkin-stamp {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 13px;
  border: 1px solid rgba(52, 108, 86, 0.2);
  border-radius: 13px;
  background: rgba(52, 108, 86, 0.08);
  color: var(--green);
  font-size: 0.73rem;
  font-weight: 750;
  white-space: nowrap;
}

.checkin-stamp svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.3;
}

/* About */

.about-heading {
  margin-bottom: 24px;
}

.about-mark {
  display: flex;
  align-items: baseline;
  margin: 14px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.6rem, 16vw, 4.7rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.about-mark span {
  margin-right: 2px;
  color: var(--accent);
  font-size: 1.16em;
  font-style: italic;
}

.about-heading .page-title {
  font-size: clamp(1.85rem, 7.7vw, 2.3rem);
}

.about-card {
  padding: 23px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(240, 162, 123, 0.16), transparent 12rem),
    var(--ink);
  color: #f8f2e7;
}

.about-card .card-label {
  color: rgba(248, 242, 231, 0.42);
}

.about-card h2 {
  margin: 9px 0 10px;
  font-size: 1.25rem;
  font-weight: 660;
  letter-spacing: -0.03em;
}

.about-card p {
  margin: 0;
  color: rgba(248, 242, 231, 0.58);
  font-size: 0.8rem;
  line-height: 1.85;
}

.about-rows {
  margin-top: 12px;
  padding: 4px 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.72);
}

.about-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 49px;
  border-bottom: 1px solid rgba(29, 42, 36, 0.07);
  font-size: 0.76rem;
}

.about-row:last-child {
  border-bottom: 0;
}

.about-row span {
  color: var(--muted);
}

.about-row strong {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 650;
  text-align: right;
}

.logout-button {
  width: 100%;
  min-height: 51px;
  margin-top: 18px;
  border: 1px solid rgba(169, 76, 57, 0.19);
  border-radius: 16px;
  background: rgba(169, 76, 57, 0.045);
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.logout-button:hover {
  border-color: rgba(169, 76, 57, 0.32);
  background: rgba(169, 76, 57, 0.08);
}

.about-foot {
  margin: 24px 0 0;
  color: #a5a69c;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
}

/* Bottom navigation */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: min(100%, 480px);
  padding: 8px 15px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(29, 42, 36, 0.08);
  background: rgba(250, 247, 240, 0.9);
  box-shadow: 0 -8px 30px rgba(51, 43, 31, 0.045);
  -webkit-backdrop-filter: blur(20px) saturate(1.18);
  backdrop-filter: blur(20px) saturate(1.18);
  transform: translateX(-50%);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 55px;
  border-radius: 15px;
  color: #92958b;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  transition:
    color 180ms ease,
    background 180ms ease;
}

.tab svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.75;
}

.tab:hover {
  color: var(--ink-soft);
}

.tab.is-active {
  background: rgba(29, 42, 36, 0.062);
  color: var(--ink);
}

.tab.is-active::before {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  transform: translateX(-50%);
}

/* Toast */

.toast {
  position: fixed;
  bottom: calc(92px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 90;
  width: max-content;
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 16px;
  border-radius: 13px;
  background: #1c2a23;
  color: #fbf6eb;
  box-shadow: 0 14px 34px rgba(27, 41, 34, 0.25);
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

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

.toast.is-error {
  background: #8d3f2f;
}

/* 重复计划徽标与管理入口 */

.plan-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 8px 0;
}

.plan-content .plan-text {
  flex: none;
  padding: 0;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid rgba(216, 102, 67, 0.22);
  border-radius: 999px;
  background: rgba(216, 102, 67, 0.07);
  color: #a9553a;
  font-size: 0.6rem;
  font-weight: 650;
  line-height: 1.5;
}

.plan-badge svg {
  width: 11px;
  height: 11px;
  stroke-width: 2;
}

.plan-item.is-completed .plan-badge {
  border-color: rgba(29, 42, 36, 0.1);
  background: transparent;
  color: #9b9d92;
}

.recurring-manage {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed rgba(29, 42, 36, 0.18);
  border-radius: 15px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.recurring-manage:hover {
  border-color: rgba(216, 102, 67, 0.4);
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink-soft);
}

.recurring-manage svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.recurring-manage-count {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(29, 42, 36, 0.06);
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
}

.focus-note {
  position: relative;
  z-index: 1;
  margin: 12px 2px 0;
  color: rgba(249, 243, 231, 0.38);
  font-size: 0.61rem;
  line-height: 1.55;
  text-align: center;
}

.about-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 49px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.78);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 650;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.about-action:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.about-action svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* 底部弹层 */

body.is-sheet-open {
  overflow: hidden;
}

.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 28, 22, 0.44);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: sheetFade 200ms ease both;
}

.sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  max-height: min(86vh, 720px);
  max-height: min(86dvh, 720px);
  padding: 9px 20px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  box-shadow: 0 -22px 60px rgba(18, 33, 25, 0.3);
  animation: sheetUp 260ms cubic-bezier(0.22, 0.72, 0.24, 1) both;
}

.sheet-handle {
  display: block;
  width: 36px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: rgba(29, 42, 36, 0.16);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.sheet-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.sheet-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--muted);
  transition:
    background 150ms ease,
    color 150ms ease;
}

.sheet-close:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.sheet-close svg {
  width: 17px;
  height: 17px;
}

.sheet-body {
  padding: 14px 0 2px;
}

.sheet-note {
  margin: 14px 2px 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sheet-body > .sheet-note:first-child {
  margin-top: 0;
}

.sheet-hint {
  margin: 8px 2px 0;
  color: #9b9d92;
  font-size: 0.7rem;
  line-height: 1.62;
}

.sheet-summary {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.sheet-summary-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.5;
}

.sheet-summary-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.5;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.choice-chip {
  min-height: 44px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.choice-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.choice-chip.is-selected {
  border-color: rgba(216, 102, 67, 0.55);
  background: rgba(216, 102, 67, 0.1);
  color: #a9553a;
  font-weight: 750;
}

.weekday-picker {
  margin-top: 14px;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekday-chip {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.weekday-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.weekday-chip.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #fbf6eb;
}

.sheet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.sheet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.sheet-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.sheet-row-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sheet-row-label {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
}

.sheet-row-hint {
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.5;
}

.sheet-row > svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: #b3b4a9;
}

.sheet-row.is-danger {
  justify-content: center;
  gap: 7px;
  border-color: rgba(169, 76, 57, 0.2);
  background: rgba(169, 76, 57, 0.04);
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.sheet-row.is-danger:hover {
  border-color: rgba(169, 76, 57, 0.36);
  background: rgba(169, 76, 57, 0.08);
}

.sheet-row.is-danger > svg {
  color: var(--danger);
  order: -1;
  width: 15px;
  height: 15px;
}

.sheet-field {
  margin-top: 16px;
}

.sheet-field-label {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.sheet-input,
.sheet-date {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 16px;
  outline: 0;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.sheet-input:focus,
.sheet-date:focus {
  border-color: rgba(216, 102, 67, 0.5);
  box-shadow: 0 0 0 3px rgba(216, 102, 67, 0.09);
}

.sheet-field + .sheet-field {
  margin-top: 12px;
}

.sheet-date-row {
  display: flex;
  gap: 8px;
}

.sheet-date {
  flex: 1;
  min-width: 0;
}

.sheet-inline-button {
  flex: none;
  height: 46px;
  padding: 0 15px;
  border-radius: 12px;
  background: var(--ink);
  color: #fbf6eb;
  font-size: 0.74rem;
  font-weight: 700;
  transition: background 150ms ease;
}

.sheet-inline-button:hover {
  background: #24352c;
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
  margin-top: 18px;
}

.sheet-actions[hidden] {
  display: none;
}

.sheet-action {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 650;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    opacity 150ms ease;
}

.sheet-action:hover {
  border-color: var(--line-strong);
  background: #f2ece0;
}

.sheet-action.is-primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff8f1;
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(216, 102, 67, 0.22);
}

.sheet-action.is-primary:hover {
  background: #c95b3a;
}

.sheet-action:disabled {
  opacity: 0.5;
  box-shadow: none;
}

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

.manage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.manage-copy {
  flex: 1;
  min-width: 0;
}

.manage-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.83rem;
  font-weight: 650;
  line-height: 1.5;
}

.manage-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.5;
}

.manage-open {
  flex: none;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  transition:
    border-color 150ms ease,
    color 150ms ease;
}

.manage-open:hover {
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

body.is-sheet-open .toast {
  top: calc(14px + env(safe-area-inset-top));
  bottom: auto;
  z-index: 140;
  transform: translate(-50%, -8px);
}

body.is-sheet-open .toast.is-visible {
  transform: translate(-50%, 0);
}

@keyframes sheetFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheetUp {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Small phones */

@media (max-width: 359px) {
  .page {
    padding-right: 15px;
    padding-left: 15px;
  }

  .app-topbar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .progress-card {
    padding: 18px;
  }

  .checkin-card {
    gap: 10px;
    padding: 17px;
  }

  .checkin-button {
    padding: 0 12px;
  }

  .focus-presets button {
    padding: 8px 9px;
  }

  .sheet {
    padding-right: 15px;
    padding-left: 15px;
  }

  .sheet-actions {
    grid-template-columns: 1fr 1.2fr;
  }
}

@media (min-width: 640px) {
  .app-view {
    border-right: 1px solid rgba(29, 42, 36, 0.045);
    border-left: 1px solid rgba(29, 42, 36, 0.045);
    box-shadow: 0 0 80px rgba(51, 43, 31, 0.045);
  }

  .login-content {
    padding-right: 34px;
    padding-left: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
