/* ==========================================================================
   小满自习室 · warm, quiet, made for two
   ========================================================================== */

:root {
  --paper: #f7efe3;
  --paper-deep: #efe2d1;
  --paper-warm: #fbf5ea;
  --card: #fffaf2;
  --card-solid: #fffdf8;
  --ink: #3d3128;
  --ink-soft: #746456;
  --ink-faint: #a3917f;
  --line: rgba(92, 72, 52, 0.14);
  --line-strong: rgba(92, 72, 52, 0.24);
  --coral: #d57554;
  --coral-deep: #b75a3c;
  --coral-soft: #f4d3c1;
  --peach: #f2c7a8;
  --sage: #8b9a78;
  --sage-deep: #657455;
  --sage-soft: #dfe5d5;
  --rose: #dcb0b1;
  --rose-soft: #f3dddd;
  --gold: #d2a046;
  --gold-soft: #f2e3bd;
  --cocoa: #5b4538;
  --shadow-sm: 0 2px 8px rgba(77, 55, 36, 0.05);
  --shadow-md: 0 14px 40px -18px rgba(77, 55, 36, 0.28);
  --shadow-lg: 0 30px 70px -30px rgba(77, 55, 36, 0.35);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --hand: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --sidebar: 252px;
  --ease: cubic-bezier(0.22, 0.68, 0.27, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 86% -12%, rgba(242, 199, 168, 0.5), transparent 64%),
    radial-gradient(900px 650px at -10% 30%, rgba(223, 229, 213, 0.55), transparent 62%),
    var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

::selection {
  color: var(--ink);
  background: var(--peach);
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: none;
}

.grain {
  position: fixed;
  z-index: 900;
  inset: 0;
  pointer-events: none;
  opacity: 0.38;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='.045'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Type & common bits
   -------------------------------------------------------------------------- */

.serif {
  font-family: var(--serif);
}

.hand {
  font-family: var(--hand);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--coral-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.19em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow-line {
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

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

.faint {
  color: var(--ink-faint);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.18s var(--ease), background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

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

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn--primary {
  background: var(--coral);
  color: #fff9ef;
  box-shadow: 0 8px 20px -10px rgba(183, 90, 60, 0.7);
}

.btn--primary:hover {
  background: var(--coral-deep);
}

.btn--dark {
  background: var(--ink);
  color: var(--paper-warm);
}

.btn--soft {
  background: rgba(255, 250, 242, 0.82);
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn--soft:hover {
  border-color: var(--line-strong);
  background: var(--card);
}

.btn--ghost {
  padding-inline: 10px;
  color: var(--ink-soft);
}

.btn--ghost:hover {
  background: rgba(92, 72, 52, 0.06);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 34px;
  padding: 7px 13px;
  font-size: 12.5px;
}

.btn[disabled] {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 250, 242, 0.74);
  color: var(--ink-soft);
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}

.icon-btn:hover {
  background: var(--card);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn--bare {
  width: 32px;
  height: 32px;
  border-color: transparent;
  background: transparent;
}

.icon-btn--danger:hover {
  color: #a34532;
  background: #f8e5dc;
  border-color: #ecc7b9;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--peach);
  color: var(--coral-deep);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(183, 90, 60, 0.18);
}

.avatar--sage {
  background: var(--sage-soft);
  color: var(--sage-deep);
  border-color: rgba(101, 116, 85, 0.2);
}

.avatar--rose {
  background: var(--rose-soft);
  color: #9b6062;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(139, 154, 120, 0.14);
  color: var(--sage-deep);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tag::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.tag[data-subject="听力"],
.tag[data-subject="写作"] {
  background: rgba(213, 117, 84, 0.12);
  color: var(--coral-deep);
}

.tag[data-subject="阅读"],
.tag[data-subject="真题"] {
  background: rgba(210, 160, 70, 0.16);
  color: #8e6a27;
}

.tag[data-subject="翻译"] {
  background: rgba(109, 135, 148, 0.14);
  color: #5c7581;
}

.tag[data-subject="其他"] {
  background: rgba(116, 100, 86, 0.1);
  color: var(--ink-soft);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.6);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: 0.18s;
}

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

.chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-warm);
}

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

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

/* --------------------------------------------------------------------------
   Boot
   -------------------------------------------------------------------------- */

.boot-screen {
  position: fixed;
  z-index: 9500;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background:
    radial-gradient(600px 400px at 50% 40%, rgba(242, 199, 168, 0.5), transparent 70%),
    var(--paper);
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.14em;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.boot-screen.is-gone {
  visibility: hidden;
  opacity: 0;
}

.boot-mark {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  animation: bootFloat 2.4s ease-in-out infinite;
}

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

/* --------------------------------------------------------------------------
   Brand
   -------------------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  box-shadow: 0 6px 16px -8px rgba(77, 55, 36, 0.35);
}

.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.brand span {
  display: block;
  margin-top: 1px;
  color: var(--ink-faint);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Auth
   -------------------------------------------------------------------------- */

.auth-screen {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(900px 650px at 10% 8%, rgba(247, 222, 195, 0.75), transparent 60%),
    radial-gradient(800px 720px at 94% 86%, rgba(213, 223, 201, 0.62), transparent 58%),
    linear-gradient(135deg, #f9f1e6 0%, #f5e9d9 55%, #f8f0e4 100%);
}

.auth-halo {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.auth-halo--one {
  top: -130px;
  right: -90px;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(213, 117, 84, 0.15);
  box-shadow: inset 0 0 0 70px rgba(255, 250, 242, 0.2), inset 0 0 0 71px rgba(213, 117, 84, 0.08);
}

.auth-halo--two {
  bottom: -180px;
  left: 22%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(242, 199, 168, 0.32), transparent 68%);
}

.auth-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.72fr);
  align-items: center;
  gap: clamp(40px, 6vw, 100px);
  width: min(1240px, calc(100% - 80px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 54px 0;
}

.auth-story {
  position: relative;
  padding: 6px 0 10px;
}

.brand--auth {
  margin-bottom: clamp(34px, 5vh, 58px);
}

.brand--auth .brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 15px;
}

.brand--auth strong {
  font-size: 19px;
}

.auth-story h1 {
  max-width: 650px;
  margin: 14px 0 18px;
  font-family: var(--serif);
  font-size: clamp(38px, 4.4vw, 60px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.28;
}

.auth-story h1 em {
  position: relative;
  color: var(--coral-deep);
  font-style: normal;
  white-space: nowrap;
}

.auth-story h1 em::after {
  position: absolute;
  right: 2px;
  bottom: -6px;
  left: 2px;
  height: 8px;
  border-radius: 50%;
  background: rgba(213, 117, 84, 0.14);
  content: "";
  transform: rotate(-1deg);
}

.auth-lede {
  max-width: 490px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.95;
}

.auth-memories {
  position: relative;
  width: min(560px, 92%);
  height: clamp(270px, 32vh, 330px);
  margin: clamp(30px, 4.6vh, 46px) 0 0 8px;
}

.memory-polaroid {
  position: absolute;
  width: clamp(148px, 15vw, 186px);
  padding: 8px 8px 0;
  border-radius: 2px;
  background: #fffaf0;
  box-shadow: 0 18px 36px -20px rgba(77, 55, 36, 0.5), 0 2px 6px rgba(77, 55, 36, 0.06);
  transition: transform 0.45s var(--ease), box-shadow 0.45s;
}

.memory-polaroid img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(0.92) contrast(0.97);
}

.memory-polaroid figcaption {
  padding: 9px 2px 10px;
  color: var(--ink-soft);
  font-family: var(--hand);
  font-size: 12.5px;
  text-align: center;
  letter-spacing: 0.04em;
}

.memory-polaroid--left {
  top: 25px;
  left: 1%;
  transform: rotate(-6deg);
}

.memory-polaroid--center {
  z-index: 2;
  top: 0;
  left: 34%;
  transform: rotate(2.2deg);
}

.memory-polaroid--right {
  top: 33px;
  left: 66%;
  transform: rotate(7deg);
}

.auth-memories:hover .memory-polaroid--left {
  transform: rotate(-8deg) translateY(-4px);
}

.auth-memories:hover .memory-polaroid--center {
  transform: rotate(0.5deg) translateY(-6px);
}

.auth-memories:hover .memory-polaroid--right {
  transform: rotate(9deg) translateY(-2px);
}

.memory-tape {
  position: absolute;
  z-index: 4;
  width: 48px;
  height: 16px;
  background: rgba(226, 199, 152, 0.64);
  box-shadow: 0 1px 2px rgba(77, 55, 36, 0.06);
}

.memory-tape--one {
  top: -8px;
  left: 43%;
  transform: rotate(-3deg);
}

.memory-tape--two {
  top: 23px;
  right: 10%;
  transform: rotate(38deg);
}

.memory-note {
  position: absolute;
  z-index: 5;
  right: -18px;
  bottom: -34px;
  max-width: 130px;
  padding: 10px 12px;
  color: #7b5b38;
  background: #f6e5bb;
  font-family: var(--hand);
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
  transform: rotate(-2deg);
  box-shadow: 0 10px 24px -16px rgba(77, 55, 36, 0.5);
}

.memory-note::before {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 38px;
  height: 12px;
  background: rgba(255, 250, 242, 0.65);
  content: "";
  transform: translateX(-50%) rotate(2deg);
}

.auth-quote {
  margin-top: clamp(24px, 3.5vh, 40px);
  padding-left: 17px;
  border-left: 1px solid rgba(183, 90, 60, 0.3);
  color: var(--ink-faint);
  font-family: var(--hand);
  font-size: 14px;
  line-height: 1.8;
}

.auth-quote-tail {
  margin-top: 6px;
  padding-left: 17px;
  color: var(--ink-faint);
  font-family: var(--hand);
  font-size: 12px;
  line-height: 1.7;
  opacity: 0.8;
}

.auth-panel {
  width: 100%;
}

.auth-card {
  position: relative;
  padding: clamp(28px, 3.3vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  background: rgba(255, 251, 244, 0.8);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.auth-card::before {
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(183, 90, 60, 0.15);
  border-radius: 23px;
  pointer-events: none;
  content: "";
}

.auth-card-head {
  position: relative;
  margin-bottom: 25px;
}

.auth-card-head h2 {
  margin: 8px 0 7px;
  font-family: var(--serif);
  font-size: clamp(25px, 2.3vw, 31px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.auth-card-head > p:last-child {
  color: var(--ink-soft);
  font-size: 13px;
}

.auth-form {
  position: relative;
}

.auth-loading {
  display: flex;
  gap: 7px;
  padding: 28px 0;
}

.auth-loading span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  animation: loadingPulse 1.1s infinite ease-in-out;
}

.auth-loading span:nth-child(2) { animation-delay: 0.15s; }
.auth-loading span:nth-child(3) { animation-delay: 0.3s; }

@keyframes loadingPulse {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

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

.field > span,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.field-label small {
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 45px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.76);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--line-strong);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: rgba(213, 117, 84, 0.62);
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgba(213, 117, 84, 0.1);
}

.input::placeholder,
.textarea::placeholder {
  color: #b6a592;
}

.textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.7;
}

.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%23746456' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.field-row--three {
  grid-template-columns: 1.2fr 1fr 0.9fr;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 11px;
}

.member-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 15px;
}

.member-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.65);
  color: var(--ink-soft);
  text-align: left;
  transition: 0.18s;
}

.member-choice:hover {
  border-color: var(--line-strong);
}

.member-choice.is-active {
  border-color: rgba(213, 117, 84, 0.55);
  background: rgba(244, 211, 193, 0.34);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(213, 117, 84, 0.16);
}

.member-choice .avatar {
  width: 31px;
  height: 31px;
  font-size: 12px;
}

.member-choice > span:not(.avatar) strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.member-choice > span:not(.avatar) > span {
  display: block;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.4;
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 3px 0 19px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
  cursor: pointer;
}

.check-line input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--coral);
}

