:root {
  --bg: #f4f1e9;
  --paper: #fbfaf6;
  --paper-deep: #f0ece2;
  --ink: #222823;
  --muted: #7a7f78;
  --line: rgba(39, 49, 42, 0.1);
  --green: #2f5b4b;
  --green-deep: #183c31;
  --green-soft: #dfe9e2;
  --sage: #8ca393;
  --amber: #c58e3d;
  --amber-soft: #f4e8cd;
  --coral: #bd6659;
  --coral-soft: #f4ded9;
  --blue: #5e7892;
  --blue-soft: #dfe7ee;
  --shadow: 0 18px 50px rgba(40, 45, 38, 0.07);
  --radius: 22px;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.dark {
  --bg: #171c19;
  --paper: #202722;
  --paper-deep: #293129;
  --ink: #eef1eb;
  --muted: #9ca79f;
  --line: rgba(235, 243, 235, 0.09);
  --green: #8eb5a2;
  --green-deep: #d6eadf;
  --green-soft: #2b3d34;
  --amber-soft: #443824;
  --coral-soft: #46302d;
  --blue-soft: #2b3945;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, rgba(164, 181, 156, 0.14), transparent 25%),
    var(--bg);
  font-family: var(--sans);
  transition: color 0.3s, background-color 0.3s;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .app-shell {
  display: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(197, 142, 61, 0.18), transparent 28%),
    radial-gradient(circle at 88% 76%, rgba(94, 120, 146, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(255, 252, 244, 0.78), rgba(227, 236, 229, 0.42)),
    var(--bg);
}

body:not(.auth-locked) .auth-gate {
  display: none;
}

.auth-bg-orb {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.5;
  pointer-events: none;
}

.auth-bg-orb.orb-one {
  top: -80px;
  right: 12%;
  background: var(--green-soft);
}

.auth-bg-orb.orb-two {
  bottom: -100px;
  left: 10%;
  background: var(--blue-soft);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(486px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(251, 250, 246, 0.92)),
    rgba(251, 250, 246, 0.92);
  box-shadow: 0 30px 90px rgba(44, 54, 45, 0.14);
  backdrop-filter: blur(22px);
}

.auth-card::before {
  position: absolute;
  inset: 12px 12px auto auto;
  width: 86px;
  height: 86px;
  border-radius: 28px;
  content: "";
  background:
    linear-gradient(135deg, rgba(47, 91, 75, 0.16), rgba(197, 142, 61, 0.12));
  opacity: 0.75;
  pointer-events: none;
}

body.dark .auth-card {
  background:
    linear-gradient(180deg, rgba(45, 54, 48, 0.72), rgba(32, 39, 34, 0.94)),
    rgba(32, 39, 34, 0.94);
}

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

.auth-brand small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.auth-brand h1 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.25;
}

.auth-intro,
.auth-footnote {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.auth-intro {
  margin: 0 0 20px;
}

.auth-footnote {
  margin: 18px 0 0;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.auth-card form {
  display: grid;
  gap: 13px;
  margin-top: 22px;
}

.auth-card .field-block {
  margin: 0;
}

.auth-card .field-block > span {
  margin: 0 0 8px 4px;
  color: var(--green-deep);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.auth-card input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 15px;
  border: 1px solid rgba(47, 91, 75, 0.16);
  border-radius: 16px;
  outline: none;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(244, 241, 233, 0.92)),
    var(--paper);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
}

.auth-card input::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.auth-card input:focus {
  border-color: rgba(47, 91, 75, 0.55);
  box-shadow:
    0 0 0 4px rgba(47, 91, 75, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.auth-card input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--paper) inset;
}

.auth-card .cloud-status-hint {
  display: block;
  min-height: 38px;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(240, 236, 226, 0.72);
  font-size: 11px;
  line-height: 1.55;
}

.auth-card .auth-actions {
  margin-top: 2px;
}

.auth-card .auth-actions button {
  display: inline-grid;
  min-height: 46px;
  width: 100%;
  place-items: center;
  padding-right: 12px;
  padding-left: 12px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 650;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 246px;
  flex-direction: column;
  padding: 32px 22px 24px;
  border-right: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.78);
  backdrop-filter: blur(18px);
}

body.dark .sidebar {
  background: rgba(32, 39, 34, 0.88);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 8px 44px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px 14px 14px 4px;
  color: #f9f6ee;
  background: var(--green-deep);
  font-family: var(--serif);
  font-size: 22px;
  box-shadow: 0 8px 22px rgba(23, 58, 47, 0.2);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.12em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.nav-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-item:hover {
  color: var(--ink);
  background: var(--paper-deep);
}

.nav-item.active {
  color: var(--green-deep);
  background: var(--green-soft);
  font-weight: 600;
}

.nav-icon {
  font-size: 17px;
}

.nav-count {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 20px;
  color: var(--muted);
  background: var(--paper);
  font-size: 10px;
  text-align: center;
}

.sidebar-bottom {
  margin-top: auto;
}

.daily-quote {
  position: relative;
  margin: 0 8px 22px;
  padding: 18px 15px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
}

.quote-mark {
  position: absolute;
  top: 7px;
  left: 0;
  color: var(--sage);
  font-size: 27px;
  opacity: 0.5;
}

.daily-quote p {
  margin: 0 0 0 10px;
}

.profile-card {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.profile-card:hover {
  background: var(--paper-deep);
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--green), var(--sage));
  font-family: var(--serif);
}

.profile-card strong,
.profile-card small {
  display: block;
}

.profile-card strong {
  font-size: 12px;
}

.profile-card small {
  max-width: 130px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-dot {
  color: var(--muted);
  font-size: 9px;
}

.main-content {
  max-width: 1500px;
  min-height: 100vh;
  margin-left: 246px;
  padding: 38px 5vw 70px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.topbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.icon-button,
.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.icon-button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.sound-button {
  position: relative;
  color: var(--green-deep);
  font-size: 16px;
}

.sound-button::after {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  content: "";
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.sound-button.muted {
  color: var(--muted);
}

.sound-button.muted::after {
  background: var(--muted);
  box-shadow: none;
  opacity: 0.45;
}

.pwa-install-button {
  color: var(--green-deep);
  background: var(--amber-soft);
}

.primary-button {
  padding: 11px 17px;
  border: 1px solid var(--green-deep);
  color: var(--paper);
  background: var(--green-deep);
  box-shadow: 0 7px 18px rgba(31, 70, 57, 0.14);
}

.secondary-button {
  padding: 10px 16px;
  border: 1px solid rgba(47, 91, 75, 0.2);
  color: var(--green-deep);
  background: var(--green-soft);
}

.ghost-button {
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: transparent;
}

.large {
  min-height: 48px;
  padding-right: 22px;
  padding-left: 22px;
}

.wide {
  width: 100%;
}

.view {
  display: none;
  animation: view-in 0.3s ease;
}

.view.active {
  display: block;
}

@keyframes view-in {
  from {
    transform: translateY(5px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.countdown-hero {
  position: relative;
  display: grid;
  min-height: 360px;
  grid-template-columns: minmax(0, 1.1fr) minmax(250px, 0.9fr);
  overflow: hidden;
  border-radius: 29px;
  color: #f8f4e9;
  background:
    linear-gradient(115deg, rgba(20, 58, 46, 0.98), rgba(52, 90, 70, 0.92)),
    #214a3c;
  box-shadow: 0 24px 60px rgba(33, 67, 55, 0.16);
}

.hero-glow {
  position: absolute;
  top: -100px;
  left: 36%;
  width: 420px;
  height: 300px;
  border-radius: 50%;
  background: rgba(243, 222, 163, 0.09);
  filter: blur(30px);
}

.countdown-copy {
  position: relative;
  z-index: 3;
  padding: 36px 48px 32px;
}

.target-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.07);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.target-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e9c77e;
  box-shadow: 0 0 0 4px rgba(233, 199, 126, 0.12);
}

.target-exam-name {
  max-width: 520px;
  margin: 16px 0 0;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 29px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.hero-kicker {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-family: var(--serif);
  font-size: 14px;
}

.countdown-number {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: -3px;
}

.countdown-number strong {
  font-family: var(--serif);
  font-size: clamp(70px, 7vw, 102px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1.1;
}

.countdown-number span {
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--serif);
  font-size: 19px;
}

.countdown-date {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
}

.countdown-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: -2px;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.text-button.light {
  color: rgba(255, 255, 255, 0.7);
}

.countdown-visual {
  position: relative;
  overflow: hidden;
}

.sun {
  position: absolute;
  top: 42px;
  right: 26%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e9c77e;
  box-shadow: 0 0 70px rgba(233, 199, 126, 0.35);
}

.mountain {
  position: absolute;
  right: -10%;
  bottom: -80px;
  width: 115%;
  height: 285px;
  border-radius: 46% 54% 0 0 / 72% 64% 0 0;
  transform: rotate(-8deg);
}

.mountain-back {
  right: 16%;
  bottom: -100px;
  background: #547861;
  opacity: 0.66;
}

.mountain-front {
  background: #315d49;
  box-shadow: inset 40px 50px 90px rgba(255, 255, 255, 0.05);
}

.path {
  position: absolute;
  right: 22%;
  bottom: -40px;
  width: 55px;
  height: 260px;
  border-radius: 100% 0 0;
  transform: rotate(35deg);
  background: linear-gradient(to top, #b8a979, rgba(217, 204, 157, 0.5));
  clip-path: polygon(30% 0, 58% 0, 100% 100%, 0 100%);
  opacity: 0.72;
}

.flag {
  position: absolute;
  top: 73px;
  right: 24%;
  z-index: 3;
  display: grid;
  width: 32px;
  height: 25px;
  place-items: center;
  border-radius: 3px 8px 8px 3px;
  color: #2d5946;
  background: #f6ecd1;
  font-family: var(--serif);
  font-size: 12px;
  box-shadow: -2px 20px 0 -15px #e9c77e;
}

.mock-target {
  display: flex;
  width: min(450px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(9, 33, 25, 0.22);
  backdrop-filter: blur(10px);
}

.mock-target > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mock-target small,
.mock-target strong {
  display: block;
}

.mock-target small {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
}

.mock-target strong {
  font-size: 11px;
  font-weight: 500;
}

.mock-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
}

.mock-days {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
}

.mock-days b {
  color: #f2d58f;
  font-family: var(--serif);
  font-size: 17px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 42px 3px 18px;
}

.section-heading.compact {
  margin-top: 37px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.section-index {
  color: var(--sage);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.dashboard-grid .card {
  min-height: 228px;
  padding: 24px;
}

.card-heading,
.chart-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-heading small,
.card-heading h3 {
  display: block;
}

.card-heading small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
}

.card-heading h3,
.chart-title h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.card-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  font-size: 15px;
}

.card-icon.green {
  color: var(--green);
  background: var(--green-soft);
}

.card-icon.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.card-icon.coral {
  color: var(--coral);
  background: var(--coral-soft);
}

.card-icon.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-chip {
  padding: 5px 9px;
  border-radius: 20px;
  color: var(--muted);
  background: var(--paper-deep);
  font-size: 9px;
}

.mini-timer {
  margin: 23px 0 18px;
}

.mini-timer strong {
  font-family: var(--serif);
  font-size: 35px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.timer-progress {
  height: 4px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper-deep);
}

.timer-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.4s;
}

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

.round-add {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.recent-list {
  min-height: 92px;
  margin: 19px 0 14px;
}

.empty-state-small {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
}

.recent-note {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.recent-note:first-child {
  padding-top: 0;
}

.recent-note:last-child {
  border-bottom: 0;
}

.recent-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
}

.recent-note span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.big-stat {
  color: var(--coral);
  font-family: var(--serif);
  font-size: 34px;
}

.muted {
  margin: 8px 0 15px;
  color: var(--muted);
  font-size: 10px;
}

.module-bars {
  display: flex;
  height: 8px;
  margin-bottom: 27px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--paper-deep);
}

.module-bars span:nth-child(1) {
  background: var(--coral);
}

.module-bars span:nth-child(2) {
  background: var(--amber);
}

.module-bars span:nth-child(3) {
  background: var(--blue);
}

.module-bars span:nth-child(4) {
  background: var(--sage);
}

.streak {
  color: var(--amber);
  font-family: var(--serif);
  font-size: 16px;
}

.week-dots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 27px 0 19px;
}

.week-day {
  text-align: center;
}

.week-day span {
  display: grid;
  width: 31px;
  height: 31px;
  margin: 0 auto 7px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: var(--paper-deep);
  font-size: 10px;
}

.week-day.done span {
  color: #fff;
  background: var(--green);
}

.week-day.today span {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.week-day small {
  color: var(--muted);
  font-size: 8px;
}

.habit-note {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 10px;
}

.overview-strip {
  display: grid;
  grid-template-columns: 0.7fr 0.7fr 0.7fr 1.9fr;
  gap: 18px;
  align-items: center;
  padding: 25px 28px;
}

.overview-stat {
  padding-right: 17px;
  border-right: 1px solid var(--line);
}

.overview-stat span,
.overview-stat strong,
.overview-stat em {
  display: block;
}

.overview-stat span {
  color: var(--muted);
  font-size: 9px;
}

.overview-stat strong {
  margin: 8px 0 5px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.overview-stat strong small {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
}

.overview-stat em {
  color: var(--sage);
  font-size: 8px;
  font-style: normal;
}

.sparkline-wrap {
  height: 75px;
}

.sparkline-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 4px 0 27px;
  padding: 28px 0 7px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-intro .section-index {
  display: block;
  margin-bottom: 11px;
}

.page-intro h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(23px, 3vw, 33px);
  font-weight: 600;
}

.page-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 21px;
  padding: 14px;
}

.search-box {
  display: flex;
  min-width: 230px;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
}

.search-box span {
  color: var(--muted);
}

.search-box input {
  width: 100%;
  padding: 10px 0;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
}

.filter-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 8px 12px;
  border: 0;
  border-radius: 20px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.filter-pill.active {
  color: var(--green-deep);
  background: var(--green-soft);
}

.category-filter.active {
  color: var(--pill-color, var(--green-deep));
  background: color-mix(in srgb, var(--pill-color, var(--green)) 16%, transparent);
}

.masonry-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  align-items: start;
}

.inspiration-note {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 4px 20px 20px 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.inspiration-note::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  content: "";
  background: var(--note-color, var(--green));
}

.note-top,
.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.note-tag {
  padding: 5px 8px;
  border-radius: 20px;
  color: var(--note-color, var(--green));
  background: var(--paper-deep);
  font-size: 9px;
}

.note-date {
  color: var(--muted);
  font-size: 8px;
}

.inspiration-note h3 {
  margin: 20px 0 10px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}

.inspiration-note p {
  display: -webkit-box;
  margin: 0 0 23px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.9;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.note-custom-tag {
  color: var(--muted);
  font-size: 9px;
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.delete-button {
  padding: 4px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.delete-button:hover {
  color: var(--coral);
}

.tiny-button {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
}

.category-add-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-deep);
}

.category-manager-list {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.category-manager-row {
  display: grid;
  grid-template-columns: 14px minmax(110px, 1fr) 130px 46px auto auto;
  gap: 9px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.category-manager-row input,
.category-manager-row select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: var(--bg);
  font-size: 11px;
}

.category-color-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--paper-deep);
}

.category-usage {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

.empty-panel {
  grid-column: 1 / -1;
  padding: 70px 30px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-panel strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-family: var(--serif);
}

.mistake-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.summary-tile {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
}

.summary-tile small {
  margin-right: auto;
  color: var(--muted);
  font-size: 10px;
}

.summary-tile strong {
  font-family: var(--serif);
  font-size: 28px;
}

.summary-tile span {
  color: var(--muted);
  font-size: 9px;
}

.summary-tile.accent {
  color: var(--green-deep);
  background: var(--green-soft);
}

.select-control {
  padding: 10px 32px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--bg);
  font-size: 10px;
  outline: none;
}

.mistake-list {
  display: grid;
  gap: 13px;
}

.mistake-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 20px;
  padding: 21px 23px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 8px 30px rgba(40, 45, 38, 0.04);
}

.mistake-question-image {
  display: block;
  width: min(520px, 100%);
  max-height: 300px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  cursor: zoom-in;
  object-fit: contain;
}

.legacy-image-note {
  width: min(520px, 100%);
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px dashed rgba(197, 142, 61, 0.38);
  border-radius: 12px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 11px;
  line-height: 1.6;
}

.mistake-module {
  padding-right: 15px;
  border-right: 1px solid var(--line);
}

.mistake-module span {
  display: inline-block;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--coral);
  background: var(--coral-soft);
  font-size: 9px;
}

.mistake-module small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 8px;
}

.mistake-content h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.mistake-content h3.image-caption {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.answer-row {
  display: flex;
  gap: 15px;
  color: var(--muted);
  font-size: 9px;
}

.answer-row b {
  color: var(--ink);
}

.reason-box {
  margin-top: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--bg);
  font-size: 9px;
  line-height: 1.7;
}

.mistake-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}

