/* 慢慢 · 康复手账 */
:root {
  --paper: #f3eee2;
  --paper-deep: #ebe3d3;
  --card: #fffcf4;
  --ink: #2d382f;
  --ink-soft: #445144;
  --muted: #687265;
  --muted-light: #8b9385;
  --line: rgba(45, 56, 47, 0.11);
  --sage: #7d9975;
  --sage-deep: #5c7756;
  --sage-soft: #e4ecd9;
  --sage-pale: #eff4e8;
  --clay: #c18565;
  --clay-soft: #f2e1d6;
  --sun: #e8be88;
  --cream: #f7f0e1;
  --day-card: #2d392f;
  --shadow-soft: 0 22px 55px -38px rgba(55, 71, 54, 0.48);
  --radius: 26px;
  --font-sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
}

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

[hidden] {
  display: none !important;
}

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

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(58rem 42rem at 92% -18%, rgba(183, 204, 171, 0.48), transparent 63%),
    radial-gradient(48rem 34rem at -16% 30%, rgba(233, 206, 180, 0.4), transparent 60%),
    linear-gradient(145deg, #f5f0e5 0%, #f2ecdf 54%, #f0e9da 100%);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  margin: 0;
  border: 0;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 3px;
}

button:disabled {
  cursor: default;
}

body.dialog-open {
  overflow: hidden;
}

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

svg {
  display: block;
}

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

.skip-link {
  position: fixed;
  z-index: 999;
  top: 10px;
  left: 50%;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--cream);
  background: var(--ink);
  font-size: 12px;
  text-decoration: none;
  transform: translate(-50%, -160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.paper-grain {
  position: fixed;
  z-index: 90;
  inset: 0;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.72'/%3E%3C/svg%3E");
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.ambient-one {
  top: -12rem;
  right: -13rem;
  width: 32rem;
  height: 32rem;
  background: radial-gradient(circle, rgba(154, 181, 142, 0.22), transparent 68%);
}

.ambient-two {
  bottom: -15rem;
  left: -15rem;
  width: 35rem;
  height: 35rem;
  background: radial-gradient(circle, rgba(211, 166, 135, 0.17), transparent 68%);
}

.app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(36px + env(safe-area-inset-bottom));
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: rise-in 0.55s both;
}

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

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--cream);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.16), transparent 48%),
    var(--ink);
  box-shadow: 0 8px 18px -11px rgba(35, 49, 38, 0.7);
  transform: rotate(-4deg);
}

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

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

.brand-name {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.1em;
  line-height: 1.25;
}

.brand-sub {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
  line-height: 1.3;
}