.auth-submit {
  min-height: 48px;
  margin-top: 2px;
  border-radius: 14px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.auth-error {
  margin: 0 0 13px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #f9e4da;
  color: #9f432e;
  font-size: 12px;
  line-height: 1.6;
}

.auth-error--info {
  background: rgba(242, 227, 189, 0.48);
  color: #7c5c37;
}

.auth-switch {
  margin-top: 16px;
  color: var(--ink-faint);
  font-size: 11.5px;
  text-align: center;
  line-height: 1.7;
}

.auth-foot {
  margin-top: 18px;
  color: var(--ink-faint);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-align: center;
}

.auth-locked {
  padding: 8px 0 4px;
}

.auth-locked-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border: 1px solid rgba(183, 90, 60, 0.24);
  border-radius: 50%;
  background: rgba(244, 211, 193, 0.28);
  color: var(--coral-deep);
  font-family: var(--serif);
  font-size: 20px;
}

.auth-locked h3 {
  margin-bottom: 7px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.auth-locked p {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.auth-locked strong {
  color: var(--coral-deep);
  font-weight: 600;
  word-break: break-all;
}

.auth-mailbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   App shell & sidebar
   -------------------------------------------------------------------------- */

.app-screen {
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  padding: 28px 20px 22px;
  border-right: 1px solid rgba(92, 72, 52, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.36), transparent 30%),
    linear-gradient(160deg, #f4e8d8, #f0e0cd 65%, #eedcc8);
}

.sidebar::after {
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(92, 72, 52, 0.08);
  border-radius: 22px;
  pointer-events: none;
  content: "";
}

.brand--side {
  position: relative;
  z-index: 1;
  padding: 0 6px;
}

.brand--side .brand-mark {
  width: 41px;
  height: 41px;
  border-radius: 12px;
}

.brand--side strong {
  max-width: 148px;
  overflow: hidden;
  font-size: 15.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand--side span {
  font-size: 9.5px;
}

.side-nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: clamp(30px, 5.5vh, 54px);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: left;
  text-decoration: none;
  transition: color 0.2s, background 0.2s, transform 0.2s;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 250, 242, 0.45);
  transform: translateX(2px);
}

.nav-item.is-active {
  color: var(--ink);
  background: rgba(255, 251, 244, 0.86);
  box-shadow: 0 8px 20px -16px rgba(77, 55, 36, 0.45);
  font-weight: 600;
}

.nav-item.is-active::before {
  position: absolute;
  top: 50%;
  left: -20px;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--coral);
  content: "";
  transform: translateY(-50%);
}

.nav-item svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.nav-item.is-active svg {
  stroke: var(--coral-deep);
  opacity: 1;
}

.nav-item .nav-count {
  min-width: 20px;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(213, 117, 84, 0.14);
  color: var(--coral-deep);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.side-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
}