.master-button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.master-button.mastered {
  color: var(--green-deep);
  background: var(--green-soft);
}

.timer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 17px;
}

.timer-main-card {
  display: flex;
  min-height: 590px;
  flex-direction: column;
  align-items: center;
  padding: 29px;
}

.mode-switch {
  display: flex;
  padding: 4px;
  border-radius: 13px;
  background: var(--paper-deep);
}

.mode-switch button {
  padding: 9px 14px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.mode-switch button.active {
  color: var(--green-deep);
  background: var(--paper);
  box-shadow: 0 3px 12px rgba(35, 45, 38, 0.06);
}

.focus-duration-picker {
  display: flex;
  width: min(680px, 100%);
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 17px;
}

.focus-duration-picker > span {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.focus-duration-picker > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.focus-duration-picker button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  cursor: pointer;
  transition: 0.18s ease;
}

.focus-duration-picker button:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.focus-duration-picker button.active {
  border-color: rgba(47, 91, 75, 0.22);
  color: var(--green-deep);
  background: var(--green-soft);
  font-weight: 600;
}

.focus-journey {
  position: relative;
  width: min(760px, 100%);
  height: 350px;
  margin: 18px 0 20px;
  overflow: hidden;
  border: 1px solid rgba(56, 83, 66, 0.13);
  border-radius: 22px;
  background:
    linear-gradient(180deg, #dbe8e8 0%, #edf1e4 55%, #c9d7b9 56%, #8fad83 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 15px 35px rgba(32, 63, 49, 0.1);
  isolation: isolate;
}

.journey-sky,
.journey-mountain,
.journey-road,
.journey-trees,
.journey-milestones {
  position: absolute;
  inset: 0;
}

.journey-sky {
  z-index: 0;
}

.journey-sun {
  position: absolute;
  top: 31px;
  right: 70px;
  width: 51px;
  height: 51px;
  border-radius: 50%;
  background: #f1cf7a;
  box-shadow: 0 0 36px rgba(241, 207, 122, 0.5);
}

.journey-cloud {
  position: absolute;
  width: 75px;
  height: 18px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    17px -9px 0 2px rgba(255, 255, 255, 0.58),
    38px 1px 0 -3px rgba(255, 255, 255, 0.58);
  animation: journeyCloud 18s linear infinite;
}

.cloud-one {
  top: 50px;
  left: 11%;
}

.cloud-two {
  top: 95px;
  left: 49%;
  opacity: 0.7;
  animation-duration: 25s;
  animation-delay: -9s;
}

.journey-bird {
  position: absolute;
  color: rgba(43, 73, 62, 0.45);
  font-size: 13px;
}

.bird-one {
  top: 73px;
  left: 62%;
}

.bird-two {
  top: 94px;
  left: 66%;
  transform: scale(0.7);
}

.mountain-far {
  z-index: 1;
  top: 78px;
  clip-path: polygon(0 62%, 14% 35%, 25% 58%, 42% 20%, 57% 60%, 72% 30%, 84% 48%, 100% 18%, 100% 100%, 0 100%);
  background: rgba(93, 126, 117, 0.28);
}

.mountain-near {
  z-index: 2;
  top: 128px;
  clip-path: polygon(0 65%, 12% 42%, 23% 61%, 38% 28%, 52% 70%, 65% 40%, 78% 63%, 91% 34%, 100% 48%, 100% 100%, 0 100%);
  background: #75967c;
}

.journey-road {
  z-index: 4;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.journey-road path {
  fill: none;
  stroke-linecap: round;
}

.road-shadow {
  stroke: rgba(58, 67, 49, 0.18);
  stroke-width: 36;
}

.road-line {
  stroke: #d9c5a1;
  stroke-width: 27;
  stroke-dasharray: 2 7;
}

.journey-trees {
  z-index: 3;
}

.journey-trees span {
  position: absolute;
  left: var(--x);
  bottom: var(--y);
  width: calc(22px * var(--s));
  height: calc(50px * var(--s));
  transform-origin: bottom center;
}

.journey-trees span::before {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 4px;
  content: "";
  background: #685741;
}

.journey-trees span::after {
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 22px;
  height: 38px;
  transform: translateX(-50%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  content: "";
  background: #355f4c;
}

.journey-milestones {
  z-index: 7;
  pointer-events: none;
}

.journey-milestone {
  position: absolute;
  display: grid;
  min-width: 42px;
  justify-items: center;
  transform: translate(-50%, 50%);
  transition: 0.35s ease;
}

.journey-milestone i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: rgba(244, 237, 213, 0.84);
  box-shadow: 0 5px 15px rgba(43, 61, 48, 0.17);
  font-size: 13px;
  font-style: normal;
}

.journey-milestone span {
  margin-top: 4px;
  padding: 2px 5px;
  border-radius: 7px;
  color: rgba(32, 55, 44, 0.72);
  background: rgba(248, 247, 239, 0.7);
  font-size: 7px;
  white-space: nowrap;
}

.journey-milestone.reached {
  transform: translate(-50%, 50%) scale(1.08);
}

.journey-milestone.reached i {
  background: #f1d98f;
  box-shadow: 0 0 0 5px rgba(241, 217, 143, 0.22), 0 5px 15px rgba(43, 61, 48, 0.18);
}

.journey-walker {
  position: absolute;
  z-index: 9;
  left: 7%;
  bottom: 22%;
  width: 42px;
  height: 70px;
  transform: translate(-50%, 25%) scale(0.82);
  transform-origin: center bottom;
  transition: left 0.9s linear, bottom 0.9s linear;
}

.walker-shadow {
  position: absolute;
  left: 5px;
  bottom: -1px;
  width: 34px;
  height: 8px;
  border-radius: 50%;
  background: rgba(28, 46, 35, 0.22);
}

.walker-head {
  position: absolute;
  top: 2px;
  left: 14px;
  z-index: 4;
  width: 15px;
  height: 15px;
  border-radius: 48% 48% 44% 44%;
  background: #c98f68;
  box-shadow: inset 0 5px 0 #33463c;
}

.walker-body {
  position: absolute;
  top: 17px;
  left: 11px;
  z-index: 3;
  width: 21px;
  height: 30px;
  border-radius: 9px 9px 5px 5px;
  background: #d6a75e;
}

.walker-pack {
  position: absolute;
  top: 19px;
  left: 5px;
  z-index: 2;
  width: 14px;
  height: 25px;
  border-radius: 5px;
  background: #355e50;
}

.walker-arm,
.walker-leg {
  position: absolute;
  width: 6px;
  border-radius: 5px;
  transform-origin: top center;
}

.walker-arm {
  top: 21px;
  z-index: 2;
  height: 25px;
  background: #c98f68;
}

.arm-left {
  left: 8px;
  transform: rotate(14deg);
}

.arm-right {
  left: 29px;
  transform: rotate(-14deg);
}

.walker-leg {
  top: 43px;
  z-index: 1;
  height: 26px;
  background: #3e5963;
}

.leg-left {
  left: 13px;
  transform: rotate(8deg);
}

.leg-right {
  left: 24px;
  transform: rotate(-8deg);
}

.focus-journey.walking .walker-body {
  animation: walkerBob 0.72s ease-in-out infinite;
}

.focus-journey.walking .leg-left,
.focus-journey.walking .arm-right {
  animation: walkerStepA 0.72s ease-in-out infinite;
}

.focus-journey.walking .leg-right,
.focus-journey.walking .arm-left {
  animation: walkerStepB 0.72s ease-in-out infinite;
}

.journey-hud {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 12;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 14px;
  color: #29483b;
  background: rgba(250, 249, 242, 0.7);
  box-shadow: 0 8px 24px rgba(38, 65, 53, 0.08);
  backdrop-filter: blur(8px);
}

.journey-hud span,
.journey-hud strong,
.journey-hud small {
  display: block;
}

.journey-hud span {
  color: rgba(41, 72, 59, 0.66);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.journey-hud strong {
  margin: 3px 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.journey-hud small {
  max-width: 190px;
  color: rgba(41, 72, 59, 0.66);
  font-size: 8px;
}

.journey-next-gift {
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 12;
  padding: 7px 10px;
  border-radius: 20px;
  color: rgba(41, 72, 59, 0.75);
  background: rgba(250, 249, 242, 0.72);
  font-size: 8px;
  backdrop-filter: blur(7px);
}

.journey-reward-popover {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 20;
  display: flex;
  width: min(320px, calc(100% - 38px));
  align-items: center;
  gap: 14px;
  padding: 18px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  color: #264437;
  background: rgba(250, 246, 225, 0.94);
  box-shadow: 0 20px 55px rgba(32, 57, 45, 0.25);
  animation: rewardArrival 0.42s ease both;
}

.journey-reward-popover > span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: #f2dfa2;
  font-size: 26px;
}

.journey-reward-popover small,
.journey-reward-popover strong {
  display: block;
}

.journey-reward-popover small {
  color: rgba(38, 68, 55, 0.58);
  font-size: 8px;
}

.journey-reward-popover strong {
  margin: 4px 0;
  font-family: var(--serif);
  font-size: 16px;
}

.journey-reward-popover p {
  margin: 0;
  color: rgba(38, 68, 55, 0.68);
  font-size: 9px;
}

.journey-log-card {
  padding: 23px;
}

.journey-gift-count {
  padding: 5px 8px;
  border-radius: 20px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 8px;
}

.journey-reward-history {
  display: grid;
  max-height: 270px;
  gap: 1px;
  margin-top: 15px;
  overflow: auto;
}

.journey-reward-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.journey-reward-item > i {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  background: var(--amber-soft);
  font-size: 15px;
  font-style: normal;
}

.journey-reward-item strong,
.journey-reward-item small {
  display: block;
}

.journey-reward-item strong {
  margin-bottom: 4px;
  font-size: 9px;
}

.journey-reward-item small {
  color: var(--muted);
  font-size: 8px;
}

.journey-reward-item > span:last-child {
  color: var(--amber);
  font-family: var(--serif);
  font-size: 12px;
}

@keyframes journeyCloud {
  0% {
    transform: translateX(-18px);
  }
  50% {
    transform: translateX(26px);
  }
  100% {
    transform: translateX(-18px);
  }
}

@keyframes walkerBob {
  50% {
    transform: translateY(-2px);
  }
}

@keyframes walkerStepA {
  0%,
  100% {
    transform: rotate(19deg);
  }
  50% {
    transform: rotate(-17deg);
  }
}

@keyframes walkerStepB {
  0%,
  100% {
    transform: rotate(-17deg);
  }
  50% {
    transform: rotate(19deg);
  }
}

@keyframes rewardArrival {
  from {
    opacity: 0;
    transform: translate(-50%, -44%) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.timer-circle {
  position: relative;
  display: grid;
  width: 280px;
  height: 280px;
  margin: 42px 0 32px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0deg, var(--paper-deep) 0deg);
  box-shadow: inset 0 0 0 1px var(--line);
}

.timer-circle::before {
  position: absolute;
  width: 248px;
  height: 248px;
  border-radius: 50%;
  content: "";
  background: var(--paper);
}

.timer-inner {
  position: relative;
  z-index: 2;
  text-align: center;
}

.timer-inner small,
.timer-inner strong,
.timer-inner span {
  display: block;
}

.timer-inner small {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.timer-inner strong {
  font-family: var(--serif);
  font-size: 54px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.timer-inner span {
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 10px;
}

.session-subject {
  width: min(460px, 100%);
}

.session-subject span {
  display: block;
  margin: 0 0 8px 4px;
  color: var(--muted);
  font-size: 9px;
}

.session-subject input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: var(--bg);
  text-align: center;
  font-size: 11px;
}

.session-binding {
  display: grid;
  width: min(620px, 100%);
  grid-template-columns: minmax(180px, 0.75fr) minmax(230px, 1.25fr);
  gap: 10px;
}

.session-binding label > span {
  display: block;
  margin: 0 0 8px 4px;
  color: var(--muted);
  font-size: 9px;
}

.session-binding select,
.session-binding input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: var(--bg);
  font: inherit;
  font-size: 10px;
}

.session-binding input {
  text-align: center;
}

.session-binding select:focus,
.session-binding input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(99, 139, 113, 0.08);
}

.discipline-strip {
  display: flex;
  width: min(620px, 100%);
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.discipline-strip > span,
.discipline-strip > small {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper-deep);
  font-size: 8px;
}

.discipline-strip > small {
  padding-right: 12px;
  padding-left: 12px;
}

.module-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green-deep);
  background: var(--green-soft);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.module-pill.small {
  color: var(--blue);
  background: var(--blue-soft);
}

.timer-controls {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.timer-side {
  display: grid;
  gap: 17px;
}

.soundscape-card {
  padding: 23px;
}

.sound-status {
  padding: 5px 8px;
  border-radius: 20px;
  color: var(--muted);
  background: var(--paper-deep);
  font-size: 8px;
}

.sound-status.playing {
  color: var(--green-deep);
  background: var(--green-soft);
}

.sound-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 18px 0;
}

.sound-options button {
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  cursor: pointer;
  transition: 0.18s ease;
}

.sound-options button:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.sound-options button.active {
  border-color: rgba(47, 91, 75, 0.2);
  color: var(--green-deep);
  background: var(--green-soft);
}

.volume-control {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
}

.volume-control input {
  width: 100%;
  accent-color: var(--green);
  cursor: pointer;
}

.volume-control b {
  color: var(--ink);
  font-size: 8px;
  font-weight: 500;
  text-align: right;
}

.sound-toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.sound-toggle span {
  display: block;
}

.sound-toggle strong,
.sound-toggle small {
  display: block;
}

.sound-toggle strong {
  font-size: 9px;
  font-weight: 600;
}

.sound-toggle small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.sound-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sound-toggle i {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 20px;
  background: var(--paper-deep);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: 0.2s ease;
}

.sound-toggle i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  content: "";
  background: var(--paper);
  box-shadow: 0 2px 5px rgba(20, 35, 27, 0.18);
  transition: 0.2s ease;
}

.sound-toggle input:checked + i {
  background: var(--green);
}

.sound-toggle input:checked + i::after {
  transform: translateX(15px);
}

.today-total {
  min-height: 175px;
  padding: 27px;
  color: #f8f4e9;
  background:
    radial-gradient(circle at 90% 0, rgba(238, 210, 145, 0.22), transparent 35%),
    var(--green-deep);
}

.today-total small,
.today-total strong {
  display: block;
}

.today-total small {
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
}

.today-total strong {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 500;
}

.today-total strong em {
  margin-left: 7px;
  font-family: var(--sans);
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
}

.today-total p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--serif);
  font-size: 10px;
}

