/* ------------------------------------------------------------------ */
/* foundation                                                          */
/* ------------------------------------------------------------------ */

:root {
  --paper: #f7f1e7;
  --paper-deep: #f1e7d8;
  --card: #fffdf9;
  --card-soft: #fdf8f0;
  --ink: #3f332c;
  --ink-soft: #6d5d51;
  --muted: #9a897b;
  --line: #eadfcf;
  --line-strong: #ddceba;
  --terra: #c96f4a;
  --terra-dark: #b35e3b;
  --terra-wash: #f7e5db;
  --sage: #7e9b79;
  --sage-deep: #5f7d5c;
  --sage-wash: #eaf1e6;
  --gold: #c99a3e;
  --gold-wash: #f8efd9;
  --rose: #cf7a6a;
  --shadow-sm: 0 8px 24px rgba(84, 58, 38, 0.05);
  --shadow-md: 0 18px 50px rgba(84, 58, 38, 0.09);
  --radius: 24px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
}

* {
  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 600px at 8% -10%, #fdf6ea 0%, transparent 60%),
    radial-gradient(900px 700px at 105% 10%, #f2eadb 0%, transparent 55%),
    var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(rgba(126, 100, 72, 0.14) 0.55px, transparent 0.55px),
    radial-gradient(rgba(126, 100, 72, 0.09) 0.55px, transparent 0.55px);
  background-position: 0 0, 13px 13px;
  background-size: 26px 26px;
  mix-blend-mode: multiply;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

::selection {
  background: rgba(201, 111, 74, 0.22);
}

:focus-visible {
  outline: 2.5px solid rgba(201, 111, 74, 0.65);
  outline-offset: 3px;
}

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

.app {
  position: relative;
  z-index: 1;
}

/* ------------------------------------------------------------------ */
/* boot                                                                */
/* ------------------------------------------------------------------ */

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--terra);
}

.boot p {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  animation: breathe 1.8s ease-in-out infinite;
}

.boot-mark {
  width: 54px;
  height: 54px;
  animation: breathe 1.8s ease-in-out infinite;
}

.boot-mark svg {
  width: 100%;
  height: 100%;
}

/* ------------------------------------------------------------------ */
/* shell                                                               */
/* ------------------------------------------------------------------ */

.shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 0;
  width: min(1180px, 100%);
  margin: 0 auto;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 30px 22px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 2px 4px;
  width: fit-content;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 5px 14px rgba(84, 58, 38, 0.06);
  color: var(--terra);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

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

.brand-text small {
  margin-top: 2px;
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.side-profile {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 18px;
  border-radius: 26px;
  background:
    radial-gradient(120px 90px at 100% 0%, rgba(201, 111, 74, 0.1), transparent 70%),
    linear-gradient(165deg, #fffdf8 0%, #faf2e6 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.side-profile::after {
  content: "";
  position: absolute;
  width: 74px;
  height: 74px;
  right: -24px;
  bottom: -30px;
  border-radius: 50%;
  border: 1px solid rgba(126, 155, 121, 0.35);
}

.side-avatar {
  display: flex;
  align-items: flex-end;
  gap: 13px;
}

.avatar {
  --size: 42px;
  width: var(--size);
  height: var(--size);
  flex: 0 0 var(--size);
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #f4e5d3, #eedbc4);
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(201, 111, 74, 0.14);
  display: grid;
  place-items: center;
  color: var(--terra-dark);
  font-family: var(--serif);
  font-weight: 600;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  font-size: calc(var(--size) * 0.4);
  line-height: 1;
  user-select: none;
}

.side-avatar .avatar {
  --size: 66px;
  box-shadow:
    0 0 0 4px #fffdf8,
    0 0 0 5px rgba(201, 111, 74, 0.2);
}

.side-name {
  padding-bottom: 3px;
  min-width: 0;
}

.side-name h2 {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-name p {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.side-tagline {
  margin-top: 15px;
  font-family: var(--serif);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  border-left: 2px solid rgba(201, 111, 74, 0.28);
  padding-left: 10px;
  min-height: 21px;
}

.side-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px dashed var(--line-strong);
  text-align: center;
}

.side-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.3;
  color: var(--ink);
}

.side-stat span {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border-radius: 13px;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link svg {
  width: 19px;
  height: 19px;
  opacity: 0.78;
}

.nav-link:hover {
  background: rgba(255, 253, 249, 0.7);
  color: var(--ink);
}

.nav-link.active {
  background: var(--card);
  color: var(--terra-dark);
  box-shadow: 0 5px 18px rgba(84, 58, 38, 0.06);
  font-weight: 600;
}

.nav-link.active svg {
  opacity: 1;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 16px;
  margin-top: -8px;
  border-radius: 3px;
  background: var(--terra);
}

.side-foot {
  margin-top: auto;
  padding: 0 6px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11.5px;
  line-height: 1.8;
  letter-spacing: 0.06em;
}

.side-foot .heart {
  color: var(--terra);
  font-size: 10px;
  margin-right: 3px;
}

.main {
  min-width: 0;
  padding: 0 36px 0 20px;
}

.page {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 44px 0 80px;
}

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

/* ------------------------------------------------------------------ */
/* shared bits                                                         */
/* ------------------------------------------------------------------ */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}

.eyebrow .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--terra);
}

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

.page-head h1 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.04em;
}

.page-head .sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.section {
  margin-top: 34px;
}

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