.side-countdown {
  position: relative;
  padding: 15px 15px 14px;
  overflow: hidden;
  border-radius: 17px;
  background: linear-gradient(140deg, #675044, #8d604c);
  color: #fff6e6;
  box-shadow: 0 14px 30px -20px rgba(77, 55, 36, 0.6);
}

.side-countdown::after {
  position: absolute;
  top: -28px;
  right: -24px;
  width: 90px;
  height: 90px;
  border: 1px solid rgba(255, 246, 230, 0.22);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 16px rgba(255, 246, 230, 0.04), 0 0 0 32px rgba(255, 246, 230, 0.03);
}

.side-countdown p {
  color: rgba(255, 246, 230, 0.7);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
}

.side-countdown strong {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 2px;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
}

.side-countdown strong span {
  font-size: 30px;
  letter-spacing: -0.02em;
}

.side-countdown strong em {
  font-size: 11px;
  font-style: normal;
  opacity: 0.75;
}

.side-countdown small {
  display: block;
  color: rgba(255, 246, 230, 0.6);
  font-size: 9.5px;
  line-height: 1.6;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 14px;
  text-decoration: none;
  transition: background 0.18s;
}

.side-user:hover {
  background: rgba(255, 250, 242, 0.45);
}

.side-user .avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

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

.side-user-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-user-copy span {
  display: block;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 9.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-user .icon-btn {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
}

.side-user .icon-btn svg {
  width: 16px;
  height: 16px;
}

.app-shell {
  min-height: 100dvh;
  margin-left: var(--sidebar);
}

.main-content {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 40px clamp(28px, 4vw, 54px) 88px;
  animation: pageIn 0.55s var(--ease) both;
}

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

.mobile-header,
.mobile-nav {
  display: none;
}

/* --------------------------------------------------------------------------
   Page head
   -------------------------------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-head-copy {
  min-width: 0;
}

.page-head .eyebrow {
  margin-bottom: 7px;
}

.page-title {
  font-family: var(--serif);
  font-size: clamp(30px, 3.2vw, 41px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.page-title em {
  color: var(--coral-deep);
  font-style: normal;
}

.page-sub {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.head-actions .search-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.65);
  color: var(--ink-faint);
  font-size: 12px;
  transition: 0.18s;
}

.head-actions .search-pill:hover {
  border-color: var(--line-strong);
  background: var(--card);
}

.search-pill svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-pill kbd {
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9px;
}

.avatar-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--peach);
  color: var(--coral-deep);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  align-items: start;
  gap: 24px;
}

.dashboard-main,
.dashboard-rail {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  min-height: 260px;
  padding: clamp(25px, 3vw, 34px);
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(440px 300px at 88% 8%, rgba(255, 220, 170, 0.18), transparent 68%),
    linear-gradient(132deg, #5d473b 0%, #835846 48%, #a8674d 100%);
  color: #fff7e9;
  box-shadow: 0 26px 50px -30px rgba(77, 55, 36, 0.65);
}

.hero-card::before {
  position: absolute;
  top: -60px;
  right: 20%;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 247, 233, 0.1);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 42px rgba(255, 247, 233, 0.025);
}

.hero-card::after {
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 199, 168, 0.14), transparent 70%);
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  padding: 4px 11px 4px 8px;
  border: 1px solid rgba(255, 247, 233, 0.23);
  border-radius: 999px;
  background: rgba(255, 247, 233, 0.08);
  color: rgba(255, 247, 233, 0.82);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.hero-pill svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.hero-copy h2 {
  max-width: 430px;
  margin: 17px 0 8px;
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 35px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.34;
}

.hero-copy h2 em {
  color: #f5c9a5;
  font-style: normal;
}

.hero-copy > p {
  max-width: 390px;
  color: rgba(255, 247, 233, 0.68);
  font-size: 12.5px;
  line-height: 1.8;
}

.hero-foot {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: auto;
  padding-top: 22px;
}

.hero-progress {
  flex: 1;
  max-width: 300px;
}

.hero-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: rgba(255, 247, 233, 0.62);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.hero-progress-head strong {
  color: #fff7e9;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

.hero-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 247, 233, 0.14);
}

.hero-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f5c9a5, #fae4c7);
  transition: width 0.9s var(--ease);
}

.hero-count {
  position: relative;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  align-self: center;
  width: 156px;
  height: 156px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 247, 233, 0.24);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(255, 247, 233, 0.09), transparent 72%);
  box-shadow: inset 0 0 0 7px rgba(255, 247, 233, 0.035);
  text-align: center;
}

.hero-count::before {
  position: absolute;
  top: -9px;
  width: 52px;
  height: 18px;
  background: rgba(226, 199, 152, 0.5);
  content: "";
  transform: rotate(-4deg);
}

.hero-count-number {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #fff8eb;
  font-family: var(--serif);
  line-height: 1;
}

.hero-count-number strong {
  font-size: 58px;
  font-weight: 500;
  letter-spacing: -0.05em;
}

.hero-count-number span {
  font-size: 13px;
  opacity: 0.7;
}

.hero-count small {
  display: block;
  margin-top: 6px;
  color: rgba(255, 247, 233, 0.62);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  line-height: 1.6;
}

.hero-count .exam-date {
  margin-top: 3px;
  color: #f5c9a5;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.hero-deco {
  position: absolute;
  right: 181px;
  bottom: 17px;
  width: 95px;
  height: 95px;
  opacity: 0.34;
  pointer-events: none;
}

.hero-deco path,
.hero-deco circle,
.hero-deco line {
  fill: none;
  stroke: #f8ddbc;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.panel {
  position: relative;
  border: 1px solid rgba(92, 72, 52, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 251, 244, 0.78);
  box-shadow: var(--shadow-sm);
}

.panel-inner {
  padding: 23px 24px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.card-head h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.card-head h3 small {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.card-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tasks-panel .panel-inner {
  padding-bottom: 12px;
}

.task-list {
  display: flex;
  flex-direction: column;
}

.task-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 5px 13px 2px;
  border-top: 1px solid var(--line);
  transition: background 0.18s;
}

.task-row:first-child {
  border-top: 0;
}

.task-row:hover {
  background: rgba(255, 255, 255, 0.34);
}

.task-row.is-done {
  opacity: 0.66;
}

.task-check {
  position: relative;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 0;
  border: 1.5px solid rgba(116, 100, 86, 0.34);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  transition: 0.22s var(--ease);
}

.task-check:hover {
  border-color: var(--coral);
  background: rgba(213, 117, 84, 0.08);
  transform: scale(1.06);
}

.task-check svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-row.is-done .task-check {
  border-color: var(--sage);
  background: var(--sage);
  color: #fffaf2;
  animation: checkPop 0.35s var(--ease);
}

@keyframes checkPop {
  0% { transform: scale(0.82); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.task-main {
  min-width: 0;
  flex: 1;
}

.task-title {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
  transition: color 0.18s;
}

.task-title:hover {
  color: var(--coral-deep);
}

.task-row.is-done .task-title {
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-color: rgba(116, 100, 86, 0.45);
  text-decoration-thickness: 1px;
}

.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.5;
}

.task-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.task-meta .assignee {
  color: var(--sage-deep);
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.18s;
}

.task-row:hover .task-actions,
.task-row:focus-within .task-actions {
  opacity: 1;
}

.task-actions .icon-btn {
  width: 31px;
  height: 31px;
  border-color: transparent;
  background: transparent;
}

.task-actions .icon-btn:hover {
  background: rgba(92, 72, 52, 0.07);
}

.task-actions .icon-btn svg {
  width: 15px;
  height: 15px;
}

.task-actions .camera-hint {
  position: relative;
}

.task-row.is-done .task-actions {
  opacity: 1;
}

.task-note {
  display: none;
  margin-top: 6px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(242, 227, 189, 0.35);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.task-row:hover .task-note {
  display: block;
}

.tasks-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 25px 16px 30px;
  color: var(--ink-faint);
  text-align: center;
}

.tasks-empty-art {
  width: 92px;
  height: 70px;
  margin-bottom: 4px;
  color: var(--coral);
  opacity: 0.72;
}

.tasks-empty-art svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tasks-empty strong {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.tasks-empty p {
  max-width: 260px;
  font-size: 11.5px;
  line-height: 1.7;
}

.tasks-empty .btn {
  margin-top: 6px;
}

.task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 3px 5px;
  border-top: 1px dashed var(--line);
  color: var(--ink-faint);
  font-size: 10.5px;
}

.task-footer .hand {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.link-btn {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid rgba(183, 90, 60, 0.32);
  background: transparent;
  color: var(--coral-deep);
  font-size: 11px;
  line-height: 1.6;
}

.link-btn:hover {
  border-color: var(--coral-deep);
}

/* Today check-in */

.checkin-panel .panel-inner {
  padding-bottom: 20px;
}

.checkin-strip {
  display: flex;
  gap: 13px;
  overflow-x: auto;
  padding: 2px 2px 7px;
  scrollbar-width: thin;
}

.checkin-polaroid {
  position: relative;
  width: 178px;
  flex: 0 0 auto;
  padding: 7px 7px 0;
  border: 1px solid rgba(92, 72, 52, 0.07);
  border-radius: 3px;
  background: #fffaf0;
  box-shadow: 0 12px 24px -18px rgba(77, 55, 36, 0.55);
  transition: transform 0.28s var(--ease), box-shadow 0.28s;
}

.checkin-polaroid:nth-child(3n + 1) { transform: rotate(-1.4deg); }
.checkin-polaroid:nth-child(3n + 2) { transform: rotate(1deg); }
.checkin-polaroid:nth-child(3n) { transform: rotate(-0.4deg); }

.checkin-polaroid:hover {
  z-index: 2;
  box-shadow: 0 20px 34px -20px rgba(77, 55, 36, 0.6);
  transform: rotate(0) translateY(-3px);
}

.checkin-polaroid img {
  width: 100%;
  height: 142px;
  object-fit: cover;
  cursor: zoom-in;
}

.checkin-polaroid figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 3px 8px;
  color: var(--ink-soft);
  font-family: var(--hand);
  font-size: 11.5px;
  line-height: 1.5;
}

.checkin-polaroid figcaption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-polaroid .mood {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9px;
}

.checkin-add {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  width: 150px;
  min-height: 199px;
  flex: 0 0 auto;
  padding: 18px;
  border: 1.5px dashed rgba(183, 90, 60, 0.3);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.38);
  color: var(--coral-deep);
  text-align: center;
  transition: 0.2s;
}