.session-history-card {
  min-height: 398px;
  padding: 23px;
}

.session-history {
  max-height: 320px;
  margin-top: 17px;
  overflow: auto;
}

.session-item {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.session-item i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
}

.session-item strong,
.session-item small {
  display: block;
}

.session-item strong {
  margin-bottom: 4px;
  font-size: 10px;
}

.session-item small {
  color: var(--muted);
  font-size: 8px;
}

.session-item span {
  color: var(--green);
  font-family: var(--serif);
  font-size: 14px;
}

.session-item .session-duration {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-item .session-duration .delete-button {
  font-family: var(--sans);
  font-size: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.session-item:hover .session-duration .delete-button {
  opacity: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 16px;
}

.todo-focus-chart {
  grid-column: 1 / -1;
  min-height: 290px;
}

.todo-focus-overview {
  margin-top: 22px;
}

.todo-focus-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}

.todo-focus-summary span,
.todo-focus-summary b {
  padding: 6px 9px;
  border-radius: 20px;
  color: var(--muted);
  background: var(--paper-deep);
  font-size: 8px;
  font-weight: 500;
}

.todo-focus-summary b {
  margin-left: auto;
  color: var(--green);
  background: var(--green-soft);
}

.todo-focus-list {
  display: grid;
  gap: 13px;
}

.todo-focus-row {
  display: grid;
  grid-template-columns: minmax(155px, 0.8fr) minmax(180px, 1.3fr) 46px;
  align-items: center;
  gap: 14px;
}

.todo-focus-name {
  min-width: 0;
}

.todo-focus-name strong,
.todo-focus-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-focus-name strong {
  font-size: 10px;
}

.todo-focus-name small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.todo-focus-track {
  height: 8px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--paper-deep);
}