.topbar-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.together-shortcut {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: var(--sage-deep);
  background: rgba(255, 252, 244, 0.68);
  box-shadow: 0 9px 22px -20px rgba(45, 56, 47, 0.55);
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.together-shortcut svg {
  width: 18px;
  height: 18px;
}

.together-shortcut:hover {
  background: var(--card);
}

.together-shortcut:active {
  transform: scale(0.92);
}

.streak-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 31px;
  padding: 6px 11px 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: var(--sage-deep);
  background: rgba(255, 252, 244, 0.68);
  box-shadow: 0 9px 22px -20px rgba(45, 56, 47, 0.55);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.streak-chip.is-empty {
  color: var(--muted);
}

.streak-icon {
  width: 15px;
  height: 15px;
  color: var(--sage);
}

.streak-text b {
  margin: 0 1px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

/* Greeting */
.greeting {
  position: relative;
  margin-top: 32px;
  padding-right: 54px;
  animation: rise-in 0.62s 0.05s both;
}

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

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.15em;
  line-height: 1.5;
}

.greeting h1 {
  margin-top: 9px;
  font-size: clamp(31px, 8.3vw, 39px);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.highlight {
  position: relative;
  z-index: 0;
  display: inline-block;
  color: var(--sage-deep);
}

.highlight::before {
  position: absolute;
  z-index: -1;
  right: -4px;
  bottom: 1px;
  left: -3px;
  height: 12px;
  border-radius: 52% 44% 48% 45%;
  background: var(--sage-soft);
  content: "";
  transform: rotate(-1.5deg);
}

.lede {
  max-width: 320px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  line-height: 1.75;
}

.botanical {
  position: absolute;
  z-index: 0;
  right: -8px;
  bottom: -14px;
  width: 106px;
  height: auto;
  color: var(--sage);
  opacity: 0.74;
  pointer-events: none;
}

/* Week */
.week-card {
  margin-top: 20px;
  padding: 15px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  background: rgba(255, 252, 244, 0.67);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise-in 0.62s 0.1s both;
}

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

.week-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.week-label {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--sage-deep);
  background: var(--sage-soft);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.4;
}

.week-range {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-nav {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
}

.icon-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(45, 56, 47, 0.09);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 252, 244, 0.5);
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.icon-button:hover {
  background: var(--card);
}

.icon-button:active {
  transform: scale(0.92);
}

.icon-button:disabled {
  opacity: 0.28;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  margin-top: 13px;
}

.day {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 1px 6px;
  border-radius: 15px;
  color: var(--muted);
  background: transparent;
  transition: color 0.22s ease, background 0.22s ease, transform 0.2s ease, opacity 0.2s ease;
}

.day:active:not(:disabled) {
  transform: scale(0.94);
}

.day-weekday {
  font-size: 9.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.day-date {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color 0.22s ease, background 0.22s ease;
}

.day.is-today .day-date {
  color: var(--sage-deep);
  background: var(--sage-soft);
  font-weight: 750;
}

.day.is-today .day-weekday {
  color: var(--sage-deep);
  font-weight: 750;
}

.day-progress {
  display: block;
  overflow: hidden;
  width: 18px;
  height: 2.5px;
  border-radius: 999px;
  background: rgba(45, 56, 47, 0.1);
}

.day-progress i {
  display: block;
  width: calc(var(--progress, 0) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--sage);
  transition: width 0.35s ease;
}

.day.is-selected {
  color: var(--cream);
  background: var(--ink);
  box-shadow: 0 8px 20px -14px rgba(38, 52, 40, 0.75);
}

.day.is-selected .day-date {
  color: var(--cream);
  background: transparent;
}

.day.is-selected .day-weekday {
  color: rgba(247, 240, 225, 0.62);
}

.day.is-selected .day-progress {
  background: rgba(247, 240, 225, 0.2);
}

.day.is-selected .day-progress i {
  background: var(--sun);
}

.day.is-selected.is-today .day-date {
  color: var(--cream);
  background: rgba(247, 240, 225, 0.1);
}

.day:disabled {
  opacity: 0.32;
}

/* Main day card */
.day-card {
  position: relative;
  overflow: hidden;
  margin-top: 16px;
  padding: 22px 20px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  color: var(--cream);
  background:
    radial-gradient(110% 90% at 105% -15%, rgba(155, 181, 141, 0.34), transparent 56%),
    radial-gradient(100% 90% at -15% 110%, rgba(193, 133, 101, 0.13), transparent 50%),
    linear-gradient(145deg, #374438 0%, #2e3a30 57%, #29352c 100%);
  box-shadow:
    0 30px 58px -38px rgba(35, 47, 36, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: rise-in 0.66s 0.17s both;
}

.day-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(241, 237, 220, 0.08);
  border-radius: 50%;
}

.orbit-one {
  top: -124px;
  right: -98px;
  width: 270px;
  height: 270px;
}

.orbit-two {
  top: -76px;
  right: -52px;
  width: 178px;
  height: 178px;
  border-color: rgba(241, 237, 220, 0.055);
}

.tiny-star {
  position: absolute;
  color: rgba(233, 208, 172, 0.55);
  font-family: var(--font-serif);
  font-size: 11px;
}

.star-one {
  top: 34px;
  right: 32px;
}

.star-two {
  top: 17px;
  right: 76px;
  color: rgba(241, 237, 220, 0.3);
  font-size: 16px;
}

.day-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.day-heading {
  min-width: 0;
  padding-top: 3px;
}

.day-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(247, 240, 225, 0.5);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.5;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(151, 177, 137, 0.1);
}

.day-head h2 {
  margin-top: 7px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.progress-ring {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  place-items: center;
}

.progress-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-value {
  fill: none;
  stroke-width: 4;
}

.ring-track {
  stroke: rgba(247, 240, 225, 0.13);
}

.ring-value {
  stroke: #d8e4cc;
  stroke-linecap: round;
  stroke-dasharray: 157.08;
  stroke-dashoffset: 157.08;
  transition: stroke-dashoffset 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.ring-text {
  position: relative;
  color: var(--cream);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.progress-ring.is-complete .ring-value {
  stroke: var(--sun);
}

/* Habit tiles */
.habit-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.habit {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(247, 240, 225, 0.1);
  border-radius: 18px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.habit-icon {
  display: grid;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(247, 240, 225, 0.08);
  border-radius: 14px;
  color: #dce6d2;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.habit-icon svg {
  width: 29px;
  height: 29px;
}

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

.habit-name {
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-meta {
  overflow: hidden;
  color: rgba(247, 240, 225, 0.47);
  font-size: 10.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.habit-check {
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1.5px solid rgba(247, 240, 225, 0.26);
  border-radius: 50%;
  color: var(--cream);
  background: transparent;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.habit-check svg {
  width: 15px;
  height: 15px;
}

.habit-check path {
  stroke-dasharray: 23;
  stroke-dashoffset: 23;
  transition: stroke-dashoffset 0.3s 0.08s ease;
}

.habit.is-done {
  border-color: transparent;
  color: var(--ink);
  background: #f7f0e1;
  box-shadow: 0 10px 22px -18px rgba(0, 0, 0, 0.55);
}

.habit.is-done .habit-icon {
  border-color: transparent;
  color: var(--sage-deep);
  background: #e5ebd9;
}

.habit.is-done .habit-meta {
  color: rgba(45, 56, 47, 0.55);
}

.habit.is-done .habit-check {
  border-color: var(--sage-deep);
  background: var(--sage-deep);
}

.habit.is-done .habit-check path {
  stroke-dashoffset: 0;
}

.habit.just-checked .habit-check {
  animation: check-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.habit.just-checked {
  animation: tile-glow 0.6s ease;
}

.habit:active {
  transform: scale(0.992);
}

.habit-empty {
  padding: 20px 16px;
  border: 1px dashed rgba(247, 240, 225, 0.23);
  border-radius: 18px;
  color: rgba(247, 240, 225, 0.65);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

/* Free-form extra movement */
.extra-log {
  position: relative;
  z-index: 1;
  margin-top: 13px;
  padding: 10px 12px 11px;
  border: 1px dashed rgba(247, 240, 225, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.22s ease, border-color 0.22s ease;
}

.extra-log:focus-within {
  border-color: rgba(218, 231, 207, 0.43);
  border-style: solid;
  background: rgba(255, 255, 255, 0.055);
}

.extra-log.has-value {
  border-style: solid;
  border-color: rgba(218, 231, 207, 0.2);
  background: rgba(218, 231, 207, 0.065);
}

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

.extra-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(233, 240, 226, 0.74);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.extra-label svg {
  width: 13px;
  height: 13px;
  color: #b6cba8;
}

.extra-note {
  color: rgba(247, 240, 225, 0.3);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.extra-input {
  width: 100%;
  margin-top: 5px;
  padding: 1px 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: var(--cream);
  background: transparent;
  font-size: 16px;
  line-height: 1.5;
  caret-color: var(--sun);
  -webkit-appearance: none;
  appearance: none;
}

.extra-input::placeholder {
  color: rgba(247, 240, 225, 0.3);
  font-size: 12px;
}

.extra-input:focus {
  outline: 0;
}

/* Day card footer */
.day-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.day-encouragement {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 6px;
  padding-top: 4px;
  color: rgba(247, 240, 225, 0.6);
  font-size: 10.5px;
  line-height: 1.65;
}

.day-encouragement svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: -2px;
  color: #b4c9a6;
}

.day-foot-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.soft-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: 1px solid rgba(247, 240, 225, 0.12);
  border-radius: 999px;
  color: rgba(247, 240, 225, 0.7);
  background: rgba(255, 255, 255, 0.045);
  font-size: 9.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, color 0.2s ease;
}

.soft-button svg {
  width: 13px;
  height: 13px;
}

.soft-button:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.09);
}

.text-button {
  padding: 3px 0;
  color: var(--sage-deep);
  background: transparent;
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(92, 119, 86, 0.35);
  text-underline-offset: 3px;
}

.day-foot .text-button {
  padding: 0;
  color: rgba(245, 216, 179, 0.8);
  font-size: 9.5px;
  text-decoration-color: rgba(245, 216, 179, 0.25);
}

/* Shared section styles */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-kicker {
  color: var(--sage-deep);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1.5;
}

.section-head h2 {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.section-date {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(45, 56, 47, 0.055);
  font-size: 9px;
  font-weight: 550;
  letter-spacing: 0.02em;
}

/* Medication */
.med-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background:
    radial-gradient(100% 100% at 100% 0%, rgba(255, 252, 244, 0.76), transparent 58%),
    linear-gradient(135deg, #f2e5d5 0%, #f5ecdf 100%);
  box-shadow: var(--shadow-soft);
  animation: rise-in 0.66s 0.14s both;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.med-card.is-taken {
  border-color: rgba(125, 153, 117, 0.25);
  background:
    radial-gradient(100% 100% at 100% 0%, rgba(255, 252, 244, 0.74), transparent 58%),
    linear-gradient(135deg, #e8eddd 0%, #f3ecdf 100%);
}

.med-main {
  display: flex;
  flex: 1 1 200px;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.med-icon {
  display: grid;
  flex: 0 0 auto;
  width: 41px;
  height: 41px;
  place-items: center;
  border-radius: 13px;
  color: #9d775c;
  background: rgba(255, 252, 244, 0.66);
  transition: color 0.25s ease, background 0.25s ease;
}

.med-icon svg {
  width: 27px;
  height: 27px;
}

.med-card.is-taken .med-icon {
  color: var(--sage-deep);
  background: rgba(255, 252, 244, 0.74);
}

.med-copy {
  min-width: 0;
}

.med-copy .section-kicker {
  color: #9a785d;
  font-size: 8.5px;
}

.med-copy h2 {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.med-hint {
  margin-top: 2px;
  color: #96856f;
  font-size: 9px;
  line-height: 1.55;
}

.med-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.med-week-stat {
  color: #9b8a77;
  font-size: 8.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.med-toggle {
  display: inline-flex;
  min-height: 37px;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 8px;
  border: 1px solid rgba(137, 103, 78, 0.14);
  border-radius: 999px;
  color: #765d49;
  background: rgba(255, 252, 244, 0.84);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease, transform 0.2s ease;
}

.med-toggle:active {
  transform: scale(0.96);
}

.med-toggle-icon {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1.3px solid rgba(118, 93, 73, 0.28);
  border-radius: 50%;
  color: var(--cream);
  transition: background 0.22s ease, border-color 0.22s ease;
}

.med-toggle-icon svg {
  width: 13px;
  height: 13px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.med-toggle[aria-pressed="true"] {
  border-color: transparent;
  color: var(--cream);
  background: var(--sage-deep);
}

.med-toggle[aria-pressed="true"] .med-toggle-icon {
  border-color: rgba(247, 240, 225, 0.46);
  background: rgba(255, 255, 255, 0.08);
}

.med-toggle[aria-pressed="true"] .med-toggle-icon svg {
  opacity: 1;
  transform: scale(1);
}

.med-toggle.just-checked {
  animation: check-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 400px) {
  .med-actions {
    flex: 1 0 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 1px;
  }

  .med-week-stat {
    padding-left: 2px;
  }
}

/* Doctor's memo */
.doctor-card {
  position: relative;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  background:
    radial-gradient(100% 80% at 0% 0%, rgba(255, 252, 244, 0.72), transparent 55%),
    linear-gradient(145deg, #f1e5d4 0%, #f5ecdd 58%, #f1e9da 100%);
  box-shadow: var(--shadow-soft);
  animation: rise-in 0.66s 0.18s both;
}

.doctor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.doctor-head .section-kicker {
  color: #947257;
}

.doctor-head h2 {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.doctor-saved {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #8c7b67;
  background: rgba(255, 252, 244, 0.52);
  font-size: 8.5px;
  font-weight: 550;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.doctor-saved.is-fresh {
  color: var(--sage-deep);
}

.doctor-paper {
  position: relative;
  margin-top: 13px;
  overflow: hidden;
  border: 1px solid rgba(150, 117, 85, 0.1);
  border-radius: 15px;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(143, 111, 82, 0.09) 31px,
      rgba(143, 111, 82, 0.09) 32px
    ),
    rgba(255, 252, 244, 0.55);
}

.doctor-quote {
  position: absolute;
  top: 4px;
  right: 12px;
  color: rgba(177, 139, 107, 0.3);
  font-family: var(--font-serif);
  font-size: 39px;
  line-height: 1;
  pointer-events: none;
}

.doctor-paper textarea {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 129px;
  padding: 11px 14px 13px;
  border: 0;
  outline: 0;
  color: #4d4339;
  background: transparent;
  font-size: 16px;
  line-height: 2;
  resize: none;
  caret-color: var(--clay);
  -webkit-appearance: none;
  appearance: none;
}

.doctor-paper textarea::placeholder {
  color: #a29483;
  font-size: 12px;
}

.doctor-paper:focus-within {
  border-color: rgba(150, 117, 85, 0.25);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(143, 111, 82, 0.09) 31px,
      rgba(143, 111, 82, 0.09) 32px
    ),
    rgba(255, 252, 244, 0.72);
}

.doctor-foot {
  margin-top: 8px;
  color: #9b8a77;
  font-size: 8.5px;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

/* Notes */
.note-card {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  background: rgba(255, 252, 244, 0.85);
  box-shadow: var(--shadow-soft);
  animation: rise-in 0.66s 0.18s both;
}

.feeling-block {
  margin-top: 17px;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.field-label span {
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 500;
}

.feelings {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.feeling {
  display: inline-flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: #f8f3e9;
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.feeling:active {
  transform: scale(0.97);
}

.feeling-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-light);
  transition: background 0.2s ease;
}

.feeling-dot.good {
  background: #91aa84;
}

.feeling-dot.tight {
  background: #d0ac74;
}

.feeling-dot.sore {
  background: #c38e78;
}

.feeling[data-feeling="good"].is-selected {
  border-color: #bccdaf;
  color: #4f6848;
  background: #e5edda;
}

.feeling[data-feeling="tight"].is-selected {
  border-color: #dec79d;
  color: #765d32;
  background: #f4e7cf;
}

.feeling[data-feeling="sore"].is-selected {
  border-color: #ddbcad;
  color: #835341;
  background: #f3e0d7;
}

.feeling.is-selected .feeling-dot {
  background: currentColor;
}

.note-field {
  display: block;
  margin-top: 14px;
}

.note-field textarea {
  display: block;
  width: 100%;
  min-height: 76px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  outline: 0;
  color: var(--ink);
  background: #f8f3e9;
  font-size: 16px;
  line-height: 1.65;
  resize: none;
  transition: background 0.2s ease, border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.note-field textarea::placeholder {
  color: #9ca294;
  font-size: 12px;
}

.note-field textarea:focus {
  border-color: rgba(125, 153, 117, 0.48);
  background: #fbf7ee;
}

.note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.5;
}

.note-saved {
  transition: color 0.2s ease;
}

.note-saved.is-fresh {
  color: var(--sage-deep);
}

/* Weekly summary */
.summary-card {
  position: relative;
  overflow: hidden;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--radius);
  background:
    radial-gradient(100% 100% at 100% 0%, rgba(255, 252, 244, 0.76), transparent 58%),
    linear-gradient(145deg, #e8eddd 0%, #f0eadc 62%, #f4e7d8 100%);
  box-shadow: var(--shadow-soft);
  animation: rise-in 0.66s 0.22s both;
}

.summary-card::after {
  position: absolute;
  top: -64px;
  right: -64px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(125, 153, 117, 0.15);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.summary-head {
  position: relative;
  z-index: 1;
}

.icon-text-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border: 1px solid rgba(45, 56, 47, 0.09);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 252, 244, 0.5);
  font-size: 9.5px;
  font-weight: 550;
  transition: background 0.2s ease, color 0.2s ease;
}

.icon-text-button svg {
  width: 13px;
  height: 13px;
}

.icon-text-button:hover {
  color: var(--ink);
  background: rgba(255, 252, 244, 0.85);
}

.summary-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-top: 16px;
}

.summary-stat {
  flex: 0 0 42%;
  min-width: 0;
}

.summary-number {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--ink);
  line-height: 1;
}

.summary-number strong {
  font-size: 46px;
  font-weight: 730;
  letter-spacing: -0.065em;
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
}

.summary-number span {
  font-size: 11px;
  font-weight: 600;
}

.summary-caption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.summary-sessions {
  display: inline-block;
  margin-top: 5px;
  color: var(--sage-deep);
  font-size: 9.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
}

.week-chart {
  display: flex;
  flex: 1;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  height: 74px;
  min-width: 0;
}

.chart-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 100%;
}

.chart-track {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 14px;
  flex: 1;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(125, 153, 117, 0.09);
  box-shadow: inset 0 0 0 1px rgba(92, 119, 86, 0.09);
}

.chart-col.is-empty .chart-track::after {
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(92, 119, 86, 0.28);
  content: "";
  transform: translateX(-50%);
}

.chart-fill {
  display: block;
  width: 100%;
  height: calc(var(--value, 0) * 1%);
  min-height: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, #91aa82 0%, #6e8c67 100%);
  transform-origin: bottom;
  animation: grow-bar 0.55s 0.22s both ease-out;
}

.chart-col.is-empty .chart-fill {
  background: transparent;
}

.chart-col.is-future {
  opacity: 0.35;
}

.chart-col.is-selected .chart-track {
  box-shadow:
    inset 0 0 0 1px rgba(92, 119, 86, 0.08),
    0 0 0 1.5px rgba(92, 119, 86, 0.48);
}

.chart-day {
  color: rgba(90, 102, 88, 0.68);
  font-size: 8.5px;
  font-weight: 550;
  line-height: 1;
}

.chart-col.is-selected .chart-day {
  color: var(--ink);
  font-weight: 700;
}

.summary-text {
  position: relative;
  z-index: 1;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid rgba(45, 56, 47, 0.08);
  color: #596558;
  font-size: 11.5px;
  line-height: 1.8;
}

.notes-details {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  border-radius: 13px;
  background: rgba(255, 252, 244, 0.42);
}

.notes-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 550;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.notes-details summary::-webkit-details-marker {
  display: none;
}

.notes-details summary em {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  margin-left: 4px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  color: var(--sage-deep);
  background: var(--sage-soft);
  font-size: 8.5px;
  font-style: normal;
  font-weight: 700;
}

.notes-details summary svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.25s ease;
}

.notes-details[open] summary svg {
  transform: rotate(180deg);
}

.week-notes {
  padding: 0 12px 11px;
}

.note-item {
  padding: 9px 0;
  border-top: 1px dashed rgba(45, 56, 47, 0.1);
}

.note-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 550;
}

.note-item-feeling {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--sage-deep);
  background: rgba(228, 236, 217, 0.78);
  font-size: 8px;
  font-weight: 600;
}

.note-item p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.note-item-extra {
  color: var(--clay) !important;
}

.note-item-med {
  color: var(--sage-deep) !important;
}

.notes-empty {
  padding: 5px 0 4px;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.7;
}

/* Shared check-in room */
.together-card {
  position: relative;
  overflow: hidden;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  background:
    radial-gradient(110% 100% at 100% 0%, rgba(255, 252, 244, 0.8), transparent 56%),
    radial-gradient(80% 80% at 0% 100%, rgba(193, 133, 101, 0.1), transparent 60%),
    linear-gradient(145deg, #e6eddc 0%, #f0eadd 100%);
  box-shadow: var(--shadow-soft);
  animation: rise-in 0.66s 0.24s both;
}

.together-card::after {
  position: absolute;
  top: -80px;
  right: -70px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(125, 153, 117, 0.14);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.together-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.together-head .section-kicker {
  color: #718668;
}

.together-head h2 {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.room-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--sage-deep);
  background: rgba(255, 252, 244, 0.58);
  font-size: 8.5px;
  font-weight: 550;
  white-space: nowrap;
}

.room-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7d9975;
  box-shadow: 0 0 0 3px rgba(125, 153, 117, 0.12);
}

.room-status.is-syncing i {
  background: #d3ad78;
  animation: status-pulse 1.4s ease infinite;
}

.room-status.is-offline {
  color: #8b6b57;
}

.room-status.is-offline i {
  background: #c18565;
  box-shadow: none;
}

.room-empty {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  text-align: center;
}

.room-illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: rgba(125, 153, 117, 0.5);
}

.avatar {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 600;
}

.avatar-self {
  color: var(--sage-deep);
  background: #d9e5d0;
  transform: rotate(-5deg);
}

.avatar-friend {
  color: #8a604b;
  background: #f0dacd;
  transform: rotate(5deg);
}

.room-link-line {
  width: 58px;
  height: auto;
}

.room-lede {
  max-width: 260px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.room-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 13px;
}

.room-primary,
.room-secondary {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 17px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.room-primary {
  color: var(--cream);
  background: var(--ink);
  box-shadow: 0 9px 18px -14px rgba(35, 49, 38, 0.65);
}

.room-primary:hover {
  background: #1f2b22;
}

.room-primary:active,
.room-secondary:active {
  transform: scale(0.97);
}

.room-primary svg {
  width: 14px;
  height: 14px;
}

.room-secondary {
  border: 1px solid rgba(45, 56, 47, 0.11);
  color: var(--ink-soft);
  background: rgba(255, 252, 244, 0.52);
}

.room-secondary:hover {
  background: rgba(255, 252, 244, 0.85);
}

.room-primary:disabled,
.room-secondary:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.room-privacy {
  margin-top: 9px;
  color: var(--muted-light);
  font-size: 8.5px;
  line-height: 1.6;
}

.room-view {
  position: relative;
  z-index: 1;
  margin-top: 15px;
}

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

.room-banner-copy {
  min-width: 0;
}

.room-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.invite-code-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px dashed rgba(92, 119, 86, 0.26);
  border-radius: 8px;
  color: var(--sage-deep);
  background: rgba(255, 252, 244, 0.38);
  font-family: ui-monospace, "Cascadia Mono", "Courier New", monospace;
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.room-members {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.member-card {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 15px;
  background: rgba(255, 252, 244, 0.58);
}

.member-avatar {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 50%;
  color: var(--sage-deep);
  background: #dce8d3;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 650;
}

.member-card.is-friend .member-avatar {
  color: #8a604b;
  background: #f0dacd;
}

.member-copy {
  min-width: 0;
}

.member-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.member-name {
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-name em {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 999px;
  color: var(--sage-deep);
  background: var(--sage-soft);
  font-size: 7px;
  font-style: normal;
  font-weight: 600;
}

.member-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.member-track {
  overflow: hidden;
  width: 100%;
  height: 3px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(45, 56, 47, 0.09);
}

.member-track i {
  display: block;
  width: calc(var(--member-progress, 0) * 1%);
  height: 100%;
  border-radius: inherit;
  background: #7d9975;
  transition: width 0.4s ease;
}

.member-card.is-friend .member-track i {
  background: #c69272;
}

.member-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted-light);
  font-size: 8px;
  line-height: 1.4;
}

.member-meta strong {
  color: var(--sage-deep);
  font-weight: 600;
}

.member-card.is-friend .member-meta strong {
  color: #a06b52;
}

.member-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 57px;
  border: 1px dashed rgba(92, 119, 86, 0.24);
  border-radius: 15px;
  color: var(--muted);
  font-size: 10px;
}

.member-waiting span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px dashed rgba(92, 119, 86, 0.3);
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
}

.room-actions-inline {
  justify-content: flex-start;
  margin-top: 11px;
}

.room-actions-inline .room-primary {
  flex: 1;
}

.room-actions-inline .room-secondary {
  flex: 0 0 auto;
}

.room-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

.room-sync-status {
  color: var(--muted-light);
  font-size: 8px;
  line-height: 1.5;
}

.room-leave {
  padding: 3px 0;
  color: rgba(139, 107, 87, 0.76);
  background: transparent;
  font-size: 8.5px;
  text-decoration: underline;
  text-decoration-color: rgba(139, 107, 87, 0.23);
  text-underline-offset: 3px;
}

.room-form {
  margin-top: 16px;
}

.room-form .text-input {
  margin-bottom: 2px;
}

.invite-input {
  font-family: ui-monospace, "Cascadia Mono", "Courier New", monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-error {
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #8e543f;
  background: rgba(241, 221, 212, 0.78);
  font-size: 10px;
  line-height: 1.6;
}

.room-switch {
  display: block;
  margin: 12px auto 0;
  padding: 4px 0;
  color: var(--sage-deep);
  background: transparent;
  font-size: 10px;
  font-weight: 550;
  text-decoration: underline;
  text-decoration-color: rgba(92, 119, 86, 0.28);
  text-underline-offset: 3px;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

/* Footer */
.footer {
  padding: 26px 6px 4px;
  text-align: center;
  color: var(--muted);
  animation: rise-in 0.66s 0.26s both;
}

.footer-quote {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.footer-note {
  max-width: 360px;
  margin: 8px auto 0;
  color: var(--muted-light);
  font-size: 9px;
  letter-spacing: 0.01em;
  line-height: 1.75;
}

.footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin-top: 13px;
}

.footer-button {
  padding: 4px 0;
  color: var(--muted);
  background: transparent;
  font-size: 9.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  text-decoration: underline;
  text-decoration-color: rgba(104, 114, 101, 0.28);
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.footer-button:hover {
  color: var(--ink);
}

.footer-button.subtle-danger {
  color: rgba(151, 103, 81, 0.72);
  text-decoration-color: rgba(151, 103, 81, 0.22);
}

.footer-button[hidden] {
  display: none;
}

.footer-divider {
  width: 1px;
  height: 10px;
  background: rgba(45, 56, 47, 0.16);
}

.footer-backup-hint {
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 8.5px;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.footer-signature {
  margin-top: 21px;
  color: var(--muted-light);
  font-family: var(--font-serif);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  opacity: 0.8;
}

.footer-signature span {
  margin: 0 3px;
  color: var(--clay);
  font-size: 7px;
}

/* Bottom sheet */
.sheet {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 560px);
  max-height: 90svh;
  margin: 0 auto;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 28px 28px 0 0;
  color: var(--ink);
  background:
    radial-gradient(80% 50% at 100% 0%, rgba(227, 235, 216, 0.8), transparent 65%),
    #fbf6eb;
  box-shadow: 0 -25px 70px -25px rgba(32, 45, 34, 0.45);
}

.sheet[open] {
  animation: sheet-up 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.sheet::backdrop {
  background: rgba(35, 45, 36, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  margin: 1px auto 15px;
  border-radius: 999px;
  background: rgba(45, 56, 47, 0.14);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.sheet-head h2 {
  margin-top: 4px;
  font-size: 23px;
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.3;
}

.sheet-head .icon-button {
  flex: 0 0 auto;
  margin-top: 3px;
  background: rgba(255, 252, 244, 0.55);
}

.sheet-lede {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.task-manage-list {
  margin-top: 16px;
  border-top: 1px dashed rgba(45, 56, 47, 0.13);
}

.task-manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(45, 56, 47, 0.13);
}

.task-manage-icon {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: var(--sage-deep);
  background: var(--sage-soft);
}

.task-manage-icon svg {
  width: 24px;
  height: 24px;
}

.task-manage-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.task-manage-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-manage-hint {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}

.row-icon-button {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease;
}

.row-icon-button svg {
  width: 16px;
  height: 16px;
}

.row-icon-button:hover {
  color: var(--ink);
  background: rgba(45, 56, 47, 0.06);
}

.row-icon-button.delete:hover {
  color: #9d5d47;
  background: var(--clay-soft);
}

.task-manage-empty {
  padding: 17px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.task-form {
  margin-top: 17px;
  padding: 16px;
  border: 1px solid rgba(45, 56, 47, 0.07);
  border-radius: 19px;
  background: rgba(243, 237, 224, 0.68);
}

.task-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.task-form-head h3 {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.task-form-head .text-button {
  font-size: 9.5px;
}

.input-label {
  display: block;
  margin: 10px 0 5px;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
}

.input-label:first-of-type {
  margin-top: 0;
}

.input-label span {
  margin-left: 3px;
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 500;
}

.text-input {
  display: block;
  width: 100%;
  height: 41px;
  padding: 0 11px;
  border: 1px solid rgba(45, 56, 47, 0.1);
  border-radius: 11px;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 252, 244, 0.85);
  font-size: 16px;
  transition: border-color 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.text-input::placeholder {
  color: #a0a698;
  font-size: 11px;
}

.text-input:focus {
  border-color: rgba(125, 153, 117, 0.6);
  background: var(--card);
}

.form-hint {
  margin-top: 6px;
  color: var(--muted-light);
  font-size: 8.5px;
  line-height: 1.6;
}

.primary-button {
  display: flex;
  width: 100%;
  height: 43px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 13px;
  border-radius: 12px;
  color: var(--cream);
  background: var(--ink);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, transform 0.2s ease;
}

.primary-button svg {
  width: 15px;
  height: 15px;
}

.primary-button:hover {
  background: #1f2b22;
}

.primary-button:active {
  transform: scale(0.99);
}

.primary-button:disabled {
  opacity: 0.5;
}

/* Toast and petals */
.toast {
  position: fixed;
  z-index: 210;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 50%;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(45, 56, 47, 0.96);
  box-shadow: 0 16px 40px -18px rgba(28, 40, 30, 0.65);
  font-size: 11.5px;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 0.24s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toast::before {
  margin-right: 6px;
  color: var(--sun);
  content: "✦";
  font-size: 9px;
}

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

.petal {
  position: fixed;
  z-index: 205;
  width: 7px;
  height: 9px;
  border-radius: 100% 0 100% 0;
  background: var(--petal-color, #dce8d1);
  pointer-events: none;
  opacity: 0;
  animation: petal-fly 0.9s cubic-bezier(0.16, 0.76, 0.34, 1) forwards;
}

/* Animations */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes check-pop {
  0% {
    transform: scale(0.82);
  }
  55% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes tile-glow {
  0%,
  100% {
    box-shadow: 0 10px 22px -18px rgba(0, 0, 0, 0.55);
  }
  40% {
    box-shadow: 0 0 0 3px rgba(215, 231, 204, 0.14), 0 14px 28px -18px rgba(0, 0, 0, 0.5);
  }
}

@keyframes grow-bar {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(38px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes petal-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotate(0);
  }
  16% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 20px)), calc(-50% + var(--dy, -53px))) scale(1) rotate(var(--rot, 80deg));
  }
}

/* Responsive */
@media (max-width: 380px) {
  .app {
    padding-right: 14px;
    padding-left: 14px;
  }

  .greeting {
    margin-top: 27px;
  }

  .greeting h1 {
    font-size: 29px;
  }

  .botanical {
    right: -15px;
    width: 88px;
  }

  .week-card {
    padding-right: 10px;
    padding-left: 10px;
  }

  .day-card {
    padding: 19px 16px 16px;
  }

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

  .habit {
    gap: 10px;
    padding: 11px;
  }

  .habit-icon {
    width: 39px;
    height: 39px;
  }

  .habit-icon svg {
    width: 26px;
    height: 26px;
  }

  .note-card,
  .summary-card {
    padding: 17px;
  }

  .feeling {
    font-size: 10px;
  }

  .summary-body {
    gap: 12px;
  }

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

  .summary-stat {
    flex-basis: 40%;
  }

  .week-range {
    font-size: 9.5px;
  }
}

@media (min-width: 700px) {
  body {
    padding: 30px 20px;
  }

  .app {
    max-width: 548px;
    padding: 34px 34px 27px;
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 38px;
    background: rgba(251, 247, 238, 0.5);
    box-shadow:
      0 50px 100px -60px rgba(54, 68, 52, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .greeting {
    margin-top: 35px;
  }

  .habit:hover {
    background: rgba(255, 255, 255, 0.085);
  }

  .habit.is-done:hover {
    background: #fbf6ea;
  }

  .sheet {
    inset: 50% auto auto 50%;
    width: min(480px, calc(100vw - 40px));
    max-height: 86vh;
    padding: 12px 22px 22px;
    border-radius: 28px;
    transform: translate(-50%, -50%);
    box-shadow: 0 40px 90px -35px rgba(28, 40, 30, 0.55);
  }

  .sheet[open] {
    animation: sheet-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .sheet-handle {
    display: none;
  }
}

@media (display-mode: standalone) {
  .app {
    padding-top: calc(22px + env(safe-area-inset-top));
  }

  .footer-actions #installApp {
    display: none;
  }
}

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

  .petal {
    display: none;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 16px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}