.checkin-add:hover {
  border-color: var(--coral);
  background: rgba(244, 211, 193, 0.25);
  transform: translateY(-2px);
}

.checkin-add svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.checkin-add strong {
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 500;
}

.checkin-add span {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.6;
}

.checkin-empty {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 4px 3px 6px;
}

.checkin-empty-art {
  width: 118px;
  flex: 0 0 auto;
  padding: 7px 7px 0;
  border-radius: 2px;
  background: #fffaf0;
  box-shadow: 0 14px 28px -20px rgba(77, 55, 36, 0.6);
  transform: rotate(-3deg);
}

.checkin-empty-art img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  filter: saturate(0.85);
}

.checkin-empty-art figcaption {
  padding: 5px 2px 6px;
  color: var(--ink-faint);
  font-family: var(--hand);
  font-size: 10px;
  text-align: center;
}

.checkin-empty-copy {
  min-width: 0;
}

.checkin-empty-copy h4 {
  margin-bottom: 5px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}

.checkin-empty-copy p {
  max-width: 330px;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.75;
}

.checkin-empty-copy .btn {
  margin-top: 9px;
}

/* Memory strip */

.memory-panel .panel-inner {
  padding-bottom: 12px;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 2px 3px 8px;
}

.memory-card {
  position: relative;
  padding: 7px 7px 0;
  border: 0;
  border-radius: 2px;
  background: #fffaf0;
  color: var(--ink-soft);
  font: inherit;
  text-align: left;
  box-shadow: 0 14px 28px -22px rgba(77, 55, 36, 0.6);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}

.memory-card:nth-child(1) { transform: rotate(-1.6deg); }
.memory-card:nth-child(2) { transform: rotate(1.2deg) translateY(3px); }
.memory-card:nth-child(3) { transform: rotate(-0.7deg); }

.memory-card:hover {
  z-index: 2;
  box-shadow: 0 20px 34px -20px rgba(77, 55, 36, 0.6);
  transform: rotate(0) translateY(-3px);
}

.memory-card .tape {
  position: absolute;
  z-index: 2;
  top: -7px;
  left: 50%;
  width: 42px;
  height: 13px;
  background: rgba(226, 199, 152, 0.6);
  transform: translateX(-50%) rotate(-2deg);
}

.memory-card img {
  width: 100%;
  height: 162px;
  object-fit: cover;
  cursor: pointer;
  filter: saturate(0.93);
}

.memory-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 3px 8px;
  color: var(--ink-soft);
  font-family: var(--hand);
  font-size: 11.5px;
  line-height: 1.5;
}

.memory-card figcaption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-card .pin-mark {
  flex: 0 0 auto;
  color: var(--coral);
  font-size: 10px;
}

.memory-placeholder {
  display: block;
  width: 100%;
  cursor: pointer;
}

.memory-placeholder img {
  opacity: 0.78;
  filter: saturate(0.8);
}

.memory-placeholder-caption {
  display: block;
  overflow: hidden;
  padding: 7px 3px 8px;
  color: var(--ink-faint);
  font-family: var(--hand);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-add {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  min-height: 196px;
  padding: 15px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.34);
  color: var(--ink-faint);
  text-align: center;
  transition: 0.2s;
}

.memory-add:hover {
  border-color: var(--coral);
  color: var(--coral-deep);
  background: rgba(244, 211, 193, 0.18);
}

.memory-add svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.memory-add strong {
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 500;
}

.memory-add span {
  font-size: 9.5px;
  line-height: 1.5;
}

/* Rail cards */

.note-card {
  position: relative;
  padding: 24px 22px 21px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.24), transparent 50%),
    #f3e1b9;
  box-shadow: 0 16px 35px -26px rgba(77, 55, 36, 0.65);
}

.note-card::before {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 62px;
  height: 18px;
  background: rgba(255, 250, 242, 0.56);
  content: "";
  transform: translateX(-50%) rotate(-2deg);
}

.note-card::after {
  position: absolute;
  right: -26px;
  bottom: -32px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(123, 91, 56, 0.13);
  border-radius: 50%;
  content: "";
}

.note-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #977241;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.note-label span {
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.note-card blockquote {
  margin: 13px 0 14px;
  color: #63492f;
  font-family: var(--hand);
  font-size: 17px;
  line-height: 1.8;
}

.note-card blockquote::before {
  content: "“";
  margin-right: 1px;
  color: rgba(99, 73, 47, 0.34);
  font-family: var(--serif);
  font-size: 22px;
}

.note-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #9a784c;
  font-size: 10px;
}

.note-card footer .hand {
  font-size: 12.5px;
}

.note-card .stamp {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(183, 90, 60, 0.3);
  border-radius: 50%;
  color: var(--coral-deep);
  font-family: var(--serif);
  font-size: 9px;
  line-height: 1.1;
  text-align: center;
  transform: rotate(8deg);
}

.streak-card .panel-inner {
  padding: 21px 21px 18px;
}

.streak-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 11px;
}

.streak-head h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.streak-main {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin: 5px 0 2px;
}

.streak-main strong {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.15;
}

.streak-main span {
  padding-bottom: 8px;
  color: var(--ink-faint);
  font-size: 11px;
}

.streak-caption {
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.6;
}

.streak-days {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
}

.streak-day {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--ink-faint);
  font-size: 8.5px;
}

.streak-heart {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: transparent;
  font-size: 10px;
}

.streak-day.is-on .streak-heart {
  border-color: transparent;
  background: var(--coral-soft);
  color: var(--coral-deep);
}

.streak-day.is-today .streak-heart {
  box-shadow: 0 0 0 3px rgba(213, 117, 84, 0.14);
}

.week-card .panel-inner {
  padding: 21px;
}

.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.week-head h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.week-head span {
  color: var(--ink-faint);
  font-size: 9.5px;
}

.week-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 92px;
  padding-top: 7px;
}

.week-bar {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  height: 100%;
  color: var(--ink-faint);
  font-size: 8px;
}

.week-bar-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 24px;
  height: 65px;
  overflow: hidden;
  border-radius: 6px 6px 2px 2px;
  background: rgba(92, 72, 52, 0.06);
}

.week-bar-fill {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #dda07f, var(--coral));
  transition: height 0.8s var(--ease);
}

.week-bar.is-today {
  color: var(--coral-deep);
  font-weight: 700;
}

.week-bar.is-today .week-bar-fill {
  background: linear-gradient(180deg, #e9b58f, #c96545);
}

.week-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--ink-faint);
  font-size: 9.5px;
}

.week-foot strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Calendar
   -------------------------------------------------------------------------- */

.month-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-switch .month-label {
  min-width: 106px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  text-align: center;
}

.month-switch .icon-btn {
  width: 34px;
  height: 34px;
}

.month-switch .icon-btn svg {
  width: 16px;
  height: 16px;
}

.month-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 15px 17px;
  border: 1px solid rgba(92, 72, 52, 0.09);
  border-radius: 16px;
  background: rgba(255, 251, 244, 0.66);
}

.stat-card span {
  display: block;
  color: var(--ink-faint);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

.stat-card strong {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.stat-card strong em {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 400;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 22px;
}

.calendar-card {
  padding: 18px 18px 20px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 5px;
  color: var(--ink-faint);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-align: center;
}

.calendar-weekdays span:nth-child(6),
.calendar-weekdays span:nth-child(7) {
  color: var(--coral-deep);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.day-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 87px;
  padding: 9px 5px 7px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}

.day-cell:hover {
  background: rgba(255, 255, 255, 0.56);
  border-color: var(--line);
}

.day-cell.is-outside {
  color: #c2b2a2;
}

.day-cell.is-today .day-number {
  color: var(--paper-warm);
  background: var(--coral);
  box-shadow: 0 4px 10px -5px rgba(183, 90, 60, 0.6);
}

.day-cell.is-selected {
  border-color: rgba(213, 117, 84, 0.4);
  background: rgba(255, 250, 242, 0.94);
  box-shadow: inset 0 0 0 1px rgba(213, 117, 84, 0.14);
}

.day-cell.is-selected::after {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--coral);
  content: "";
  transform: translateX(-50%);
}

.day-number {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1;
}

.day-cell.is-outside .day-number {
  opacity: 0.48;
}

.day-marks {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2.5px;
  min-height: 9px;
  margin-top: 5px;
}

.day-mark {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sage);
}