.todo-focus-track i {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.todo-focus-row > b {
  color: var(--green);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.chart-card {
  min-height: 345px;
  padding: 25px;
}

.chart-title small {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
}

.chart-title strong {
  color: var(--green);
  font-family: var(--serif);
  font-size: 23px;
}

.chart-title strong span {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
}

.line-chart {
  height: 250px;
  margin-top: 22px;
}

.line-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bar-chart {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

.bar-row {
  display: grid;
  grid-template-columns: 68px 1fr 35px;
  gap: 10px;
  align-items: center;
  font-size: 9px;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper-deep);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--green));
}

.bar-value {
  color: var(--muted);
  text-align: right;
}

.heatmap-card {
  min-height: 310px;
}

.heat-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 8px;
}

.heat-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--paper-deep);
}

.heat-legend i:nth-of-type(2) {
  background: #bdd0c3;
}

.heat-legend i:nth-of-type(3) {
  background: #7fa18d;
}

.heat-legend i:nth-of-type(4) {
  background: var(--green);
}

.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-columns: minmax(9px, 1fr);
  gap: 5px;
  margin-top: 35px;
}

.heat-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--paper-deep);
}

.heat-cell[data-level="1"] {
  background: #dce8df;
}

.heat-cell[data-level="2"] {
  background: #b4cbbd;
}