.section-head h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.05em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.section-head h2 .count {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  transition: color 0.2s ease, gap 0.2s ease;
  white-space: nowrap;
}

.section-link svg {
  width: 13px;
  height: 13px;
}

.section-link:hover {
  color: var(--terra);
  gap: 7px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 18px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
}

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

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

.btn-primary {
  background: var(--terra);
  color: #fffaf4;
  box-shadow: 0 9px 22px rgba(201, 111, 74, 0.22);
}

.btn-primary:hover {
  background: var(--terra-dark);
  box-shadow: 0 11px 26px rgba(201, 111, 74, 0.28);
}

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

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

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

.btn-ghost:hover {
  background: rgba(255, 253, 249, 0.8);
}

.btn-danger {
  background: #fff4f0;
  border-color: #f0d2c7;
  color: #b5543c;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  min-height: 48px;
  padding: 12px 26px;
  font-size: 14.5px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease;
}

.icon-btn:hover {
  background: rgba(234, 223, 207, 0.55);
  color: var(--ink);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}

.spinner.dark {
  border-color: rgba(63, 51, 44, 0.16);
  border-top-color: var(--terra);
}

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

/* ------------------------------------------------------------------ */
/* home                                                                */
/* ------------------------------------------------------------------ */

.hello-card {
  position: relative;
  overflow: hidden;
  min-height: 218px;
  padding: 32px 32px 28px;
  border-radius: 30px;
  border: 1px solid #ecdfcb;
  background:
    radial-gradient(420px 220px at 105% -10%, rgba(201, 154, 62, 0.16), transparent 70%),
    radial-gradient(320px 240px at 80% 120%, rgba(126, 155, 121, 0.15), transparent 70%),
    linear-gradient(135deg, #fdf7ec 0%, #f8ecdc 100%);
  box-shadow: var(--shadow-sm);
}

.hello-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 23px;
  pointer-events: none;
}

.hello-copy {
  position: relative;
  z-index: 2;
  width: 62%;
}

.hello-copy h1 {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: 0.05em;
}

.hello-copy h1 em {
  font-style: normal;
  color: var(--terra);
  position: relative;
}

.hello-copy h1 em::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 2px;
  height: 7px;
  border-radius: 6px;
  background: rgba(201, 111, 74, 0.14);
  z-index: -1;
}

.hello-sub {
  margin-top: 13px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

.hello-art {
  position: absolute;
  right: -8px;
  bottom: -14px;
  width: 46%;
  max-width: 300px;
  opacity: 0.95;
  pointer-events: none;
}

.hello-art svg {
  width: 100%;
  height: auto;
}

.milestone-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.milestone-strip::-webkit-scrollbar {
  display: none;
}

.milestone-mini {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 108px;
  padding: 15px 16px 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 5px 16px rgba(84, 58, 38, 0.035);
  scroll-snap-align: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.milestone-mini:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.milestone-mini .ms-emoji {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--terra-wash);
  font-size: 15px;
}

.milestone-mini .ms-date {
  font-size: 10px;
  letter-spacing: 0.13em;
  color: var(--muted);
}

.milestone-mini strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.milestone-mini.add {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
  background: rgba(255, 253, 249, 0.45);
  color: var(--muted);
  gap: 7px;
}

.milestone-mini.add svg {
  width: 20px;
  height: 20px;
}

.milestone-mini.add span {
  font-size: 11.5px;
}

.composer-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: left;
  box-shadow: 0 5px 16px rgba(84, 58, 38, 0.035);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.composer-trigger:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.composer-trigger .placeholder {
  flex: 1;
  color: var(--muted);
  font-size: 13.5px;
}

.composer-trigger .cam {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--sage-deep);
  background: var(--sage-wash);
}

.composer-trigger .cam svg {
  width: 17px;
  height: 17px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 6px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.6);
  color: var(--ink-soft);
  font-size: 12px;
  transition: all 0.18s ease;
}

.filter-chip .cat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cat, var(--line-strong));
}

.filter-chip:hover {
  border-color: var(--line);
  background: var(--card);
}

.filter-chip.active {
  background: var(--ink);
  color: #fffaf4;
  border-color: var(--ink);
}

.filter-chip.active .cat-dot {
  background: rgba(255, 250, 244, 0.75);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.post-card {
  position: relative;
  padding: 21px 23px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 8px 26px rgba(84, 58, 38, 0.04);
  animation: rise 0.45s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-head .avatar {
  --size: 39px;
}

.post-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.post-meta strong {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.post-meta span {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cat) 12%, #fff);
  color: color-mix(in srgb, var(--cat) 72%, #3f332c);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.cat-chip .cat-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cat);
}

.post-menu-wrap {
  position: relative;
  margin-left: -4px;
}

.post-menu {
  width: 32px;
  height: 32px;
}

.post-menu svg {
  width: 17px;
  height: 17px;
}

.post-pop {
  display: none;
  position: absolute;
  top: 36px;
  right: 0;
  z-index: 12;
  min-width: 132px;
  padding: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-md);
  animation: pop 0.16s ease both;
}

.post-pop.open {
  display: block;
}

.post-pop button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #b5543c;
  font-size: 12.5px;
  text-align: left;
}

.post-pop button:hover {
  background: #fdf0ea;
}

.post-pop svg {
  width: 14px;
  height: 14px;
}

.post-text {
  margin: 13px 2px 0;
  color: #40342c;
  font-size: 14.5px;
  line-height: 1.95;
  letter-spacing: 0.015em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.photo-grid {
  display: grid;
  gap: 5px;
  margin-top: 15px;
  border-radius: 16px;
  overflow: hidden;
}

.photo-grid.grid-1 {
  grid-template-columns: 1fr;
  max-width: 100%;
}

.photo-grid.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

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

.photo-grid.grid-4 {
  grid-template-columns: repeat(2, 1fr);
}

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

.photo-tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--paper-deep);
  overflow: hidden;
  cursor: zoom-in;
}