.day-mark.is-unfinished {
  background: rgba(116, 100, 86, 0.24);
}

.day-mark.is-checkin {
  width: 5px;
  height: 5px;
  background: var(--coral);
}

.day-count {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.2;
}

.day-cell.has-checkin .day-photo-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 2px rgba(213, 117, 84, 0.12);
}

.calendar-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  color: var(--ink-faint);
  font-size: 9px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
}

.legend-dot--unfinished { background: rgba(116, 100, 86, 0.24); }
.legend-dot--checkin { background: var(--coral); }
.legend-dot--today { background: var(--coral); box-shadow: 0 0 0 2px rgba(213, 117, 84, 0.16); }

.calendar-legend .spacer {
  flex: 1;
}

.calendar-legend .hand {
  color: var(--ink-faint);
  font-size: 11px;
}

.day-panel {
  position: sticky;
  top: 24px;
  overflow: hidden;
}

.day-panel-head {
  padding: 21px 21px 15px;
  border-bottom: 1px dashed var(--line);
  background: rgba(247, 236, 219, 0.34);
}

.day-panel-date {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.day-panel-date strong {
  display: block;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.day-panel-date span {
  display: block;
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.day-panel-date .day-mood {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.7);
  color: var(--ink-soft);
  font-size: 9px;
}

.day-panel-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink-faint);
  font-size: 9.5px;
}

.day-panel-progress .track {
  height: 4px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(92, 72, 52, 0.08);
}

.day-panel-progress .fill {
  height: 100%;
  border-radius: inherit;
  background: var(--sage);
}

.day-panel-body {
  padding: 12px 17px 18px;
}

.day-panel-body .task-row {
  padding-block: 10px;
}

.day-panel-body .task-title {
  font-size: 12.5px;
}

.day-panel-body .task-actions {
  opacity: 1;
}

.day-panel-checkin {
  margin: 2px 0 12px;
}

.day-panel-checkin figure {
  position: relative;
  overflow: hidden;
  border-radius: 11px;
}

.day-panel-checkin img {
  width: 100%;
  height: 132px;
  object-fit: cover;
  cursor: zoom-in;
}

.day-panel-checkin figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 24px 12px 9px;
  background: linear-gradient(transparent, rgba(37, 28, 21, 0.72));
  color: #fff8ec;
  font-family: var(--hand);
  font-size: 11px;
  line-height: 1.5;
}

.day-panel-actions {
  display: flex;
  gap: 7px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
}

.day-panel-actions .btn {
  flex: 1;
  font-size: 11.5px;
}

.day-empty {
  padding: 22px 10px 18px;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.75;
  text-align: center;
}

.day-empty .hand {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   Timeline
   -------------------------------------------------------------------------- */

.timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-day {
  position: relative;
  display: grid;
  grid-template-columns: 58px 22px minmax(0, 1fr);
  gap: 0 12px;
  padding-bottom: 22px;
}

.timeline-date {
  padding-top: 2px;
  text-align: right;
}

.timeline-date strong {
  display: block;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.timeline-date span {
  display: block;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.timeline-axis {
  position: relative;
  display: flex;
  justify-content: center;
}

.timeline-axis::before {
  position: absolute;
  top: 31px;
  bottom: -22px;
  left: 50%;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-day:last-child .timeline-axis::before {
  display: none;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 9px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 1px var(--sage);
}

.timeline-day.has-checkin .timeline-dot {
  background: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}

.timeline-day.is-today .timeline-date strong {
  color: var(--coral-deep);
}

.timeline-card {
  padding: 19px 21px;
  border: 1px solid rgba(92, 72, 52, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 251, 244, 0.76);
  box-shadow: var(--shadow-sm);
}

.timeline-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.timeline-card-head h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.timeline-card-head p {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9.5px;
}

.timeline-completion {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(139, 154, 120, 0.13);
  color: var(--sage-deep);
  font-size: 9.5px;
  white-space: nowrap;
}

.timeline-completion.is-perfect {
  background: rgba(213, 117, 84, 0.12);
  color: var(--coral-deep);
}

.timeline-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.65;
}

.timeline-task .tick {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  font-size: 8px;
}

.timeline-task.is-done .tick {
  border-color: var(--sage);
  background: var(--sage);
  color: white;
}

.timeline-task.is-done span {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: rgba(116, 100, 86, 0.3);
}

.timeline-checkin {
  display: flex;
  gap: 13px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
}

.timeline-checkin img {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  border: 4px solid #fffaf0;
  border-radius: 2px;
  box-shadow: 0 8px 18px -14px rgba(77, 55, 36, 0.65);
  object-fit: cover;
  cursor: zoom-in;
  transform: rotate(-1.5deg);
}

.timeline-checkin-copy {
  min-width: 0;
}

.timeline-checkin-copy .who {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 9px;
}

.timeline-checkin-copy .who .avatar {
  width: 19px;
  height: 19px;
  font-size: 8px;
}

.timeline-checkin-copy p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-family: var(--hand);
  font-size: 12.5px;
  line-height: 1.65;
}

.timeline-checkin-copy .mood-line {
  margin-top: 3px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9px;
}

.timeline-photo-strip {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}

.timeline-photo-strip img {
  width: 48px;
  height: 48px;
  border-radius: 7px;
  object-fit: cover;
  cursor: zoom-in;
}

.timeline-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 58px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 251, 244, 0.42);
  color: var(--ink-faint);
  text-align: center;
}

.timeline-empty .empty-sun {
  width: 72px;
  height: 72px;
  margin-bottom: 3px;
  border: 1px solid rgba(213, 117, 84, 0.26);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(242, 199, 168, 0.48), transparent 70%);
}

.timeline-empty strong {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}

.timeline-empty p {
  max-width: 300px;
  font-size: 11px;
  line-height: 1.75;
}

/* --------------------------------------------------------------------------
   Album
   -------------------------------------------------------------------------- */

.album-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.album-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.6);
}

.album-tab {
  min-height: 32px;
  padding: 5px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  transition: 0.18s;
}

.album-tab.is-active {
  background: var(--ink);
  color: var(--paper-warm);
}

.album-tab span {
  display: inline-block;
  min-width: 15px;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(92, 72, 52, 0.08);
  color: var(--ink-faint);
  font-size: 8.5px;
  line-height: 1.6;
}

.album-tab.is-active span {
  background: rgba(255, 250, 242, 0.16);
  color: rgba(255, 250, 242, 0.78);
}

.album-masonry {
  columns: 3;
  column-gap: 20px;
}

.album-item {
  position: relative;
  break-inside: avoid;
  margin: 0 0 20px;
  padding: 9px 9px 0;
  border: 1px solid rgba(92, 72, 52, 0.06);
  border-radius: 3px;
  background: #fffaf0;
  box-shadow: 0 16px 30px -24px rgba(77, 55, 36, 0.58);
  transition: transform 0.28s var(--ease), box-shadow 0.28s;
}

.album-item:nth-child(3n + 1) { transform: rotate(-0.55deg); }
.album-item:nth-child(3n + 2) { transform: rotate(0.7deg); }
.album-item:nth-child(3n) { transform: rotate(-0.15deg); }

.album-item:hover {
  z-index: 2;
  box-shadow: 0 24px 40px -24px rgba(77, 55, 36, 0.62);
  transform: rotate(0) translateY(-3px);
}

.album-item > img {
  width: 100%;
  border-radius: 1px;
  object-fit: cover;
  cursor: zoom-in;
}

.album-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 7px 4px 8px;
}

.album-caption p {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--hand);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-caption time {
  color: var(--ink-faint);
  font-size: 8.5px;
  white-space: nowrap;
}

.album-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.82);
  box-shadow: 0 5px 16px -7px rgba(37, 28, 21, 0.35);
  opacity: 0;
  transition: opacity 0.18s;
  backdrop-filter: blur(8px);
}

.album-item:hover .album-actions,
.album-item:focus-within .album-actions {
  opacity: 1;
}

.album-actions .icon-btn {
  width: 27px;
  height: 27px;
  border: 0;
  background: transparent;
}

.album-actions .icon-btn svg {
  width: 13px;
  height: 13px;
}