.heat-cell[data-level="3"] {
  background: #779b86;
}

.heat-cell[data-level="4"] {
  background: var(--green);
}

body.dark .heat-cell[data-level="1"] {
  background: #354b3f;
}

body.dark .heat-cell[data-level="2"] {
  background: #496b59;
}

.donut-layout {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 25px;
  align-items: center;
  margin-top: 30px;
}

.donut {
  position: relative;
  display: grid;
  width: 155px;
  height: 155px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 25%, var(--amber) 25% 50%, var(--coral) 50% 75%, var(--blue) 75%);
}

.donut::before {
  position: absolute;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  content: "";
  background: var(--paper);
}

.donut span {
  position: relative;
  z-index: 2;
  font-family: var(--serif);
  font-size: 25px;
}

.donut span small {
  display: block;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 8px;
  text-align: center;
}

.donut-legend {
  display: grid;
  gap: 13px;
}

.donut-legend div {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
}

.donut-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.donut-legend b {
  color: var(--ink);
}

.modal {
  width: min(610px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 23px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 35px 100px rgba(16, 25, 20, 0.25);
}

.modal.modal-large {
  width: min(760px, calc(100vw - 32px));
}

.modal::backdrop {
  background: rgba(18, 27, 22, 0.5);
  backdrop-filter: blur(5px);
}

.modal form {
  padding: 28px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 25px;
}

.modal-header small {
  color: var(--sage);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.modal-header h2 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
}

.modal-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--paper-deep);
  font-size: 20px;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-grid label span,
.field-block > span {
  display: block;
  margin: 0 0 7px 3px;
  color: var(--muted);
  font-size: 9px;
}

.modal input,
.modal select,
.modal textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: var(--bg);
  font-size: 11px;
  transition: border 0.2s, box-shadow 0.2s;
}

.mistake-image-field {
  margin: 16px 0;
}

.field-label {
  display: block;
  margin: 0 0 7px 3px;
  color: var(--muted);
  font-size: 9px;
}

.field-label b {
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 20px;
  color: var(--green-deep);
  background: var(--green-soft);
  font-size: 8px;
  font-weight: 500;
}

.field-block > span em {
  margin-left: 5px;
  color: var(--sage);
  font-size: 8px;
  font-style: normal;
}

.image-paste-zone {
  min-height: 154px;
  padding: 18px;
  border: 1px dashed rgba(47, 91, 75, 0.28);
  border-radius: 16px;
  outline: none;
  background:
    radial-gradient(circle at 50% 0, rgba(116, 151, 129, 0.1), transparent 58%),
    var(--bg);
  transition: 0.2s ease;
}

.image-paste-zone:focus,
.image-paste-zone.dragging {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 91, 75, 0.08);
}

.image-empty {
  display: flex;
  min-height: 118px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.paste-icon {
  display: grid;
  min-width: 44px;
  height: 34px;
  margin-bottom: 9px;
  padding: 0 8px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green-deep);
  background: var(--paper);
  font-size: 10px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(40, 45, 38, 0.06);
}

.image-empty strong {
  font-family: var(--serif);
  font-size: 13px;
}

.image-empty p {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 9px;
}

.image-file-button {
  position: relative;
  overflow: hidden;
  font-size: 9px;
  cursor: pointer;
}

.image-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.image-preview {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 14px;
  align-items: center;
}

.image-preview img {
  width: 150px;
  height: 112px;
  border-radius: 10px;
  background: var(--paper);
  object-fit: contain;
}

.image-preview strong,
.image-preview small {
  display: block;
}

.image-preview strong {
  margin-bottom: 6px;
  font-size: 10px;
}

.image-preview small {
  color: var(--muted);
  font-size: 8px;
}

.modal textarea {
  resize: vertical;
  line-height: 1.7;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(99, 139, 113, 0.1);
}

.field-block {
  display: block;
  margin: 15px 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.ai-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  padding: 14px;
  border: 1px solid rgba(47, 91, 75, 0.12);
  border-radius: 13px;
  background: var(--green-soft);
}

.ai-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.ai-badge {
  color: var(--green-deep);
  font-size: 10px;
  font-weight: 600;
}

.ai-result {
  margin-top: 12px;
  padding: 15px;
  border-left: 3px solid var(--green);
  border-radius: 4px 12px 12px 4px;
  color: var(--muted);
  background: var(--bg);
  font-size: 10px;
  line-height: 1.8;
}

.ai-result strong {
  color: var(--ink);
}