.photo-grid.grid-1 .photo-tile {
  aspect-ratio: var(--ratio, 4 / 3);
  max-height: 480px;
}

.photo-grid.grid-2 .photo-tile,
.photo-grid.grid-3 .photo-tile,
.photo-grid.grid-4 .photo-tile,
.photo-grid.grid-many .photo-tile {
  aspect-ratio: 1 / 1;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, opacity 0.3s ease;
}

.photo-tile:hover img {
  transform: scale(1.025);
}

.photo-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(63, 51, 44, 0.04);
  pointer-events: none;
}

.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.post-foot .photo-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.post-foot svg {
  width: 12px;
  height: 12px;
}

.feed-empty {
  padding: 44px 26px 40px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.46);
}

.feed-empty .empty-art {
  width: 128px;
  margin: 0 auto 12px;
  color: var(--terra);
  opacity: 0.85;
}

.feed-empty h3 {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.04em;
}

.feed-empty p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

.feed-empty .btn {
  margin-top: 17px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.load-more {
  min-width: 160px;
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ */
/* milestones                                                          */
/* ------------------------------------------------------------------ */

.timeline {
  position: relative;
  margin-top: 8px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 10px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(var(--line-strong), rgba(234, 223, 207, 0.2));
}

.timeline-year {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 15px;
  padding-left: 58px;
  font-family: var(--serif);
  font-size: 27px;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.timeline-year:first-child {
  margin-top: 6px;
}

.timeline-year::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--terra);
  transform: translateY(-50%);
}

.timeline-year span {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 15px;
  margin-bottom: 13px;
  padding-left: 0;
  animation: rise 0.45s ease both;
}

.timeline-node {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(84, 58, 38, 0.05);
  font-size: 21px;
}

.timeline-card {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 17px 19px 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 5px 18px rgba(84, 58, 38, 0.035);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.timeline-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.timeline-card .tl-date {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.timeline-card h3 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.03em;
}

.timeline-card p {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.timeline-card .tl-del {
  position: absolute;
  right: 9px;
  top: 9px;
  width: 29px;
  height: 29px;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}

.timeline-card:hover .tl-del,
.timeline-card:focus-within .tl-del {
  opacity: 1;
}

.timeline-card .tl-del:hover {
  color: #b5543c;
  background: #fdf0ea;
}

.timeline-empty {
  margin-top: 10px;
}

/* ------------------------------------------------------------------ */
/* growth                                                              */
/* ------------------------------------------------------------------ */

.standards-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 0.9fr 1.15fr 1.15fr;
  gap: 20px;
  padding: 23px 25px;
  border-radius: 26px;
  border: 1px solid #e4ddcb;
  background:
    radial-gradient(220px 160px at 0% 100%, rgba(126, 155, 121, 0.16), transparent 70%),
    linear-gradient(130deg, #fbf7ea 0%, #f2eee0 100%);
  box-shadow: var(--shadow-sm);
}

.standards-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -38px;
  top: -40px;
  border-radius: 50%;
  border: 1px solid rgba(126, 155, 121, 0.35);
}

.std-today {
  padding-right: 20px;
  border-right: 1px dashed rgba(126, 110, 90, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.std-today .label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.std-today strong {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.04em;
}

.std-today .note {
  margin-top: 5px;
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.std-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.std-block .std-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

.std-block .std-label i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
  display: inline-block;
}

.std-block .std-value {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.std-block .std-value small {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  margin-left: 3px;
  letter-spacing: 0;
}

.std-block .std-range {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.7;
}

.chart-stack {
  display: grid;
  gap: 15px;
  margin-top: 17px;
}

.chart-card {
  padding: 20px 22px 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 7px 24px rgba(84, 58, 38, 0.04);
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.chart-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.chart-title h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.chart-title span {
  font-size: 10.5px;
  color: var(--muted);
}

.legend {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-top: 5px;
  font-size: 9.5px;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.legend .line {
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: var(--terra);
}

.legend .line.dash {
  background: repeating-linear-gradient(
    90deg,
    var(--sage) 0 3px,
    transparent 3px 5px
  );
}

.legend .band {
  width: 15px;
  height: 8px;
  border-radius: 3px;
  background: var(--sage-wash);
  border: 1px solid #dce8d6;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 250px;
  touch-action: pan-y;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  min-width: 116px;
  padding: 8px 10px;
  background: rgba(63, 51, 44, 0.94);
  color: #fffaf4;
  border-radius: 10px;
  font-size: 10.5px;
  line-height: 1.6;
  box-shadow: 0 8px 22px rgba(63, 51, 44, 0.2);
  transform: translate(-50%, -108%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.chart-tooltip.visible {
  opacity: 1;
}

.chart-tooltip strong {
  font-weight: 600;
  color: #f5d7c7;
}

.chart-empty-note {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -40%);
  width: 80%;
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
  pointer-events: none;
}

.chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 9px;
  margin-top: 2px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.growth-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--terra-wash);
  border: 1px solid #f0d6c8;
  border-radius: 18px;
}

.growth-cta p {
  font-size: 12px;
  color: #8e5b44;
  line-height: 1.7;
}

.growth-cta .btn {
  flex: 0 0 auto;
}

.history-card {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 19px 22px 13px;
}

.history-head h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.history-head span {
  font-size: 10.5px;
  color: var(--muted);
}

.history-row {
  display: grid;
  grid-template-columns: 92px 1fr 1fr 30px;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
}

.history-row .h-date {
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.history-row .h-date small {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

.h-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.h-value strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.h-value small {
  color: var(--muted);
  font-size: 9.5px;
}

.h-value em {
  font-style: normal;
  font-size: 9.5px;
  color: var(--muted);
}

.history-empty {
  padding: 5px 22px 22px;
  color: var(--muted);
  font-size: 12px;
}

.pct-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.5;
  background: var(--sage-wash);
  color: #5c7a58;
  white-space: nowrap;
}

.pct-badge.low {
  background: #f6e9df;
  color: #a2694f;
}

.pct-badge.high {
  background: var(--gold-wash);
  color: #98742a;
}

.pct-badge.none {
  background: #f1ece5;
  color: var(--muted);
}

.standard-note {
  margin-top: 17px;
  padding: 12px 15px;
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.55);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.85;
}

.standard-note strong {
  color: var(--ink-soft);
  font-weight: 500;
}

/* ------------------------------------------------------------------ */
/* settings                                                            */
/* ------------------------------------------------------------------ */

.settings-card {
  padding: 24px 25px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 15px;
}

.settings-card h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.settings-card .desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.profile-editor {
  display: flex;
  align-items: center;
  gap: 17px;
  margin: 20px 0 4px;
}

.profile-editor .avatar {
  --size: 76px;
}

.avatar-edit {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.avatar-edit .hint {
  font-size: 10px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 17px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.field > label,
.field-label {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.field > label .req {
  color: var(--terra);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefa;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

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

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

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: rgba(201, 111, 74, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 111, 74, 0.1);
  background: #fff;
}

.textarea {
  resize: vertical;
  min-height: 86px;
}

.segmented {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: #f4ece0;
  gap: 3px;
}

.segmented button {
  flex: 1;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  transition: all 0.18s ease;
}

.segmented button.active {
  background: var(--card);
  color: var(--terra-dark);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(84, 58, 38, 0.08);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.settings-rows {
  margin-top: 15px;
  border-top: 1px dashed var(--line);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}

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

.settings-row .sr-label {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.settings-row .sr-label small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  background: var(--sage-wash);
  color: var(--sage-deep);
  white-space: nowrap;
}

.status-pill.off {
  background: var(--gold-wash);
  color: #96722c;
}

.status-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.about-text {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.9;
}

.about-text a {
  color: var(--terra-dark);
  border-bottom: 1px solid rgba(201, 111, 74, 0.3);
}

/* ------------------------------------------------------------------ */
/* modal                                                               */
/* ------------------------------------------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(63, 51, 44, 0.32);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fade-in 0.2s ease both;
}

.modal {
  width: min(610px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(50, 34, 22, 0.24);
  overflow: hidden;
  animation: modal-in 0.26s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}

.modal.narrow {
  width: min(430px, 100%);
}

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

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

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

.modal-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.modal-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin-right: -4px;
  margin-top: -3px;
}

.modal-body {
  padding: 17px 26px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 26px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px dashed var(--line);
  background: var(--card);
}

.modal-foot .left {
  margin-right: auto;
  color: var(--muted);
  font-size: 10.5px;
}

.composer-textarea {
  width: 100%;
  min-height: 130px;
  padding: 3px 2px;
  border: 0;
  background: transparent;
  resize: none;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.9;
  outline: none;
}

.composer-textarea::placeholder {
  color: #b8a898;
}

.category-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.category-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffefa;
  color: var(--ink-soft);
  font-size: 11.5px;
  transition: all 0.18s ease;
}

.category-option:hover {
  border-color: var(--line-strong);
}

.category-option.active {
  border-color: color-mix(in srgb, var(--cat) 55%, #fff);
  background: color-mix(in srgb, var(--cat) 11%, #fff);
  color: color-mix(in srgb, var(--cat) 78%, #3f332c);
  font-weight: 500;
}

.category-option .cat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cat);
}

.composer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.date-field {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.date-field svg {
  width: 14px;
  height: 14px;
}

.date-field input {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  padding: 2px 0;
  max-width: 130px;
}

.photo-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.photo-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 11px;
  overflow: hidden;
  background: var(--paper-deep);
  border: 1px solid var(--line);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item .remove {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(43, 33, 26, 0.62);
  color: #fff;
  backdrop-filter: blur(3px);
}

.photo-item .remove svg {
  width: 11px;
  height: 11px;
}

.photo-item .working {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(247, 241, 231, 0.72);
}

.photo-add {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 11px;
  background: rgba(247, 241, 231, 0.4);
  color: var(--muted);
  font-size: 9.5px;
  transition: all 0.18s ease;
}

.photo-add:hover {
  border-color: var(--terra);
  color: var(--terra);
  background: var(--terra-wash);
}

.photo-add svg {
  width: 19px;
  height: 19px;
}

.photo-hint {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9.5px;
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.emoji-option {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fffefa;
  font-size: 17px;
  display: grid;
  place-items: center;
  transition: all 0.16s ease;
}

.emoji-option:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.emoji-option.active {
  border-color: var(--terra);
  background: var(--terra-wash);
  box-shadow: 0 0 0 2px rgba(201, 111, 74, 0.1);
}

.standard-hint {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--sage-wash);
  border: 1px solid #dce8d6;
  color: #5c7358;
  font-size: 10.5px;
  line-height: 1.7;
}

.standard-hint strong {
  font-weight: 600;
}

.confirm-text {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.9;
}

/* ------------------------------------------------------------------ */
/* login                                                               */
/* ------------------------------------------------------------------ */

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-screen::before {
  width: 460px;
  height: 460px;
  left: -160px;
  top: -160px;
  background: radial-gradient(circle, rgba(201, 111, 74, 0.14), transparent 68%);
}

.login-screen::after {
  width: 560px;
  height: 560px;
  right: -210px;
  bottom: -240px;
  background: radial-gradient(circle, rgba(126, 155, 121, 0.17), transparent 68%);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(390px, 100%);
  padding: 38px 34px 32px;
  text-align: center;
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid rgba(234, 223, 207, 0.9);
  border-radius: 30px;
  box-shadow: 0 28px 80px rgba(84, 58, 38, 0.13);
  backdrop-filter: blur(10px);
}

.login-logo {
  width: 58px;
  height: 58px;
  margin: 0 auto 17px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--terra);
  box-shadow: 0 9px 22px rgba(84, 58, 38, 0.08);
}

.login-logo svg {
  width: 38px;
  height: 38px;
}

.login-card h1 {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.login-card .sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}

.login-form {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.login-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.login-input:focus {
  outline: none;
  border-color: rgba(201, 111, 74, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 111, 74, 0.1);
}

.login-error {
  min-height: 18px;
  color: #b5543c;
  font-size: 11px;
  text-align: left;
  padding-left: 3px;
}

.login-error.shake {
  animation: shake 0.35s ease;
}

.login-foot {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-align: center;
}

.login-screen .login-foot {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  margin: 0;
}

/* ------------------------------------------------------------------ */
/* lightbox                                                            */
/* ------------------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 23, 18, 0.9);
  backdrop-filter: blur(10px);
  animation: fade-in 0.2s ease both;
}

.lightbox-stage {
  position: relative;
  width: min(1100px, calc(100vw - 120px));
  height: min(82vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  right: 22px;
  top: 20px;
  z-index: 2;
  color: rgba(255, 250, 244, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 250, 244, 0.9);
  display: grid;
  place-items: center;
  transition: background 0.18s ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.17);
}

.lightbox-nav.prev {
  left: 18px;
}

.lightbox-nav.next {
  right: 18px;
}

.lightbox-nav svg {
  width: 20px;
  height: 20px;
}

.lightbox-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: center;
  color: rgba(255, 250, 244, 0.68);
  font-size: 11px;
  letter-spacing: 0.12em;
}

/* ------------------------------------------------------------------ */
/* toast                                                               */
/* ------------------------------------------------------------------ */

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

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(63, 51, 44, 0.94);
  color: #fffaf4;
  font-size: 12px;
  line-height: 1.6;
  box-shadow: 0 12px 32px rgba(40, 28, 18, 0.22);
  animation: toast-in 0.25s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}

.toast.out {
  animation: toast-out 0.22s ease both;
}

.toast svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: #b9d0b3;
}

.toast.error svg {
  color: #f0b6a4;
}

/* ------------------------------------------------------------------ */
/* skeleton / misc                                                     */
/* ------------------------------------------------------------------ */

.skeleton {
  border-radius: 20px;
  background: linear-gradient(
    100deg,
    rgba(255, 253, 249, 0.5) 20%,
    rgba(255, 255, 255, 0.86) 40%,
    rgba(255, 253, 249, 0.5) 60%
  );
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
  border: 1px solid rgba(234, 223, 207, 0.7);
}

.skeleton.hero {
  height: 218px;
  border-radius: 30px;
  margin-bottom: 26px;
}

.skeleton.line {
  height: 16px;
  border-radius: 8px;
  margin-bottom: 9px;
}

.skeleton.post {
  height: 170px;
  margin-bottom: 15px;
}

.skeleton.chart {
  height: 300px;
  margin-bottom: 15px;
}

.noscript {
  padding: 40px;
  text-align: center;
}

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

@keyframes breathe {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

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

/* ------------------------------------------------------------------ */
/* app view alignment                                                  */
/* ------------------------------------------------------------------ */

/* sidebar ---------------------------------------------------------- */

.side-profile > .avatar {
  margin-bottom: 13px;
  box-shadow: 0 8px 20px rgba(150, 104, 74, 0.16);
}

.side-name {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.side-age {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--terra);
}

.side-stats > div > strong {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.1;
  color: var(--ink);
}

.side-stats > div > span {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.side-foot svg {
  width: 12px;
  height: 12px;
}

.avatar-fallback,
.avatar-initial {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fffaf2;
  font-family: var(--serif);
  font-size: calc(var(--size, 46px) * 0.4);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.avatar-sm {
  --size: 34px;
}

.avatar-xl {
  --size: 78px;
}

/* shared page bits ------------------------------------------------ */

.page-sub {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

.section-note {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hello-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 21px;
}

.hello-actions .btn {
  min-height: 39px;
  padding: 0 15px;
  font-size: 12.5px;
}

.hello-age {
  position: absolute;
  right: 9px;
  bottom: 8px;
  z-index: 2;
  padding: 4px 9px;
  border: 1px solid rgba(201, 111, 74, 0.14);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.9);
  box-shadow: 0 3px 10px rgba(92, 64, 49, 0.07);
  color: var(--terra-dark);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.cat-emoji {
  font-size: 11px;
  line-height: 1;
}

.cat-chip.small {
  padding: 2.5px 7px;
  font-size: 9.5px;
}

/* timeline ------------------------------------------------------- */

.timeline-group {
  margin-bottom: 6px;
}

.timeline-card {
  position: relative;
}

.tl-del {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 27px;
  height: 27px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.18s ease, color 0.18s ease;
}

.timeline-card:hover .tl-del,
.tl-del:focus-visible {
  opacity: 1;
}

.tl-del:hover {
  color: var(--terra);
}

/* growth standards ------------------------------------------------ */

.std-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
}

.std-dot.height {
  background: var(--terra);
}

.std-dot.weight {
  background: var(--sage);
}

.std-today-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.std-latest {
  display: block;
  margin-top: 7px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.std-latest em {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--terra-wash);
  color: var(--terra-dark);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 600;
}

.std-latest.muted {
  color: var(--muted);
}

/* charts --------------------------------------------------------- */

.chart-card {
  position: relative;
}

.chart-grid line {
  stroke: rgba(234, 223, 207, 0.62);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-band {
  fill: #e3eadb;
  opacity: 0.72;
}

.chart-median {
  fill: none;
  stroke: #94a98c;
  stroke-width: 1.5;
  stroke-dasharray: 4 3.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.chart-child {
  fill: none;
  stroke: var(--terra);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-dot {
  fill: var(--terra);
  stroke: var(--card);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-hover {
  opacity: 0;
  transition: opacity 0.12s ease;
}

.chart-hover-line {
  stroke: rgba(201, 111, 74, 0.42);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.chart-hover-dot {
  fill: var(--card);
  stroke: var(--terra);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.chart-axis line {
  stroke: #d9cbb8;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-labels text {
  fill: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
}

.chart-unit {
  fill: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.chart-latest-label {
  fill: var(--terra-dark);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
}

.chart-tooltip.show {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 9px));
}

.chart-tooltip-date {
  font-size: 9.5px;
  letter-spacing: 0.02em;
  color: #d8c6b6;
}

.chart-tooltip-value {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: #fffaf4;
}

.chart-tooltip-value small {
  margin-left: 2px;
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 500;
  color: #d8c6b6;
}

.chart-tooltip-value span {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(234, 241, 230, 0.16);
  color: #dfe9d8;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
  vertical-align: 2px;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 210px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.chart-empty-note {
  padding: 14px 4px 2px;
  text-align: center;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

/* history -------------------------------------------------------- */

.history-row .h-date strong {
  display: block;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
}

.history-row .h-date small {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  color: var(--muted);
}

.history-row .h-value em {
  align-self: center;
}

.history-delete {
  align-self: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.18s ease, color 0.18s ease;
}

.history-row:hover .history-delete,
.history-delete:focus-visible {
  opacity: 1;
}

.history-delete:hover {
  color: var(--terra);
}

.history-note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding-top: 7px;
  border-top: 1px dashed rgba(234, 223, 207, 0.9);
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.65;
}

/* settings ------------------------------------------------------- */

.settings-head {
  margin-bottom: 18px;
}

.settings-head h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.settings-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.settings-head code,
.settings-tip code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--paper);
  color: var(--terra-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.settings-row-label {
  min-width: 0;
  padding-right: 14px;
}

.settings-row-label strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.settings-row-label span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.settings-tip {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.settings-tip svg {
  flex: none;
  width: 13px;
  height: 13px;
  margin-top: 2px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px;
  margin-top: 19px;
}

.form-hint {
  color: var(--muted);
  font-size: 10.5px;
}

.form-hint.error {
  color: var(--terra-dark);
}

.about-card > p {
  margin-bottom: 11px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.9;
}

.about-card > p strong {
  color: var(--ink);
  font-weight: 600;
}

.about-sign {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  color: var(--terra) !important;
  font-family: var(--serif);
  font-size: 12px !important;
  letter-spacing: 0.04em;
}

.about-sign svg {
  width: 12px;
  height: 12px;
}

/* profile editor ------------------------------------------------- */

.profile-editor {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 19px;
  border-bottom: 1px dashed var(--line);
}

.profile-editor-actions {
  min-width: 0;
}

.profile-editor-buttons {
  display: flex;
  align-items: center;
  gap: 11px;
}

.profile-editor-actions p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.text-button {
  padding: 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  text-decoration: underline;
  text-decoration-color: rgba(154, 137, 123, 0.45);
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--terra);
}

.btn-small {
  min-height: 32px;
  padding: 0 11px;
  font-size: 11px;
  border-radius: 10px;
}

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

.field-label em {
  margin-left: 2px;
  color: var(--terra);
  font-style: normal;
}

.input-with-unit {
  position: relative;
}

.input-with-unit .input {
  padding-right: 40px;
}

.input-with-unit > span {
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* measurement hint ---------------------------------------------- */

.measure-hint {
  min-height: 60px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(234, 223, 207, 0.85);
  border-radius: 15px;
  background: rgba(247, 241, 231, 0.55);
  font-size: 10.5px;
  line-height: 1.75;
}

.measure-hint-main {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.measure-hint-row {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
}

.measure-hint-row + .measure-hint-row {
  margin-top: 2px;
}

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

.measure-hint-muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
}

.measure-hint-warn {
  color: var(--terra-dark);
  font-size: 10px;
}

/* onboarding ----------------------------------------------------- */

.onboarding-head {
  margin-bottom: 20px;
  text-align: center;
}

.onboarding-mark {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 11px;
  border-radius: 18px;
  background: var(--paper);
}

.onboarding-mark .brand-mark {
  width: 40px;
  height: 40px;
}

.onboarding-head .eyebrow {
  margin-bottom: 5px;
}

.onboarding-head h2 {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.onboarding-head p:last-child {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.form-error {
  margin-top: 12px;
  color: var(--terra-dark);
  font-size: 11px;
  line-height: 1.6;
}

/* modal details -------------------------------------------------- */

.modal-foot-note {
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.modal-foot-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.modal-foot-actions-wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  width: 100%;
  margin-left: 0;
}

.confirm-modal .modal-body {
  padding-top: 26px;
  padding-bottom: 18px;
  text-align: center;
}

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

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

.confirm-modal h2 {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.confirm-modal p {
  max-width: 290px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}

.confirm-detail {
  color: var(--ink-soft) !important;
  font-size: 10.5px !important;
}

.composer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 9.5px;
}

.composer-count-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.category-picker-label {
  margin: 16px 0 9px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(50, 38, 30, 0.6);
  color: #fff;
  backdrop-filter: blur(5px);
}

.photo-remove svg {
  width: 11px;
  height: 11px;
}

.photo-item.photo-working {
  display: grid;
  place-items: center;
  background: var(--paper);
}

.photo-working .spinner {
  width: 18px;
  height: 18px;
  border-color: rgba(201, 111, 74, 0.2);
  border-top-color: var(--terra);
}

/* login ---------------------------------------------------------- */

.login-note {
  margin: 13px 0 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.85;
}

.login-card .login-foot {
  position: static;
  margin-top: 17px;
  font-size: 9.5px;
}

.login-logo .brand-mark {
  width: 46px;
  height: 46px;
}

.login-card .sub {
  margin-top: 4px;
}

.login-form .btn {
  margin-top: 4px;
}

.login-input-wrap .login-input {
  width: 100%;
}

/* lightbox ------------------------------------------------------- */

.lightbox-close {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(30, 23, 19, 0.6);
  color: #fff;
  backdrop-filter: blur(8px);
}

.lightbox-close svg {
  width: 18px;
  height: 18px;
}

.lightbox-stage {
  display: grid;
  place-items: center;
  width: 100%;
  height: calc(100vh - 100px);
  padding: 18px 70px;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.lightbox-meta {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(30, 23, 19, 0.55);
  color: rgba(255, 250, 242, 0.85);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

/* loading / feed ------------------------------------------------- */

.page-loading {
  padding-top: 4px;
}

.feed-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 38px 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.feed-loading .spinner {
  border-color: rgba(126, 155, 121, 0.2);
  border-top-color: var(--sage);
}

.feed-end {
  padding: 24px 0 8px;
  text-align: center;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.22em;
}

.skeleton-hero {
  height: 218px;
  border-radius: 30px;
  margin-bottom: 26px;
}

.skeleton-card {
  height: 150px;
  margin-bottom: 14px;
}

.skeleton-card.short {
  height: 100px;
}

/* toast polish --------------------------------------------------- */

/* ------------------------------------------------------------------ */
/* responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1040px) {
  .shell {
    grid-template-columns: 244px minmax(0, 1fr);
  }
  .sidebar {
    padding-left: 24px;
    padding-right: 16px;
  }
  .main {
    padding-right: 26px;
  }
  .hello-copy {
    width: 66%;
  }
}

@media (max-width: 860px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .main {
    padding: 0;
  }
  .page {
    padding: 22px 20px calc(92px + env(safe-area-inset-bottom));
    width: min(680px, 100%);
  }
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    padding: 0 20px;
    background: rgba(247, 241, 231, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(234, 223, 207, 0.65);
  }
  .mobile-header .brand {
    gap: 8px;
  }
  .mobile-header .brand-mark {
    width: 31px;
    height: 31px;
    border-radius: 10px;
  }
  .mobile-header .brand-mark svg {
    width: 21px;
    height: 21px;
  }
  .mobile-header .brand-text strong {
    font-size: 18px;
  }
  .mobile-header .brand-text small {
    display: none;
  }
  .mobile-header .avatar {
    --size: 34px;
  }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 249, 0.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--line);
  }
  .bottom-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
    color: var(--muted);
    font-size: 9.5px;
    letter-spacing: 0.04em;
    border-radius: 10px;
    transition: color 0.18s ease;
  }
  .bottom-link svg {
    width: 21px;
    height: 21px;
    opacity: 0.8;
  }
  .bottom-link.active {
    color: var(--terra-dark);
  }
  .bottom-link.active svg {
    opacity: 1;
  }
  .page-head {
    align-items: flex-start;
    margin-bottom: 22px;
  }
  .page-head h1 {
    font-size: 29px;
  }
  .page-head .btn {
    min-height: 37px;
    padding: 7px 14px;
    font-size: 12px;
  }
  .hello-card {
    min-height: 196px;
    padding: 25px 24px 23px;
    border-radius: 26px;
  }
  .hello-copy {
    width: 68%;
  }
  .hello-copy h1 {
    font-size: clamp(27px, 7vw, 34px);
  }
  .hello-sub {
    font-size: 11.5px;
    line-height: 1.8;
  }
  .hello-art {
    width: 43%;
    right: -16px;
    bottom: -10px;
    opacity: 0.82;
  }
  .toast-root {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal,
  .modal.narrow,
  .modal.wide {
    width: 100%;
    max-height: 92vh;
    border-radius: 26px 26px 0 0;
    animation: sheet-in 0.28s cubic-bezier(0.22, 0.8, 0.28, 1) both;
  }
  .modal-body {
    padding-bottom: 22px;
  }
  .standards-card {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 20px;
  }
  .std-today {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px dashed rgba(126, 110, 90, 0.2);
  }
  .std-today strong {
    font-size: 22px;
    margin-top: 0;
  }
  .std-today .note {
    margin-top: 0;
    max-width: 46%;
    text-align: right;
  }
  .std-block .std-value {
    font-size: 25px;
  }
  .history-row {
    grid-template-columns: 82px 1fr 1fr 28px;
    padding: 11px 16px;
    gap: 7px;
  }
  .history-head {
    padding-inline: 18px;
  }
  .timeline::before {
    left: 21px;
  }
  .timeline-node {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 18px;
  }
  .timeline-year {
    padding-left: 50px;
  }
  .timeline-year::before {
    left: 17px;
  }
  .timeline-item {
    gap: 11px;
  }
  .timeline-card .tl-del {
    opacity: 1;
  }
  .lightbox-stage {
    width: calc(100vw - 24px);
    height: 78vh;
  }
  .lightbox-nav {
    width: 38px;
    height: 38px;
  }
  .lightbox-nav.prev {
    left: 6px;
  }
  .lightbox-nav.next {
    right: 6px;
  }
  .lightbox-close {
    right: 12px;
    top: 12px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }
  .page {
    padding-left: 15px;
    padding-right: 15px;
  }
  .mobile-header {
    padding-inline: 16px;
  }
  .hello-card {
    min-height: 184px;
    padding: 22px 20px;
  }
  .hello-copy {
    width: 72%;
  }
  .hello-copy h1 {
    margin-top: 9px;
    font-size: 27px;
    line-height: 1.38;
  }
  .hello-sub {
    margin-top: 9px;
    font-size: 10.5px;
  }
  .hello-actions {
    gap: 8px;
    margin-top: 17px;
  }
  .hello-actions .btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 11.5px;
  }
  .hello-art {
    width: 36%;
    right: -24px;
    opacity: 0.42;
  }
  .hello-age {
    right: 30px;
    bottom: 20px;
    font-size: 9.5px;
  }
  .section {
    margin-top: 27px;
  }
  .section-head h2 {
    font-size: 19px;
  }
  .milestone-strip {
    grid-auto-columns: 172px;
  }
  .post-card {
    padding: 17px 16px 13px;
    border-radius: 20px;
  }
  .post-head {
    gap: 8px;
  }
  .post-head .avatar {
    --size: 35px;
  }
  .post-text {
    font-size: 14px;
    line-height: 1.9;
  }
  .cat-chip {
    padding: 3px 7px;
    font-size: 9.5px;
  }
  .post-menu-wrap {
    margin-right: -5px;
  }
  .photo-grid {
    margin-top: 12px;
  }
  .post-foot {
    margin-top: 10px;
  }
  .page-head {
    gap: 10px;
  }
  .page-head h1 {
    font-size: 25px;
  }
  .page-head .sub {
    font-size: 11px;
  }
  .page-head .btn .label-full {
    display: none;
  }
  .standards-card {
    padding: 18px 17px;
    border-radius: 22px;
  }
  .std-block .std-value {
    font-size: 22px;
  }
  .std-block .std-range {
    font-size: 9.5px;
  }
  .chart-card {
    padding: 17px 14px 12px;
    border-radius: 20px;
  }
  .chart-title {
    gap: 6px;
  }
  .chart-title h2 {
    font-size: 17px;
  }
  .legend {
    gap: 8px;
    font-size: 8.5px;
  }
  .legend .line,
  .legend .band {
    width: 11px;
  }
  .chart-foot {
    font-size: 8.5px;
  }
  .history-row {
    grid-template-columns: 66px 1fr 1fr 26px;
    padding: 10px 13px;
    font-size: 11px;
  }
  .h-value strong {
    font-size: 15px;
  }
  .h-value em {
    display: none;
  }
  .settings-card {
    padding: 20px 17px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .profile-editor {
    gap: 13px;
  }
  .profile-editor .avatar {
    --size: 64px;
  }
  .modal-head {
    padding: 20px 19px 0;
  }
  .modal-head h2 {
    font-size: 21px;
  }
  .modal-body {
    padding: 15px 19px 20px;
  }
  .modal-foot {
    padding: 12px 19px calc(15px + env(safe-area-inset-bottom));
  }
  .composer-textarea {
    min-height: 108px;
  }
  .photo-picker {
    gap: 5px;
  }
  .growth-cta {
    padding: 14px 15px;
  }
  .growth-cta p {
    font-size: 11px;
  }
  .growth-cta .btn {
    padding: 7px 12px;
    font-size: 11px;
  }
  .login-card {
    padding: 32px 24px 26px;
  }
  .timeline-card {
    padding: 14px 14px 13px;
  }
  .timeline-card h3 {
    font-size: 17px;
  }
}

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

@keyframes sheet-in {
  from {
    opacity: 0.4;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 560px) {
  .chart-labels text,
  .chart-latest-label {
    font-size: 17px;
  }
  .chart-unit {
    font-size: 13px;
  }
  .chart-dot {
    r: 5px;
  }
}