.album-actions .icon-btn.is-pinned {
  color: var(--coral-deep);
  background: var(--coral-soft);
}

.album-featured-mark {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.84);
  color: var(--coral-deep);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.album-checkin .album-item > img {
  max-height: 420px;
}

.album-item-note {
  padding: 0 4px 10px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.65;
}

.album-add-card {
  display: grid;
  break-inside: avoid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 260px;
  margin-bottom: 20px;
  padding: 30px;
  border: 1.5px dashed rgba(183, 90, 60, 0.3);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.37);
  color: var(--ink-soft);
  text-align: center;
  transition: 0.2s;
}

.album-add-card:hover {
  border-color: var(--coral);
  background: rgba(244, 211, 193, 0.2);
}

.album-add-card .plus-ring {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(183, 90, 60, 0.28);
  border-radius: 50%;
  color: var(--coral-deep);
  font-family: var(--serif);
  font-size: 24px;
}

.album-add-card strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.album-add-card span {
  max-width: 190px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.7;
}

.album-empty {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 55px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 251, 244, 0.42);
  text-align: center;
}

.album-empty .empty-camera {
  width: 74px;
  height: 74px;
  margin-bottom: 4px;
  color: var(--coral);
  opacity: 0.65;
}

.album-empty .empty-camera svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

.album-empty strong {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.album-empty p {
  max-width: 330px;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   Settings
   -------------------------------------------------------------------------- */

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 22px;
}

.settings-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-card {
  padding: 23px 24px;
}

.settings-card-head {
  margin-bottom: 17px;
}

.settings-card-head h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.settings-card-head p {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.65;
}

.settings-card .field:last-child {
  margin-bottom: 0;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.settings-actions .danger-link {
  margin-left: auto;
}

.danger-link {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid rgba(163, 69, 50, 0.25);
  background: transparent;
  color: #a34532;
  font-size: 10.5px;
}

.danger-link:hover {
  border-color: #a34532;
}

.settings-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about-card {
  padding: 23px;
  background: linear-gradient(150deg, rgba(255, 250, 242, 0.9), rgba(243, 225, 200, 0.7));
}

.about-card .brand-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 13px;
  border-radius: 14px;
}

.about-card h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.about-card p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.8;
}

.about-card .about-quote {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  color: var(--ink-faint);
  font-family: var(--hand);
  font-size: 13px;
  line-height: 1.7;
}

.export-card {
  padding: 20px 21px;
}

.export-card h3 {
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 600;
}

.export-card p {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.7;
}

.export-card .btn {
  margin-top: 11px;
}

.phone-alt {
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.6;
  word-break: break-all;
}

.phone-warning {
  margin-top: 9px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(242, 227, 189, 0.42);
  color: #85653d;
  font-size: 9px;
  line-height: 1.65;
}

.lan-url {
  display: block;
  margin-top: 9px;
  padding: 9px 10px;
  overflow-x: auto;
  border: 1px dashed rgba(183, 90, 60, 0.24);
  border-radius: 9px;
  background: rgba(255, 250, 242, 0.7);
  color: var(--coral-deep);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(50, 39, 30, 0.36);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.22s ease both;
}

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

.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(88dvh, 820px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 26px;
  background: var(--card);
  box-shadow: 0 40px 90px -34px rgba(37, 28, 21, 0.58);
  animation: modalIn 0.3s var(--ease) both;
}

.modal--wide {
  width: min(760px, 100%);
}

.modal--small {
  width: min(420px, 100%);
}

.modal > form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 24px 26px 15px;
}

.modal-head h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.modal-head p {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.7;
}

.modal-close {
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  border-color: transparent;
  background: rgba(92, 72, 52, 0.05);
}

.modal-close:hover {
  background: rgba(92, 72, 52, 0.1);
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 5px 26px 24px;
  scrollbar-width: thin;
}

.modal-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 26px 22px;
  border-top: 1px dashed var(--line);
  background: rgba(247, 239, 227, 0.45);
}

.modal-foot-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.modal .field {
  margin-bottom: 14px;
}

.modal .field-row {
  gap: 10px;
}

.modal-note {
  margin: 4px 0 14px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(242, 227, 189, 0.35);
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.7;
}

.subject-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.subject-choice {
  min-height: 31px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.6);
  color: var(--ink-soft);
  font-size: 11px;
  transition: 0.17s;
}

.subject-choice:hover {
  border-color: var(--line-strong);
}

.subject-choice.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-warm);
}

/* Photo upload */

.photo-drop {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  min-height: 210px;
  margin-bottom: 15px;
  overflow: hidden;
  border: 1.5px dashed rgba(183, 90, 60, 0.34);
  border-radius: 16px;
  background:
    radial-gradient(220px 160px at 50% 0%, rgba(242, 199, 168, 0.14), transparent 70%),
    rgba(255, 250, 242, 0.4);
  color: var(--coral-deep);
  text-align: center;
  transition: 0.2s;
  cursor: pointer;
}

.photo-drop:hover,
.photo-drop.is-dragging {
  border-color: var(--coral);
  background: rgba(244, 211, 193, 0.19);
}

.photo-drop.has-image {
  display: block;
  min-height: 0;
  border-style: solid;
  border-color: var(--line);
  background: #efe4d4;
  cursor: default;
}

.photo-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-drop-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(183, 90, 60, 0.26);
  border-radius: 50%;
  background: rgba(255, 250, 242, 0.6);
}

.photo-drop-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photo-drop strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.photo-drop span {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.6;
}

.photo-preview {
  position: relative;
}

.photo-preview img {
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  background: #332a23;
}

.photo-preview-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}

.photo-preview-actions .btn {
  min-height: 31px;
  padding: 5px 11px;
  background: rgba(255, 250, 242, 0.9);
  font-size: 10.5px;
  backdrop-filter: blur(8px);
}

.photo-progress {
  height: 3px;
  margin: 8px 2px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(92, 72, 52, 0.08);
}

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

.mood-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 14px;
}

.mood-choice {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 62px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.55);
  color: var(--ink-soft);
  font-size: 10px;
  transition: 0.17s;
}

.mood-choice:hover {
  border-color: var(--line-strong);
}

.mood-choice.is-active {
  border-color: rgba(213, 117, 84, 0.5);
  background: rgba(244, 211, 193, 0.28);
  color: var(--coral-deep);
}

.mood-choice .mood-icon {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1;
}

/* Lightbox */

.lightbox {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(34, 27, 21, 0.9);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.2s ease both;
}

.lightbox img {
  max-width: min(1000px, 94vw);
  max-height: 82dvh;
  border-radius: 3px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  object-fit: contain;
}

.lightbox figcaption {
  margin-top: 14px;
  color: rgba(255, 248, 236, 0.74);
  font-family: var(--hand);
  font-size: 13px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 248, 236, 0.25);
  border-radius: 50%;
  background: rgba(255, 248, 236, 0.08);
  color: #fff8ec;
  font-size: 20px;
}

/* Search */

.search-overlay {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: flex;
  justify-content: center;
  padding: 8vh 20px 20px;
  background: rgba(50, 39, 30, 0.3);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.2s ease both;
}

.search-box {
  display: flex;
  flex-direction: column;
  width: min(700px, 100%);
  max-height: min(78dvh, 760px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  background: var(--card-solid);
  box-shadow: 0 40px 100px -30px rgba(37, 28, 21, 0.58);
  animation: modalIn 0.28s var(--ease) both;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}

.search-input-wrap > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.search-input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-input::placeholder {
  color: #b6a592;
}

.search-kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-faint);
  font-size: 9px;
}

.search-results {
  overflow-y: auto;
  padding: 8px 10px 16px;
  scrollbar-width: thin;
}

.search-hint {
  padding: 20px 14px;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.8;
}

.search-hint strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.search-group-title {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 10px 6px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-group-title span {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(92, 72, 52, 0.07);
  font-size: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  transition: background 0.16s;
}

.search-result:hover,
.search-result.is-focused {
  background: rgba(242, 199, 168, 0.2);
}

.search-result-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-size: 12px;
}

.search-result-icon--checkin {
  background: var(--coral-soft);
  color: var(--coral-deep);
}

.search-result-icon--photo {
  background: var(--gold-soft);
  color: #8e6a27;
}

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

.search-result-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--ink-faint);
  font-size: 9.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result time {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 9px;
}

.search-result mark {
  padding: 0 1px;
  border-radius: 2px;
  background: rgba(242, 199, 168, 0.62);
  color: var(--ink);
}