.ai-source {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 7px;
  border-radius: 20px;
  color: var(--green-deep);
  background: var(--green-soft);
  font-size: 8px;
}

.todo-preview-card {
  grid-column: 1 / -1;
  min-height: 0 !important;
}

.dashboard-todo-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 16px;
}

.dashboard-todo-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--paper-deep);
}

.dashboard-todo-item strong,
.dashboard-todo-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-todo-item strong {
  font-size: 11px;
}

.dashboard-todo-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.todo-preview-actions,
.ai-composer-heading,
.ai-composer-footer,
.settings-section-heading,
.ai-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.todo-all-done {
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 13px;
  color: var(--green);
  background: var(--green-soft);
  font-family: var(--serif);
  font-size: 12px;
  text-align: center;
}

.ai-todo-composer {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 25px;
  background:
    radial-gradient(circle at 90% 0, rgba(107, 142, 207, 0.16), transparent 34%),
    var(--paper);
}

.ai-todo-composer::after {
  position: absolute;
  right: -25px;
  bottom: -45px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(107, 142, 207, 0.14);
  border-radius: 50%;
  content: "";
}

.ai-composer-heading > div,
.settings-section-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-orb {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, var(--blue), var(--green));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 20px rgba(73, 104, 151, 0.2);
}

.ai-composer-heading small,
.ai-composer-heading h3,
.settings-section-heading small,
.settings-section-heading h3 {
  display: block;
  margin: 0;
}

.ai-composer-heading small,
.settings-section-heading small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
}

.ai-composer-heading h3,
.settings-section-heading h3 {
  font-family: var(--serif);
  font-size: 16px;
}

.ai-todo-composer textarea {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 116px;
  margin: 20px 0 14px;
  padding: 16px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-size: 12px;
  line-height: 1.8;
}

.ai-todo-composer textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(85, 126, 103, 0.08);
}

.ai-composer-footer {
  position: relative;
  z-index: 1;
}

.ai-connection-status {
  color: var(--muted);
  font-size: 9px;
}

.ai-connection-status.connected {
  color: var(--green);
}

.todo-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px 16px;
}

.todo-date-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.todo-date-control input {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper-deep);
  font: inherit;
  font-size: 10px;
}

.compact-button {
  padding: 9px 12px;
}

.todo-toolbar .filter-pills {
  justify-content: center;
}

.todo-summary {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.todo-list {
  display: grid;
  gap: 10px;
}

.todo-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--sage);
  border-radius: 15px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

.todo-item:hover {
  transform: translateY(-1px);
}

.todo-item[data-priority="high"] {
  border-left-color: var(--coral);
}

.todo-item[data-priority="low"] {
  border-left-color: var(--blue);
}

.todo-item.completed {
  opacity: 0.63;
}

.todo-item.completed h3 {
  text-decoration: line-through;
}

.todo-check {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  flex: 0 0 auto;
  border: 1.5px solid var(--sage);
  border-radius: 8px;
  color: #fff;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.todo-item.completed .todo-check {
  background: var(--green);
}

.todo-content {
  min-width: 0;
}

.todo-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.todo-title-line h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.priority-chip {
  padding: 3px 7px;
  border-radius: 20px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 8px;
}

.priority-chip.high {
  color: var(--coral);
  background: var(--coral-soft);
}

.priority-chip.low {
  color: var(--blue);
  background: var(--blue-soft);
}

.todo-content p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.todo-meta span {
  padding: 4px 7px;
  border-radius: 7px;
  color: var(--muted);
  background: var(--paper-deep);
  font-size: 8px;
}

.todo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.settings-section-heading {
  margin-bottom: 16px;
}

.connection-badge {
  padding: 5px 9px;
  border-radius: 20px;
  color: var(--muted);
  background: var(--paper-deep);
  font-size: 9px;
}

.connection-badge.connected {
  color: var(--green);
  background: var(--green-soft);
}

.secret-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.field-help {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.5;
}

.ai-settings-actions {
  margin-top: 14px;
}

.cloud-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cloud-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.cloud-status-hint {
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--paper-deep);
}

.cloud-status-hint.success {
  color: var(--green);
  background: var(--green-soft);
}

.cloud-status-hint.error {
  color: var(--coral);
  background: var(--coral-soft);
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 500;
  max-width: 330px;
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  background: var(--green-deep);
  box-shadow: 0 15px 40px rgba(15, 40, 31, 0.25);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.image-viewer {
  width: min(1120px, calc(100vw - 40px));
  max-width: none;
  height: min(88vh, 900px);
  padding: 18px;
  border: 0;
  border-radius: 18px;
  background: rgba(20, 25, 22, 0.96);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.4);
}

.image-viewer::backdrop {
  background: rgba(10, 14, 12, 0.72);
  backdrop-filter: blur(5px);
}

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

.image-viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  font-size: 22px;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .sidebar {
    width: 210px;
  }

  .main-content {
    margin-left: 210px;
    padding-right: 3.5vw;
    padding-left: 3.5vw;
  }

  .overview-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .sparkline-wrap {
    grid-column: 1 / -1;
  }

  .masonry-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    z-index: 30;
    width: auto;
    height: calc(76px + env(safe-area-inset-bottom, 0px));
    padding: 8px 9px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand,
  .sidebar-bottom {
    display: none;
  }

  .main-nav {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }

  .nav-item {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 6px 3px;
    text-align: center;
  }

  .nav-icon {
    font-size: 18px;
  }

  .nav-item > span:nth-child(2) {
    font-size: 10px;
    line-height: 1.15;
  }

  .nav-count {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 24px 20px calc(112px + env(safe-area-inset-bottom, 0px));
  }

  .countdown-hero {
    grid-template-columns: 1fr;
  }

  .countdown-copy {
    min-height: 420px;
    padding: 34px;
  }

  .countdown-visual {
    position: absolute;
    inset: 0 0 0 45%;
    opacity: 0.8;
  }

  .dashboard-grid,
  .timer-layout,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .todo-toolbar {
    grid-template-columns: 1fr;
  }

  .todo-toolbar .filter-pills {
    justify-content: flex-start;
  }

  .todo-summary {
    justify-self: start;
  }

  .chart-wide {
    grid-column: auto;
  }

  .mistake-item {
    grid-template-columns: 90px 1fr;
  }

  .mistake-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
    line-height: 1.55;
  }

  .auth-gate {
    padding: 18px;
  }

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

  .auth-brand h1 {
    font-size: 22px;
  }

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

  .main-content {
    min-height: 100dvh;
    padding: 18px 14px calc(118px + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
  }

  .eyebrow {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .topbar h1 {
    font-size: 25px;
    line-height: 1.25;
  }

  .topbar-actions {
    width: 100%;
    gap: 8px;
  }

  .topbar-actions .icon-button {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }

  .topbar-actions .primary-button {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    font-size: 13px;
  }

  .topbar-actions .primary-button span {
    margin-right: 4px;
    font-size: 17px;
  }

  .countdown-copy {
    min-height: 335px;
    padding: 28px 23px;
  }

  .countdown-visual {
    left: 34%;
    opacity: 0.28;
  }

  .countdown-number strong {
    font-size: 72px;
    line-height: 0.95;
  }

  .target-exam-name {
    max-width: 100%;
    font-size: 23px;
    line-height: 1.25;
  }

  .countdown-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .mock-target {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid .card,
  .chart-card,
  .todo-card,
  .mistake-item,
  .insight-card {
    padding: 18px;
    border-radius: 18px;
  }

  .card-heading small,
  .chart-title small,
  .summary-tile span,
  .todo-summary,
  .ai-connection-status {
    font-size: 11px;
  }

  .card-heading h3,
  .chart-title h3,
  .section-heading h2 {
    font-size: 19px;
  }

  .dashboard-todo-list {
    grid-template-columns: 1fr;
  }

  .ai-composer-heading,
  .ai-composer-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .ai-composer-footer .primary-button {
    width: 100%;
  }

  .todo-item {
    grid-template-columns: 32px 1fr;
    gap: 12px;
    padding: 16px;
  }

  .todo-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 44px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin: 30px 0 14px;
  }

  .section-heading p {
    display: block;
    font-size: 12px;
  }

  .overview-strip {
    grid-template-columns: 1fr 1fr;
  }

  .overview-stat:nth-child(3) {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .page-intro {
    display: block;
    padding: 18px;
  }

  .page-intro button {
    margin-top: 18px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar button,
  .filter-pills button,
  .compact-button,
  .primary-button,
  .secondary-button,
  .ghost-button {
    min-height: 42px;
    font-size: 13px;
  }

  .search-box {
    min-width: 0;
  }

  .search-box input,
  .auth-card input,
  .todo-date-control input,
  .ai-todo-composer textarea,
  .session-subject input,
  .session-binding input,
  .session-binding select,
  .select-control,
  .modal input,
  .modal select,
  .modal textarea {
    font-size: 16px;
  }

  .masonry-list {
    grid-template-columns: 1fr;
  }

  .mistake-summary {
    grid-template-columns: 1fr;
  }

  .mistake-item {
    grid-template-columns: 1fr;
  }

  .mistake-module {
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .timer-main-card {
    min-height: auto;
    padding: 20px 14px 26px;
  }

  .focus-duration-picker {
    align-items: flex-start;
    flex-direction: column;
  }

  .focus-duration-picker > div {
    justify-content: flex-start;
  }

  .focus-journey {
    height: 285px;
    border-radius: 17px;
  }

  .journey-hud {
    top: 12px;
    left: 12px;
    padding: 10px 12px;
  }

  .journey-hud strong {
    font-size: 25px;
  }

  .journey-next-gift {
    right: 10px;
    bottom: 10px;
  }

  .mode-switch button {
    padding: 8px 9px;
    font-size: 9px;
  }

  .timer-circle {
    width: min(238px, 78vw);
    height: min(238px, 78vw);
  }

  .timer-circle::before {
    width: calc(min(238px, 78vw) - 28px);
    height: calc(min(238px, 78vw) - 28px);
  }

  .timer-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .timer-controls button {
    flex: 1;
    padding: 10px;
    font-size: 9px;
  }

  .donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .donut-legend {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
  }

  .modal form {
    max-height: calc(100dvh - 18px);
    overflow: auto;
    padding: 22px;
  }

  .modal-actions {
    position: sticky;
    bottom: -22px;
    margin-right: -22px;
    margin-bottom: -22px;
    margin-left: -22px;
    padding: 12px 22px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--paper);
  }

  .image-preview {
    grid-template-columns: 90px 1fr;
  }

  .image-preview img {
    width: 90px;
    height: 76px;
  }

  .image-preview .ghost-button {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-cloud,
  .focus-journey.walking .walker-body,
  .focus-journey.walking .walker-leg,
  .focus-journey.walking .walker-arm {
    animation: none;
  }
}

/* 航行日记 */
.focus-journey {
  background:
    linear-gradient(180deg, #dfe9e8 0%, #edf0eb 42%, #b5c9c7 43%, #6f9597 100%);
  border-color: rgba(43, 75, 76, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 18px 42px rgba(32, 65, 65, 0.12);
}

.journey-sun {
  top: 36px;
  right: 82px;
  width: 43px;
  height: 43px;
  background: #e7c984;
  box-shadow: 0 0 45px rgba(231, 201, 132, 0.42);
}

.journey-cloud {
  height: 13px;
  background: rgba(255, 255, 255, 0.44);
  box-shadow:
    17px -7px 0 1px rgba(255, 255, 255, 0.44),
    38px 1px 0 -3px rgba(255, 255, 255, 0.44);
  animation-play-state: paused;
}

.focus-journey.sailing .journey-cloud {
  animation-play-state: running;
}

.journey-bird {
  width: 19px;
  height: 8px;
  font-size: 0;
}

.journey-bird::before,
.journey-bird::after {
  position: absolute;
  top: 4px;
  width: 11px;
  height: 5px;
  border-top: 1.5px solid rgba(47, 76, 73, 0.42);
  content: "";
}

.journey-bird::before {
  left: 0;
  transform: rotate(17deg);
  border-radius: 100% 0 0;
}

.journey-bird::after {
  right: 0;
  transform: rotate(-17deg);
  border-radius: 0 100% 0 0;
}

.sea-horizon {
  position: absolute;
  z-index: 1;
  top: 43%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(69, 105, 103, 0.18);
}

.distant-coast {
  position: absolute;
  z-index: 2;
  top: 32%;
  height: 13%;
  background: rgba(79, 108, 97, 0.32);
  filter: blur(0.3px);
}

.coast-left {
  left: -3%;
  width: 42%;
  clip-path: polygon(0 65%, 14% 46%, 29% 58%, 47% 28%, 66% 59%, 83% 38%, 100% 72%, 100% 100%, 0 100%);
}

.coast-right {
  right: -3%;
  width: 34%;
  clip-path: polygon(0 70%, 18% 48%, 37% 60%, 61% 22%, 79% 54%, 100% 39%, 100% 100%, 0 100%);
}

.sea-layer {
  position: absolute;
  right: -12%;
  left: -12%;
  z-index: 3;
  border-radius: 48% 48% 0 0;
  background-repeat: repeat-x;
  animation: seaDrift 8s linear infinite;
  animation-play-state: paused;
}

.focus-journey.sailing .sea-layer {
  animation-play-state: running;
}

.sea-back {
  top: 43%;
  bottom: -8%;
  background:
    radial-gradient(ellipse at 50% 0, rgba(255, 255, 255, 0.2) 0 1px, transparent 2px 100%),
    linear-gradient(180deg, rgba(126, 164, 164, 0.85), #628c8f);
  background-size: 80px 21px, auto;
  opacity: 0.8;
  animation-duration: 13s;
}

.sea-middle {
  top: 55%;
  bottom: -12%;
  background:
    radial-gradient(ellipse at 50% 0, rgba(232, 241, 236, 0.26) 0 1.5px, transparent 2.4px 100%),
    linear-gradient(180deg, rgba(90, 139, 142, 0.3), rgba(52, 104, 111, 0.72));
  background-size: 105px 27px, auto;
  animation-direction: reverse;
  animation-duration: 10s;
}

.sea-front {
  top: 69%;
  bottom: -17%;
  background:
    radial-gradient(ellipse at 50% 0, rgba(244, 246, 237, 0.25) 0 1px, transparent 2px 100%),
    linear-gradient(180deg, rgba(60, 112, 119, 0.24), #3c727c);
  background-size: 135px 32px, auto;
  animation-duration: 7s;
}

.sailing-route {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sailing-route path {
  fill: none;
  stroke: rgba(239, 235, 210, 0.42);
  stroke-width: 2;
  stroke-dasharray: 2 9;
  stroke-linecap: round;
}

.lighthouse {
  position: absolute;
  z-index: 4;
  top: 30%;
  right: 7%;
  width: 36px;
  height: 92px;
  transform: scale(0.72);
  transform-origin: bottom center;
}

.lighthouse-tower {
  position: absolute;
  right: 9px;
  bottom: 0;
  width: 18px;
  height: 59px;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background: repeating-linear-gradient(180deg, #e8e3d5 0 12px, #af6f62 12px 20px);
}

.lighthouse-roof {
  position: absolute;
  top: 19px;
  left: 7px;
  width: 22px;
  height: 9px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #385952;
}

.lighthouse-light {
  position: absolute;
  top: 28px;
  left: 11px;
  z-index: 2;
  width: 14px;
  height: 10px;
  border-radius: 3px;
  background: #f1d889;
  box-shadow: 0 0 13px rgba(241, 216, 137, 0.75);
}

.lighthouse-beam {
  position: absolute;
  top: 24px;
  right: 18px;
  width: 115px;
  height: 27px;
  transform: rotate(-8deg);
  transform-origin: right center;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  background: linear-gradient(90deg, transparent, rgba(244, 222, 155, 0.28));
  opacity: 0.45;
}

.focus-journey.sailing .lighthouse-beam {
  animation: lighthouseSweep 4.8s ease-in-out infinite;
}

.whale-tail {
  position: absolute;
  z-index: 5;
  right: 28%;
  bottom: 30%;
  width: 34px;
  height: 28px;
  opacity: 0;
  transform: scale(0.7);
}

.whale-tail i,
.whale-tail b {
  position: absolute;
  top: 0;
  width: 22px;
  height: 15px;
  background: #385f67;
}

.whale-tail i {
  left: 0;
  transform: rotate(22deg);
  border-radius: 100% 18% 100% 12%;
}

.whale-tail b {
  right: 0;
  transform: rotate(-22deg);
  border-radius: 18% 100% 12% 100%;
}

.whale-tail::after {
  position: absolute;
  left: 15px;
  top: 10px;
  width: 5px;
  height: 18px;
  border-radius: 0 0 5px 5px;
  content: "";
  background: #385f67;
}

.focus-journey.sailing .whale-tail {
  animation: whaleBreath 6s ease-in-out infinite;
}

.journey-boat {
  position: absolute;
  z-index: 10;
  left: 5%;
  bottom: 13%;
  width: 72px;
  height: 76px;
  --boat-scale: 1;
  transform: translate(-50%, 30%) scale(var(--boat-scale));
  transform-origin: center bottom;
  transition: left 0.9s linear, bottom 0.9s linear, transform 0.9s linear;
}

.focus-journey.sailing .journey-boat {
  animation: boatFloat 2.5s ease-in-out infinite;
}

.boat-mast {
  position: absolute;
  z-index: 3;
  top: 3px;
  left: 35px;
  width: 2px;
  height: 54px;
  border-radius: 2px;
  background: #5e4f3e;
}

.boat-sail {
  position: absolute;
  z-index: 2;
  filter: drop-shadow(0 4px 4px rgba(32, 61, 61, 0.08));
}

.sail-main {
  top: 6px;
  left: 37px;
  width: 27px;
  height: 40px;
  clip-path: polygon(0 0, 100% 92%, 0 100%);
  background: linear-gradient(145deg, #f0e8d4, #d8cba9);
}

.sail-small {
  top: 13px;
  left: 12px;
  width: 21px;
  height: 31px;
  clip-path: polygon(100% 0, 100% 100%, 0 82%);
  background: #bd7464;
}

.boat-flag {
  position: absolute;
  top: 2px;
  left: 37px;
  width: 13px;
  height: 7px;
  clip-path: polygon(0 0, 100% 45%, 0 100%);
  background: #547b70;
}

.boat-hull {
  position: absolute;
  z-index: 4;
  left: 7px;
  bottom: 11px;
  width: 59px;
  height: 17px;
  clip-path: polygon(0 0, 100% 0, 83% 100%, 18% 100%);
  background: linear-gradient(180deg, #8a5c48, #4d4138);
  box-shadow: inset 0 4px 0 rgba(237, 220, 184, 0.62);
}

.boat-wake {
  position: absolute;
  left: -14px;
  bottom: 4px;
  width: 78px;
  height: 14px;
  border-top: 2px solid rgba(241, 245, 236, 0.58);
  border-radius: 50%;
  opacity: 0.65;
}

.focus-journey:not(.sailing) .boat-wake {
  opacity: 0.18;
}

.journey-milestone {
  z-index: 8;
}

.journey-milestone i {
  width: 27px;
  height: 27px;
  border: 1px solid rgba(240, 241, 225, 0.62);
  border-radius: 50%;
  color: #345b59;
  background: rgba(231, 238, 228, 0.82);
  box-shadow: 0 5px 18px rgba(31, 64, 65, 0.13);
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 600;
}

.journey-milestone span {
  color: rgba(35, 73, 72, 0.68);
  background: rgba(238, 242, 231, 0.72);
}

.journey-milestone.reached i {
  color: #fffdf1;
  background: #b36f5f;
  box-shadow: 0 0 0 5px rgba(179, 111, 95, 0.16), 0 5px 18px rgba(31, 64, 65, 0.16);
}

.journey-milestone.target:not(.reached) i {
  border-style: dashed;
  border-color: rgba(179, 111, 95, 0.55);
}

.journey-hud {
  color: #244b49;
  background: rgba(239, 242, 232, 0.7);
}

.journey-hud span,
.journey-hud small,
.journey-next-gift {
  color: rgba(36, 75, 73, 0.68);
}

.journey-next-gift {
  background: rgba(235, 240, 229, 0.74);
}

.journey-reward-popover {
  color: #264b49;
  background: rgba(239, 242, 228, 0.95);
  box-shadow: 0 22px 60px rgba(27, 57, 58, 0.25);
}

.journey-reward-popover > span {
  color: #fffdf3;
  background: #b36f5f;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.journey-reward-popover.opening > span {
  animation: blindBoxBob 0.75s ease-in-out infinite;
}

.journey-reward-popover.opening {
  background: rgba(232, 239, 229, 0.96);
}

.journey-reward-item > i {
  color: #355f5e;
  background: var(--blue-soft);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 600;
}

.journey-gift-count,
.journey-reward-item > span:last-child {
  color: var(--blue);
}

.journey-gift-count {
  background: var(--blue-soft);
}

.journey-log-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.journey-log-actions .text-button {
  font-size: 8px;
}

.journey-reward-item em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 7px;
  font-style: normal;
  opacity: 0.72;
}

.future-message-intro {
  margin: 0 0 18px;
  padding: 13px 15px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--blue-soft);
  font-size: 9px;
  line-height: 1.7;
}

.future-message-grid {
  display: grid;
  gap: 11px;
}

.future-message-grid label {
  display: grid;
  grid-template-columns: 145px 1fr;
  align-items: center;
  gap: 12px;
}

.future-message-grid label > span {
  color: var(--muted);
  font-size: 9px;
}

.future-message-grid label > span b {
  color: var(--ink);
  font-size: 10px;
}

.future-message-grid textarea {
  min-height: 58px;
  resize: vertical;
}

@keyframes seaDrift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 180px 0, 0 0;
  }
}

@keyframes boatFloat {
  0%,
  100% {
    transform: translate(-50%, 30%) scale(var(--boat-scale)) rotate(-1deg);
  }
  50% {
    transform: translate(-50%, 25%) scale(var(--boat-scale)) rotate(1.2deg);
  }
}

@keyframes lighthouseSweep {
  0%,
  100% {
    transform: rotate(-13deg);
    opacity: 0.2;
  }
  50% {
    transform: rotate(8deg);
    opacity: 0.55;
  }
}

@keyframes whaleBreath {
  0%,
  75%,
  100% {
    transform: translateY(9px) scale(0.66);
    opacity: 0;
  }
  84% {
    transform: translateY(0) scale(0.72);
    opacity: 0.52;
  }
  92% {
    transform: translateY(4px) scale(0.68);
    opacity: 0.3;
  }
}

@keyframes blindBoxBob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-5px) rotate(2deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .focus-journey.sailing .journey-boat,
  .focus-journey.sailing .sea-layer,
  .focus-journey.sailing .lighthouse-beam,
  .focus-journey.sailing .whale-tail {
    animation: none;
  }
}

@media (max-width: 600px) {
  .category-add-card,
  .category-manager-row {
    grid-template-columns: 1fr;
  }

  .category-usage {
    text-align: left;
  }

  .future-message-grid label {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .session-binding {
    grid-template-columns: 1fr;
  }

  .todo-focus-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .todo-focus-summary b {
    margin-left: 0;
  }

  .todo-focus-row {
    grid-template-columns: 1fr 42px;
  }

  .todo-focus-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