.task-row.is-highlight,
.timeline-checkin.is-highlight,
.album-item.is-highlight {
  animation: highlightPulse 2.2s var(--ease);
}

@keyframes highlightPulse {
  0%, 100% { background-color: transparent; box-shadow: none; }
  18%, 62% { background-color: rgba(242, 199, 168, 0.42); box-shadow: 0 0 0 4px rgba(242, 199, 168, 0.3); }
}

.search-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 34px 20px;
  color: var(--ink-faint);
  text-align: center;
}

.search-empty .hand {
  color: var(--ink-soft);
  font-size: 17px;
}

.search-empty p {
  font-size: 10.5px;
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* Confirm */

.confirm-body {
  padding: 0 26px 22px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.confirm-body strong {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Toast & hearts
   -------------------------------------------------------------------------- */

.toast-region {
  position: fixed;
  z-index: 1300;
  bottom: 26px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 430px);
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 10px 17px;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 999px;
  background: rgba(61, 49, 40, 0.94);
  color: #fff8ec;
  box-shadow: 0 15px 35px -15px rgba(37, 28, 21, 0.6);
  font-size: 11.5px;
  line-height: 1.5;
  animation: toastIn 0.3s var(--ease) both;
  backdrop-filter: blur(8px);
}

.toast.is-out {
  animation: toastOut 0.25s ease both;
}

.toast .toast-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--peach);
}

.toast.toast--error .toast-dot {
  background: #ea947c;
}

.toast.toast--success .toast-dot {
  background: #b7c69a;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}

.hearts-layer {
  position: fixed;
  z-index: 1400;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.heart-particle {
  position: fixed;
  color: var(--coral);
  font-size: 15px;
  line-height: 1;
  animation: heartFly 1.05s var(--ease) forwards;
}

@keyframes heartFly {
  0% { opacity: 1; transform: translate(0, 0) scale(0.55) rotate(0); }
  100% { opacity: 0; transform: translate(var(--dx), -78px) scale(1.15) rotate(var(--rot)); }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1160px) {
  :root {
    --sidebar: 218px;
  }

  .sidebar {
    padding-inline: 16px;
  }

  .brand--side span {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 274px;
    gap: 18px;
  }

  .hero-count {
    width: 138px;
    height: 138px;
  }

  .hero-count-number strong {
    font-size: 52px;
  }

  .hero-deco {
    right: 155px;
  }

  .calendar-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .main-content {
    padding-inline: 32px;
  }
}

@media (max-width: 1020px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-rail {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    align-items: stretch;
    gap: 14px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .day-panel {
    position: static;
  }

  .day-panel-body .task-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
  }

  .day-panel-checkin {
    grid-column: 1 / -1;
  }

  .album-masonry {
    columns: 2;
  }

  .auth-layout {
    grid-template-columns: 1fr 390px;
    gap: 42px;
  }

  .auth-memories {
    height: 250px;
  }

  .memory-polaroid {
    width: 150px;
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar: 0px;
  }

  body {
    background:
      radial-gradient(700px 500px at 90% -10%, rgba(242, 199, 168, 0.52), transparent 65%),
      radial-gradient(600px 500px at -10% 35%, rgba(223, 229, 213, 0.48), transparent 64%),
      var(--paper);
  }

  .grain {
    opacity: 0.28;
  }

  .sidebar {
    display: none;
  }

  .app-shell {
    margin-left: 0;
  }

  .mobile-header {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: max(11px, env(safe-area-inset-top)) 18px 10px;
    border-bottom: 1px solid rgba(92, 72, 52, 0.08);
    background: rgba(247, 239, 227, 0.84);
    backdrop-filter: blur(18px);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
  }

  .mobile-brand .brand-mark {
    width: 35px;
    height: 35px;
    border-radius: 10px;
  }

  .mobile-brand strong {
    display: block;
    overflow: hidden;
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-brand span {
    display: block;
    color: var(--ink-faint);
    font-size: 8.5px;
    letter-spacing: 0.04em;
    line-height: 1.4;
  }

  .mobile-actions {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .mobile-actions .icon-btn {
    width: 35px;
    height: 35px;
  }

  .mobile-actions .avatar-btn {
    width: 35px;
    height: 35px;
    font-size: 12px;
  }

  .main-content {
    max-width: none;
    padding: 22px 16px calc(92px + env(safe-area-inset-bottom));
  }

  .mobile-nav {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(92, 72, 52, 0.1);
    background: rgba(252, 247, 238, 0.94);
    box-shadow: 0 -12px 30px -22px rgba(77, 55, 36, 0.45);
    backdrop-filter: blur(18px);
  }

  .mobile-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 48px;
    padding: 5px 2px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink-faint);
    font-size: 8.5px;
    line-height: 1.2;
    text-decoration: none;
    transition: color 0.18s, background 0.18s;
  }

  .mobile-nav-item svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-nav-item.is-active {
    color: var(--coral-deep);
    background: rgba(244, 211, 193, 0.24);
  }

  .mobile-nav-item.is-active::before {
    position: absolute;
    top: 0;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--coral);
    content: "";
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 20px;
  }

  .page-head .head-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .page-head .head-actions .icon-btn[data-action="search"] {
    display: none;
  }

  .page-head .head-actions:not(:has(.month-switch)) {
    display: none;
  }

  .page-head .head-actions .month-switch {
    flex: 1;
    justify-content: space-between;
  }

  .page-head .head-actions .month-switch .month-label {
    flex: 1;
    text-align: center;
  }

  .page-title {
    font-size: clamp(27px, 7.6vw, 33px);
    line-height: 1.32;
  }

  .page-sub {
    font-size: 11.5px;
    line-height: 1.65;
  }

  .head-actions .search-pill {
    display: none;
  }

  .head-actions .avatar-btn {
    display: none;
  }

  .head-actions .icon-btn {
    width: 35px;
    height: 35px;
  }

  .dashboard-main,
  .dashboard-rail {
    gap: 16px;
  }

  .hero-card {
    grid-template-columns: 1fr auto;
    gap: 8px;
    min-height: 0;
    padding: 22px 19px 20px;
    border-radius: 24px;
  }

  .hero-card::before {
    right: -60px;
  }

  .hero-pill {
    font-size: 9px;
  }

  .hero-copy h2 {
    margin-top: 13px;
    font-size: clamp(24px, 7vw, 30px);
  }

  .hero-copy > p {
    max-width: 290px;
    font-size: 11px;
    line-height: 1.7;
  }

  .hero-count {
    width: 107px;
    height: 107px;
    align-self: flex-start;
    margin-top: 27px;
  }

  .hero-count::before {
    top: -7px;
    width: 38px;
    height: 14px;
  }

  .hero-count-number strong {
    font-size: 41px;
  }

  .hero-count-number span {
    font-size: 10px;
  }

  .hero-count small {
    margin-top: 3px;
    font-size: 8px;
    letter-spacing: 0.03em;
  }

  .hero-count .exam-date {
    font-size: 9px;
  }

  .hero-deco {
    display: none;
  }

  .hero-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 11px;
    padding-top: 17px;
  }

  .hero-progress {
    max-width: none;
  }

  .panel {
    border-radius: 20px;
  }

  .panel-inner {
    padding: 18px 17px;
  }

  .card-head {
    margin-bottom: 12px;
  }

  .card-head h3 {
    font-size: 17px;
  }

  .task-row {
    gap: 11px;
    padding: 12px 1px;
  }

  .task-check {
    width: 24px;
    height: 24px;
  }

  .task-title {
    font-size: 13.5px;
  }

  .task-meta {
    font-size: 9.5px;
  }

  .task-actions {
    opacity: 1;
  }

  .task-actions .icon-btn {
    width: 29px;
    height: 29px;
  }

  .task-note {
    display: -webkit-box !important;
    overflow: hidden;
    margin-top: 5px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink-faint);
    font-size: 10.5px;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .task-footer {
    font-size: 9.5px;
  }

  .task-footer .hand {
    font-size: 11px;
  }

  .checkin-strip {
    gap: 10px;
  }

  .checkin-polaroid {
    width: 155px;
  }

  .checkin-polaroid img {
    height: 127px;
  }

  .checkin-add {
    width: 136px;
    min-height: 181px;
  }

  .checkin-empty {
    gap: 14px;
  }

  .checkin-empty-art {
    width: 90px;
  }

  .checkin-empty-art img {
    height: 96px;
  }

  .checkin-empty-copy h4 {
    font-size: 14.5px;
  }

  .checkin-empty-copy p {
    font-size: 10.5px;
    line-height: 1.7;
  }

  .memory-grid {
    display: flex;
    gap: 11px;
    overflow-x: auto;
    padding-bottom: 9px;
    scrollbar-width: thin;
  }

  .memory-card {
    width: 156px;
    flex: 0 0 auto;
  }

  .memory-card img {
    height: 143px;
  }

  .memory-add {
    width: 132px;
    min-height: 178px;
    flex: 0 0 auto;
  }

  .dashboard-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
  }

  .note-card {
    grid-column: 1 / -1;
    padding: 21px 20px 18px;
    border-radius: 20px;
  }

  .note-card blockquote {
    font-size: 15.5px;
  }

  .streak-card .panel-inner,
  .week-card .panel-inner {
    padding: 16px;
  }

  .streak-main strong {
    font-size: 40px;
  }

  .streak-days {
    gap: 2px;
  }

  .streak-heart {
    width: 21px;
    height: 21px;
    font-size: 9px;
  }

  .week-bars {
    height: 82px;
    gap: 5px;
  }

  .week-bar-track {
    height: 55px;
  }

  .month-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 11px 13px;
  }

  .stat-card strong {
    font-size: 21px;
  }

  .calendar-card {
    padding: 13px 11px 16px;
  }

  .calendar-weekdays {
    font-size: 8.5px;
    gap: 2px;
  }

  .calendar-grid {
    gap: 2px;
  }

  .day-cell {
    min-height: 66px;
    padding: 7px 2px 5px;
    border-radius: 9px;
  }

  .day-number {
    width: 22px;
    height: 22px;
    font-size: 11.5px;
  }

  .day-marks {
    gap: 2px;
    margin-top: 3px;
  }

  .day-mark {
    width: 3px;
    height: 3px;
  }

  .day-mark.is-checkin {
    width: 4px;
    height: 4px;
  }

  .day-count {
    font-size: 7px;
  }

  .day-cell.has-checkin .day-photo-dot {
    top: 4px;
    right: 4px;
    width: 4px;
    height: 4px;
  }

  .calendar-legend {
    font-size: 8px;
    gap: 9px;
  }

  .calendar-legend .hand {
    display: none;
  }

  .day-panel-body .task-list {
    display: flex;
  }

  .day-panel-head {
    padding: 17px 17px 12px;
  }

  .day-panel-body {
    padding: 10px 14px 15px;
  }

  .timeline-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
    margin-bottom: 17px;
  }

  .timeline-day {
    grid-template-columns: 41px 17px minmax(0, 1fr);
    gap: 0 8px;
    padding-bottom: 16px;
  }

  .timeline-date strong {
    font-size: 24px;
  }

  .timeline-date span {
    font-size: 7.5px;
  }

  .timeline-dot {
    width: 8px;
    height: 8px;
    margin-top: 7px;
  }

  .timeline-axis::before {
    top: 26px;
    bottom: -16px;
  }

  .timeline-card {
    padding: 15px 15px;
    border-radius: 17px;
  }

  .timeline-card-head h3 {
    font-size: 14.5px;
  }

  .timeline-task {
    font-size: 10.5px;
  }

  .timeline-checkin img {
    width: 70px;
    height: 70px;
  }

  .timeline-checkin-copy p {
    font-size: 11.5px;
  }

  .album-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .album-masonry {
    columns: 2;
    column-gap: 12px;
  }

  .album-item {
    margin-bottom: 12px;
    padding: 6px 6px 0;
  }

  .album-caption {
    min-height: 34px;
    padding: 5px 3px 6px;
  }

  .album-caption p {
    font-size: 10.5px;
  }

  .album-actions {
    top: 9px;
    right: 9px;
    flex-direction: column;
    gap: 2px;
    padding: 3px;
    border-radius: 13px;
    opacity: 1;
  }

  .album-actions .icon-btn {
    width: 28px;
    height: 28px;
  }

  .album-actions .icon-btn svg {
    width: 13px;
    height: 13px;
  }

  .album-featured-mark {
    top: 10px;
    left: 10px;
    font-size: 7.5px;
  }

  .album-add-card {
    min-height: 180px;
    margin-bottom: 12px;
    padding: 18px 10px;
  }

  .album-add-card .plus-ring {
    width: 42px;
    height: 42px;
    font-size: 19px;
  }

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

  .album-add-card span {
    font-size: 9px;
  }

  .album-empty {
    padding: 40px 17px;
  }

  .settings-card {
    padding: 18px 17px;
  }

  .settings-side {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    animation: sheetIn 0.32s var(--ease) both;
  }

  @keyframes sheetIn {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: none; }
  }

  .modal-head {
    padding: 20px 19px 12px;
  }

  .modal-head h2 {
    font-size: 21px;
  }

  .modal-body {
    padding: 4px 19px calc(20px + env(safe-area-inset-bottom));
  }

  .modal-foot {
    padding: 13px 19px calc(16px + env(safe-area-inset-bottom));
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .field-row--three {
    grid-template-columns: 1fr 1fr;
  }

  .auth-card .field-row {
    grid-template-columns: 1fr 1fr;
    gap: 0 9px;
  }

  .auth-layout {
    display: block;
    width: min(100% - 32px, 500px);
    min-height: auto;
    padding: 26px 0 40px;
  }

  .auth-story {
    padding-top: 0;
  }

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

  .brand--auth .brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 13px;
  }

  .auth-story h1 {
    margin: 11px 0 12px;
    font-size: clamp(31px, 9vw, 40px);
    line-height: 1.32;
  }

  .auth-lede {
    font-size: 12.5px;
    line-height: 1.8;
  }

  .auth-memories {
    display: none;
  }

  .auth-quote,
  .auth-quote-tail {
    display: none;
  }

  .auth-card {
    margin-top: 25px;
    padding: 24px 20px;
    border-radius: 24px;
  }

  .auth-card::before {
    inset: 7px;
    border-radius: 19px;
  }

  .auth-card-head {
    margin-bottom: 18px;
  }

  .auth-card-head h2 {
    font-size: 23px;
  }

  .auth-foot {
    margin-top: 13px;
  }

  .auth-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0 9px;
  }

  .settings-card .field-row {
    grid-template-columns: 1fr 1fr;
    gap: 0 9px;
  }

  .search-overlay {
    padding: 0;
    background: var(--paper);
  }

  .search-box {
    width: 100%;
    max-height: none;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .search-input-wrap {
    padding: max(16px, env(safe-area-inset-top)) 16px 16px;
  }

  .search-kbd {
    display: none;
  }

  .search-results {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .toast-region {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .lightbox {
    padding: 14px;
  }

  .lightbox img {
    max-height: 76dvh;
  }
}

@media (max-width: 520px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-count {
    position: absolute;
    top: 18px;
    right: 17px;
    width: 90px;
    height: 90px;
    margin-top: 0;
    opacity: 0.94;
  }

  .hero-count-number strong {
    font-size: 34px;
  }

  .hero-count small {
    display: none;
  }

  .hero-count .exam-date {
    margin-top: 1px;
    font-size: 8px;
  }

  .hero-copy h2 {
    max-width: 235px;
    font-size: 25px;
  }

  .hero-copy > p {
    max-width: 230px;
  }

  .hero-pill {
    max-width: 210px;
    overflow: hidden;
    white-space: nowrap;
  }

  .hero-foot {
    margin-top: 10px;
  }

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

  .streak-card,
  .week-card {
    grid-column: 1;
  }

  .streak-days {
    padding-inline: 10px;
  }

  .streak-heart {
    width: 27px;
    height: 27px;
  }

  .album-masonry {
    columns: 2;
  }

  .album-item > img {
    max-height: 300px;
    width: 100%;
  }

  .album-add-card {
    min-height: 150px;
  }

  .field-row--three {
    grid-template-columns: 1fr;
  }

  .mood-picker {
    grid-template-columns: 1fr 1fr;
  }

  .task-footer .hand {
    display: none;
  }

  .day-cell {
    min-height: 60px;
  }

  .calendar-card {
    padding-inline: 9px;
  }

  .month-switch .month-label {
    min-width: 86px;
    font-size: 14px;
  }
}

@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;
  }
}
