:root {
  --paper: #f2eee7;
  --paper-deep: #e8e0d5;
  --paper-light: #fbf9f4;
  --ink: #292c29;
  --ink-soft: #555a54;
  --muted: #8f9187;
  --line: rgba(46, 51, 45, 0.12);
  --line-strong: rgba(46, 51, 45, 0.2);
  --coral: #d7604d;
  --coral-dark: #a9473d;
  --apricot: #e9ad63;
  --sage: #6c8570;
  --blue: #688ba2;
  --shadow: 0 28px 80px rgba(69, 59, 48, 0.1);
  --shadow-card: 0 20px 55px rgba(51, 42, 35, 0.15);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #eeebe5;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 255, 255, 0.7), transparent 28rem),
    radial-gradient(circle at 96% 78%, rgba(212, 180, 145, 0.16), transparent 32rem),
    var(--paper);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.26;
  background-image:
    linear-gradient(100deg, rgba(255, 255, 255, 0.16), transparent 40%),
    repeating-linear-gradient(0deg, rgba(72, 58, 42, 0.018) 0, rgba(72, 58, 42, 0.018) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: multiply;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(215, 96, 77, 0.4);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

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

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

.app-shell {
  width: min(100%, 1480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 68px) 142px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 54px;
  margin-bottom: clamp(42px, 7vh, 88px);
}

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

.brand-mark {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff8ee;
  border-radius: 15px 15px 15px 5px;
  background: var(--coral);
  box-shadow: 5px 6px 0 rgba(167, 71, 61, 0.18);
  transform: rotate(-5deg);
}

.brand-mark::after {
  position: absolute;
  right: 3px;
  bottom: -5px;
  width: 11px;
  height: 11px;
  content: "";
  background: var(--coral);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.brand-mark span {
  margin-top: -2px;
  font-family: Georgia, serif;
  font-size: 27px;
  line-height: 1;
  transform: rotate(5deg);
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-copy em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.15em;
}

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

.sync-status,
.header-icon-button,
.install-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  transition: 180ms ease;
}

.sync-status {
  color: var(--sage);
  font-size: 12px;
}

.sync-status:hover,
.header-icon-button:hover,
.install-button:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apricot);
  box-shadow: 0 0 0 4px rgba(233, 173, 99, 0.12);
}

.sync-status.is-online {
  color: var(--sage);
}

.sync-status.is-online .sync-dot {
  background: #7b9c73;
  box-shadow: 0 0 0 4px rgba(123, 156, 115, 0.14);
}

.sync-status.is-busy .sync-dot {
  background: var(--coral);
  animation: pulse-dot 1s ease-in-out infinite;
}

.header-icon-button {
  color: var(--ink-soft);
  font-size: 12px;
}

.header-icon-button svg,
.install-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}

.header-icon-button.only-icon {
  width: 38px;
  padding: 0;
}

.partner-status-wrap {
  position: relative;
}

.partner-status {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--sage);
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  transition: 180ms ease;
}

.partner-status:hover,
.partner-status[aria-expanded="true"] {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.partner-dot,
.presence-status-dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b8b5aa;
  box-shadow: 0 0 0 5px rgba(184, 181, 170, 0.16);
}

.partner-status.is-online {
  color: #648363;
}

.partner-status.is-online .partner-dot,
.presence-status-dot.is-online {
  background: #7b9c73;
  box-shadow: 0 0 0 5px rgba(123, 156, 115, 0.15);
}

.partner-status.is-offline {
  color: var(--muted);
}

.presence-popover[hidden] {
  display: none;
}

.presence-popover {
  position: absolute;
  z-index: 12;
  top: calc(100% + 12px);
  right: 0;
  width: 230px;
  padding: 14px;
  border: 1px solid rgba(81, 75, 64, 0.12);
  border-radius: 17px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 18px 45px rgba(74, 61, 46, 0.16);
  backdrop-filter: blur(16px);
  animation: modal-in 180ms ease both;
}

.presence-popover::before {
  position: absolute;
  top: -5px;
  right: 15px;
  width: 10px;
  height: 10px;
  content: "";
  background: inherit;
  border-top: 1px solid rgba(81, 75, 64, 0.12);
  border-left: 1px solid rgba(81, 75, 64, 0.12);
  transform: rotate(45deg);
}

.presence-popover-heading,
.presence-person {
  display: flex;
  align-items: center;
}

.presence-popover-heading {
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.presence-status-dot {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 4px rgba(184, 181, 170, 0.14);
}

.presence-person {
  gap: 9px;
  margin-top: 13px;
}

.presence-person > div {
  display: grid;
  gap: 2px;
}

.presence-person b {
  color: var(--ink);
  font-size: 12px;
}

.presence-person small {
  color: var(--muted);
  font-size: 10px;
}

.presence-popover > p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

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

.bottom-tabbar {
  position: fixed;
  z-index: 25;
  right: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  width: min(calc(100% - 28px), 430px);
  height: 70px;
  grid-template-columns: 1fr 76px 1fr;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(81, 75, 64, 0.13);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 20px 50px rgba(74, 61, 46, 0.18);
  backdrop-filter: blur(18px);
  transform: translateX(50%);
}

.bottom-tab {
  display: grid;
  min-width: 0;
  height: 56px;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--muted);
  border: 0;
  border-radius: 18px;
  background: transparent;
  font-size: 10px;
  transition: 180ms ease;
}

.bottom-tab svg {
  width: 20px;
  height: 20px;
}

.bottom-tab:hover,
.bottom-tab.is-active {
  color: var(--coral-dark);
  background: rgba(215, 96, 77, 0.08);
}

.bottom-add {
  display: grid;
  width: 58px;
  height: 58px;
  margin: -24px auto 0;
  place-items: center;
  color: #fff9ef;
  border: 6px solid var(--paper);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 10px 24px rgba(215, 96, 77, 0.28);
  transition: 180ms ease;
}

.bottom-add:hover {
  background: var(--coral-dark);
  transform: translateY(-2px);
}

.bottom-add svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.5fr);
  gap: clamp(30px, 6vw, 96px);
  align-items: start;
}

.welcome-panel {
  position: sticky;
  top: 30px;
  display: flex;
  min-height: 430px;
  align-items: center;
  padding: clamp(8px, 2vw, 24px) 0 20px;
}

.welcome-copy {
  max-width: 450px;
}

.eyebrow,
.content-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--coral-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.eyebrow span {
  display: inline-block;
  width: 33px;
  height: 1px;
  background: var(--coral);
  opacity: 0.72;
}

.welcome-copy h1 {
  margin: 22px 0 22px;
  color: var(--ink);
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: clamp(42px, 5vw, 74px);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 1.02;
}

.welcome-copy h1 span {
  position: relative;
  display: inline-block;
  color: var(--coral);
}

.welcome-copy h1 span::after {
  position: absolute;
  right: 2px;
  bottom: -7px;
  left: 5px;
  height: 7px;
  content: "";
  opacity: 0.7;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='10' viewBox='0 0 260 10'%3E%3Cpath d='M2 5c63-3 115 4 160 0 37-3 69 2 96-1' fill='none' stroke='%23d7604d' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.welcome-description {
  max-width: 340px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.9;
}

.ritual-card {
  max-width: 418px;
  margin-top: 74px;
  padding: 19px 20px 20px;
  border: 1px solid rgba(76, 78, 65, 0.1);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.52);
  box-shadow: 0 18px 40px rgba(82, 70, 53, 0.05);
  transform: rotate(-1deg);
}

.ritual-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.ritual-caption {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

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

.ritual-item {
  display: flex;
  align-items: center;
  min-height: 34px;
}

.ritual-day {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 30px;
  color: #fffaf0;
  border-radius: 50%;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 16px;
  font-weight: 700;
}

.ritual-day.coral {
  background: var(--coral);
}

.ritual-day.apricot {
  color: #5a422a;
  background: var(--apricot);
}

.ritual-day.sage {
  background: var(--sage);
}

.ritual-line {
  width: 28px;
  height: 1px;
  margin: 0 13px;
  background: var(--line-strong);
}

.ritual-detail {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ritual-detail b {
  font-size: 12px;
  font-weight: 700;
}

.ritual-detail small {
  color: var(--muted);
  font-size: 11px;
}

.welcome-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 400px;
  margin-top: 86px;
}

.pulse-ring {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  color: var(--coral);
  border: 1px solid rgba(215, 96, 77, 0.34);
  border-radius: 50%;
  background: rgba(255, 249, 237, 0.62);
  font-family: Georgia, serif;
  font-size: 22px;
  box-shadow: 0 0 0 7px rgba(215, 96, 77, 0.07);
}

.pulse-label,
.pulse-copy {
  margin: 0;
}

.pulse-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.pulse-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.workspace-panel {
  min-width: 0;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(81, 75, 64, 0.1);
  border-radius: var(--radius-xl);
  background: rgba(251, 249, 244, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.view-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(233, 227, 217, 0.55);
}

.view-button {
  min-width: 68px;
  min-height: 31px;
  padding: 0 15px;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  transition: 180ms ease;
}

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

.view-button.is-active {
  color: var(--ink);
  background: var(--paper-light);
  box-shadow: 0 4px 12px rgba(68, 58, 47, 0.08);
}

.quiet-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 2px 0 10px;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  transition: color 180ms ease;
}

.quiet-toggle:hover,
.quiet-toggle[aria-pressed="true"] {
  color: var(--ink);
}

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

.toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  padding: 3px;
  border-radius: 20px;
  background: #d5d0c7;
  transition: 180ms ease;
}

.toggle-track span {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 1px 3px rgba(45, 41, 34, 0.18);
  transition: transform 180ms ease;
}

.quiet-toggle[aria-pressed="true"] .toggle-track {
  background: var(--coral);
}

.quiet-toggle[aria-pressed="true"] .toggle-track span {
  transform: translateX(14px);
}

.date-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(52px, 1fr));
  gap: 7px;
  padding: 3px 0 24px;
  border-bottom: 1px dashed var(--line-strong);
}

.date-button {
  display: grid;
  min-height: 68px;
  padding: 9px 6px 8px;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  transition: 180ms ease;
}

.date-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.date-button.is-selected {
  color: #fffaf1;
  border-color: var(--coral);
  background: var(--coral);
  box-shadow: 0 7px 17px rgba(215, 96, 77, 0.2);
  transform: translateY(-2px);
}

.date-button.is-today:not(.is-selected) {
  color: var(--coral-dark);
  border-color: rgba(215, 96, 77, 0.23);
}

.date-weekday {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.date-number {
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1;
}

.date-marker {
  display: flex;
  gap: 3px;
  min-height: 4px;
}

.date-marker i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.content-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 27px 2px 20px;
}

.content-kicker {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.content-heading h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: clamp(27px, 3vw, 38px);
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.content-count {
  min-width: 40px;
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 700;
  text-align: right;
}

.event-list {
  display: grid;
  gap: 19px;
}

.event-shell {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  isolation: isolate;
}

.swipe-actions {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  display: grid;
  width: 124px;
  place-items: center;
  color: #fff9ef;
  background: var(--coral-dark);
}

.swipe-actions button {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  gap: 4px;
  color: inherit;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.swipe-actions svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.4;
}

.event-card {
  --card-image: none;
  --card-color: var(--coral);
  position: relative;
  display: flex;
  min-height: 258px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 24px 20px;
  overflow: hidden;
  color: #fffaf0;
  border-radius: var(--radius-lg);
  background-color: #9a8372;
  background-image: linear-gradient(180deg, rgba(22, 29, 23, 0.04) 0%, rgba(22, 29, 23, 0.76) 100%), var(--card-image);
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow-card);
  transform: translateX(0);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease;
  touch-action: pan-y;
}

.event-card:hover {
  box-shadow: 0 26px 65px rgba(51, 42, 35, 0.2);
}

.event-card::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.35;
  background: linear-gradient(116deg, rgba(255, 255, 255, 0.22), transparent 35%);
  mix-blend-mode: screen;
}

.event-card::after {
  position: absolute;
  z-index: 0;
  right: 24px;
  bottom: 50%;
  left: 24px;
  height: 1px;
  content: "";
  opacity: 0;
  background: rgba(255, 250, 240, 0.42);
  transition: opacity 180ms ease;
}

.event-shell.is-swiped .event-card {
  transform: translateX(-124px);
}

.event-shell.is-swiped .swipe-actions {
  z-index: 0;
}

.event-card.is-done {
  filter: saturate(0.72);
}

.event-card > * {
  position: relative;
  z-index: 1;
}

.card-topline,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-topline {
  align-items: start;
}

.card-category-wrap,
.card-top-actions {
  display: flex;
  align-items: center;
}

.card-category-wrap {
  min-height: 31px;
}

.ack-avatars-quiet {
  display: none;
  align-items: center;
  gap: 5px;
  min-height: 31px;
}

.card-top-actions {
  gap: 7px;
}

.card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(255, 250, 240, 0.24);
  border-radius: 999px;
  background: rgba(34, 37, 31, 0.18);
  backdrop-filter: blur(10px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.card-category-mark {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.25);
  font-size: 10px;
}

.card-menu {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: #fffaf0;
  border: 1px solid rgba(255, 250, 240, 0.24);
  border-radius: 50%;
  background: rgba(34, 37, 31, 0.16);
  backdrop-filter: blur(10px);
  transition: 180ms ease;
}

.card-ack {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: rgba(255, 250, 240, 0.7);
  border: 1px solid rgba(255, 250, 240, 0.24);
  border-radius: 50%;
  background: rgba(34, 37, 31, 0.16);
  backdrop-filter: blur(10px);
  transition: 180ms ease;
}

.card-ack:hover,
.card-ack.is-active {
  color: #fff4d4;
  border-color: rgba(255, 244, 212, 0.62);
  background: rgba(255, 250, 240, 0.22);
}

.card-ack svg {
  width: 17px;
  height: 17px;
}

.card-menu:hover {
  background: rgba(255, 250, 240, 0.22);
}

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

.event-copy {
  max-width: min(92%, 530px);
  margin: auto 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.event-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 250, 240, 0.8);
  font-family: Georgia, serif;
  font-size: 13px;
}

.event-time::before {
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: var(--card-color);
  box-shadow: 0 0 0 4px rgba(255, 250, 240, 0.13);
}

.event-copy h3 {
  margin: 9px 0 8px;
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: clamp(29px, 3vw, 44px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.08;
  text-wrap: balance;
}

.event-copy p {
  max-width: 470px;
  margin: 0;
  color: rgba(255, 250, 240, 0.79);
  font-size: 12px;
  line-height: 1.7;
}

.card-checklist {
  display: grid;
  gap: 6px;
  max-width: 430px;
  margin-top: 13px;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  max-width: 100%;
  padding: 0;
  color: rgba(255, 250, 240, 0.86);
  border: 0;
  background: transparent;
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
}

.check-item:hover {
  color: #fff;
}

.check-box {
  display: grid;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  place-items: center;
  border: 1px solid rgba(255, 250, 240, 0.56);
  border-radius: 5px;
  background: rgba(34, 37, 31, 0.15);
}

.check-box svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.check-item.is-checked {
  color: rgba(255, 250, 240, 0.53);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 250, 240, 0.5);
}

.check-item.is-checked .check-box {
  color: var(--coral-dark);
  border-color: #fff4d4;
  background: #fff4d4;
}

.card-footer {
  align-items: end;
}

.checklist-progress {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: rgba(255, 250, 240, 0.82);
  font-size: 11px;
}

.progress-bar {
  width: 58px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.25);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #fff4d4;
}

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

.card-action {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  padding: 0;
  color: rgba(255, 250, 240, 0.88);
  border: 1px solid rgba(255, 250, 240, 0.28);
  border-radius: 999px;
  background: rgba(34, 37, 31, 0.18);
  backdrop-filter: blur(8px);
  transition: 180ms ease;
}

.card-action:hover {
  color: var(--ink);
  background: #fff8ea;
}

.card-action svg {
  width: 15px;
  height: 15px;
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  overflow: hidden;
  color: #fff9ef;
  border: 2px solid rgba(255, 250, 240, 0.82);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 4px 10px rgba(38, 34, 28, 0.16);
}

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

.avatar-initials {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.ack-avatar-quiet {
  display: grid;
  width: 31px;
  height: 31px;
  border-color: rgba(255, 250, 240, 0.9);
}

.gesture-hint {
  position: absolute;
  right: 24px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 250, 240, 0.46);
  font-size: 9px;
  letter-spacing: 0.05em;
  transition: opacity 180ms ease;
}

.gesture-hint svg {
  width: 14px;
  height: 14px;
}

.quiet-mode .event-copy,
.quiet-mode .checklist-progress,
.quiet-mode .gesture-hint {
  opacity: 0;
  transform: translateY(5px);
  pointer-events: none;
}

.quiet-mode .check-item {
  opacity: 0;
  pointer-events: none;
}

.quiet-mode .event-card::after {
  opacity: 1;
}

.quiet-mode .card-category {
  padding-right: 7px;
  padding-left: 7px;
}

.quiet-mode .card-category-label {
  display: none;
}

.quiet-mode .event-card.has-acknowledgement .card-category {
  display: none;
}

.quiet-mode .event-card.has-acknowledgement .ack-avatars-quiet {
  display: inline-flex;
}

.empty-state {
  display: grid;
  min-height: 200px;
  padding: 28px;
  place-items: center;
  align-content: center;
  gap: 13px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-state-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: var(--coral);
  border-radius: 50%;
  background: rgba(215, 96, 77, 0.1);
  font-family: Georgia, serif;
  font-size: 24px;
}

.empty-state strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.empty-state p {
  max-width: 260px;
  margin: -5px 0 0;
  font-size: 11px;
  line-height: 1.7;
}

.week-overview {
  display: grid;
  gap: 17px;
}

.week-summary {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 1px 2px 5px;
}

.week-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.week-summary strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 19px;
}

.week-score {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}

.week-score small {
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 400;
}

.week-grid-scroll {
  min-width: 0;
  overflow-x: auto;
  padding: 2px 2px 8px;
  overscroll-behavior-x: contain;
  scrollbar-color: rgba(143, 145, 135, 0.5) transparent;
  scrollbar-width: thin;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

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

.week-day {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 12px 9px 9px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.42);
  transition: 180ms ease;
}

.week-day:hover,
.week-day.is-selected {
  border-color: rgba(215, 96, 77, 0.42);
  background: #fffaf2;
  box-shadow: 0 9px 22px rgba(77, 61, 45, 0.07);
  transform: translateY(-2px);
}

.week-day.is-today .week-day-number {
  color: var(--coral);
}

.week-day-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 1px 2px 11px;
  border-bottom: 1px dashed var(--line);
}

.week-day-name {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.week-day-number {
  font-family: Georgia, serif;
  font-size: 18px;
}

.week-day-items {
  display: grid;
  gap: 7px;
  padding-top: 10px;
}

.week-event {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 8px 7px;
  color: var(--ink-soft);
  border: 0;
  border-left: 3px solid var(--event-color, var(--coral));
  border-radius: 7px;
  background: color-mix(in srgb, var(--event-color, var(--coral)) 10%, white);
  text-align: left;
  transition: 160ms ease;
}

.week-event:hover {
  background: color-mix(in srgb, var(--event-color, var(--coral)) 17%, white);
}

.week-event-time {
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 9px;
}

.week-event-title {
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-empty {
  margin: auto 0;
  color: #b6b4ab;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 13px;
  text-align: center;
}

.modal-root[hidden] {
  display: none;
}

.modal-root {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  overflow-y: auto;
  padding: 24px;
  place-items: center;
  background: rgba(39, 37, 32, 0.38);
  backdrop-filter: blur(8px);
  animation: fade-in 180ms ease both;
}

.modal-card {
  width: min(100%, 570px);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 25px;
  background: var(--paper-light);
  box-shadow: 0 30px 90px rgba(34, 30, 26, 0.24);
  animation: modal-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-card.compact {
  width: min(100%, 430px);
}

.profile-modal,
.category-modal,
.about-modal,
.install-modal {
  width: min(100%, 470px);
}

.profile-hero {
  display: grid;
  justify-items: center;
  gap: 11px;
  margin: 2px 0 19px;
  text-align: center;
}

.profile-avatar-button {
  position: relative;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  cursor: pointer;
}

.profile-avatar-button .profile-avatar {
  width: 92px;
  height: 92px;
  color: #fff9ef;
  border: 4px solid #fffdf8;
  background: var(--coral);
  box-shadow: 0 12px 25px rgba(79, 59, 45, 0.18);
}

.profile-avatar-button .avatar-initials {
  font-size: 28px;
}

.profile-avatar-edit {
  position: absolute;
  right: -3px;
  bottom: 1px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff9ef;
  border: 3px solid var(--paper-light);
  border-radius: 50%;
  background: var(--coral);
}

.profile-avatar-edit svg {
  width: 14px;
  height: 14px;
}

.profile-hero-copy {
  display: grid;
  gap: 3px;
}

.profile-hero-copy strong {
  color: var(--ink);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 21px;
}

.profile-hero-copy small {
  color: var(--muted);
  font-size: 10px;
}

.profile-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: end;
  margin-bottom: 21px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.46);
}

.profile-form .form-field {
  min-width: 0;
}

.profile-save {
  min-height: 43px;
  white-space: nowrap;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.settings-row {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 9px 11px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.45);
  text-align: left;
  transition: 160ms ease;
}

.settings-row:hover {
  color: var(--ink);
  border-color: rgba(215, 96, 77, 0.32);
  background: #fffaf2;
  transform: translateY(-1px);
}

.settings-row.invite-setting-row {
  color: #fffaf0;
  border-color: rgba(215, 96, 77, 0.78);
  background: linear-gradient(115deg, var(--coral), #c7745d);
  box-shadow: 0 10px 23px rgba(215, 96, 77, 0.2);
}

.settings-row.invite-setting-row:hover {
  color: #fffaf0;
  background: var(--coral-dark);
}

.settings-row.account-setting-row.is-highlighted {
  color: var(--coral-dark);
  border-color: rgba(215, 96, 77, 0.35);
  background: linear-gradient(115deg, rgba(255, 235, 220, 0.92), rgba(255, 249, 239, 0.82));
  box-shadow: 0 9px 20px rgba(215, 96, 77, 0.1);
}

.settings-row.account-setting-row.is-highlighted .settings-row-copy small {
  color: rgba(169, 71, 61, 0.72);
}

.account-warm-note,
.account-anonymous-card,
.account-status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 17px;
  padding: 13px 14px;
  border: 1px solid rgba(215, 96, 77, 0.18);
  border-radius: 15px;
  background: rgba(255, 235, 220, 0.6);
}

.account-warm-note > span,
.account-anonymous-mark,
.account-status-check {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  place-items: center;
  color: var(--coral-dark);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  font-family: Georgia, serif;
  font-size: 18px;
}

.account-warm-note p,
.account-anonymous-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.account-form {
  display: grid;
  gap: 13px;
}

.account-form .modal-actions {
  margin-top: 4px;
}

.form-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.account-status-card {
  margin-top: 8px;
  background: rgba(223, 239, 223, 0.62);
  border-color: rgba(108, 133, 112, 0.22);
}

.account-status-check {
  color: #fffaf0;
  background: var(--sage);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
}

.account-status-card > div {
  display: grid;
  gap: 3px;
}

.account-status-card strong {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.account-status-card small {
  color: var(--sage);
  font-size: 10px;
}

.account-logout-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.settings-row-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: var(--coral-dark);
  border-radius: 11px;
  background: rgba(215, 96, 77, 0.1);
}

.invite-setting-row .settings-row-icon {
  color: var(--coral-dark);
  background: rgba(255, 250, 240, 0.85);
}

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

.settings-row-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.settings-row-copy strong {
  font-size: 12px;
}

.settings-row-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-setting-row .settings-row-copy small,
.invite-setting-row .settings-row-arrow {
  color: rgba(255, 250, 240, 0.78);
}

.settings-row-arrow {
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 400;
  text-align: center;
}

.card-image-manager-modal {
  width: min(100%, 620px);
}

.card-image-manager-list {
  display: grid;
  gap: 9px;
  max-height: min(490px, 52vh);
  overflow-y: auto;
  padding: 2px 3px 3px 1px;
}

.card-image-manager-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.card-image-thumb {
  display: block;
  width: 76px;
  height: 58px;
  border-radius: 10px;
  background-color: var(--paper-deep);
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.card-image-manager-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.card-image-picker-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.card-image-picker-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--coral);
}

.card-image-manager-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-image-manager-actions button {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
}

.card-image-manager-actions button:hover:not(:disabled) {
  color: var(--coral-dark);
  border-color: rgba(215, 96, 77, 0.28);
  background: rgba(215, 96, 77, 0.08);
}

.card-image-manager-actions button:disabled {
  cursor: default;
  opacity: 0.25;
}

.card-image-manager-actions svg {
  width: 14px;
  height: 14px;
}

.card-image-manager-note {
  margin: 13px 2px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.category-manager-list {
  display: grid;
  gap: 7px;
  margin-bottom: 17px;
}

.category-manager-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 49px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--option-color, var(--coral));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
}

.category-manager-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--option-color, var(--coral));
  border-radius: 9px;
  background: color-mix(in srgb, var(--option-color, var(--coral)) 12%, white);
  font-size: 16px;
}

.category-manager-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.category-manager-copy strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-manager-copy small,
.category-lock {
  color: var(--muted);
  font-size: 9px;
}

.category-manager-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.category-manager-actions button {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
}

.category-manager-actions button:hover:not(:disabled) {
  color: var(--coral-dark);
  border-color: rgba(215, 96, 77, 0.28);
  background: rgba(215, 96, 77, 0.08);
}

.category-manager-actions button:disabled {
  cursor: default;
  opacity: 0.28;
}

.category-manager-actions button svg {
  width: 13px;
  height: 13px;
}

.category-add-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed rgba(215, 96, 77, 0.35);
  border-radius: 15px;
  background: rgba(255, 241, 231, 0.52);
}

.category-add-heading {
  display: grid;
  gap: 3px;
}

.category-add-heading strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.category-add-heading small {
  color: var(--muted);
  font-size: 10px;
}

.category-add-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.form-input {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.72);
}

.form-input:focus {
  border-color: rgba(215, 96, 77, 0.62);
  box-shadow: 0 0 0 4px rgba(215, 96, 77, 0.1);
}

.about-copy {
  display: grid;
  gap: 11px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.about-copy p {
  margin: 0;
}

.space-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 12px;
  color: var(--muted);
  border-radius: 12px;
  background: rgba(215, 96, 77, 0.07);
  font-size: 10px;
}

.space-note strong {
  color: var(--coral-dark);
  font-family: Georgia, serif;
  letter-spacing: 0.06em;
}

.space-note-mark {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 19px;
}

.modal-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 21px;
}

.modal-heading h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 30px;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.modal-heading p {
  max-width: 370px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}

.modal-close:hover {
  color: var(--ink);
  background: rgba(232, 224, 213, 0.55);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

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

.form-field {
  display: grid;
  gap: 7px;
}

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

.form-field label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-field textarea {
  min-height: 82px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: rgba(215, 96, 77, 0.62);
  box-shadow: 0 0 0 4px rgba(215, 96, 77, 0.1);
}

.password-control {
  position: relative;
}

.password-control input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  border: 0;
  border-radius: 10px;
  background: transparent;
  transform: translateY(-50%);
  transition: color 160ms ease, background 160ms ease;
}

.password-toggle:hover {
  color: var(--ink);
  background: rgba(232, 224, 213, 0.65);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

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

.category-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 31px;
  padding: 0 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  transition: 160ms ease;
}

.category-option:hover,
.category-option.is-selected {
  color: var(--ink);
  border-color: var(--option-color, var(--coral));
  background: color-mix(in srgb, var(--option-color, var(--coral)) 13%, white);
}

.category-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  transition: 180ms ease;
}

.button.primary {
  color: #fff9ef;
  background: var(--coral);
  box-shadow: 0 9px 18px rgba(215, 96, 77, 0.2);
}

.button.primary:hover {
  background: var(--coral-dark);
  transform: translateY(-1px);
}

.button.secondary {
  color: var(--ink-soft);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.button.secondary:hover {
  color: var(--ink);
  background: #fff;
}

.button.danger {
  color: var(--coral-dark);
  border-color: rgba(215, 96, 77, 0.22);
  background: rgba(215, 96, 77, 0.08);
}

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

.checklist-editor {
  display: grid;
  gap: 8px;
}

.checklist-row {
  display: grid;
  grid-template-columns: 1fr 32px;
  gap: 7px;
}

.checklist-row button {
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
}

.checklist-row button:hover {
  color: var(--coral-dark);
  background: rgba(215, 96, 77, 0.08);
}

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

.inline-add {
  justify-self: start;
  padding: 3px 0;
  color: var(--coral-dark);
  border: 0;
  background: transparent;
  font-size: 11px;
}

.inline-add:hover {
  text-decoration: underline;
}

.reschedule-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.reschedule-option {
  display: grid;
  min-height: 77px;
  padding: 10px 7px;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  transition: 160ms ease;
}

.reschedule-option strong {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 18px;
}

.reschedule-option:hover {
  border-color: rgba(215, 96, 77, 0.38);
  background: rgba(255, 241, 231, 0.78);
  transform: translateY(-2px);
}

.specific-date {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  margin-top: 16px;
}

.specific-date .form-field {
  gap: 0;
}

.specific-date .button {
  min-height: 43px;
}

.invite-code {
  display: grid;
  min-height: 82px;
  margin: 5px 0 17px;
  padding: 15px;
  place-items: center;
  border: 1px dashed rgba(215, 96, 77, 0.36);
  border-radius: 17px;
  background: rgba(255, 241, 231, 0.7);
  color: var(--coral-dark);
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.invite-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.share-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.share-row .button {
  flex: 1;
}

.together-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin: 5px 0 17px;
  padding: 18px;
  border: 1px solid rgba(215, 96, 77, 0.18);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 241, 231, 0.94), rgba(255, 249, 239, 0.8));
  box-shadow: 0 12px 28px rgba(112, 75, 54, 0.08);
}

.together-card-heart {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--coral-dark);
  border: 1px solid rgba(215, 96, 77, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  font-family: Georgia, serif;
  font-size: 28px;
}

.together-card strong {
  display: block;
  color: var(--coral-dark);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 20px;
  line-height: 1.25;
}

.together-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.space-secondary-actions {
  display: grid;
  gap: 13px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.subtle-link {
  justify-self: start;
  padding: 0;
  color: var(--ink-soft);
  border: 0;
  background: transparent;
  font-size: 11px;
  text-align: left;
}

.subtle-link:hover {
  color: var(--coral-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.join-space-reveal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
}

.join-space-reveal[hidden] {
  display: none;
}

.join-space-reveal .form-field {
  min-width: 0;
  gap: 5px;
}

.join-space-reveal .button {
  min-height: 42px;
}

.leave-space-button {
  justify-self: start;
  padding: 0;
  color: var(--muted);
  border: 0;
  background: transparent;
  font-size: 11px;
}

.leave-space-button:hover {
  color: var(--coral-dark);
}

.leave-confirm-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 7px;
  padding: 15px;
  border: 1px solid rgba(215, 96, 77, 0.16);
  border-radius: 16px;
  background: rgba(255, 241, 231, 0.62);
}

.leave-confirm-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--coral-dark);
  border-radius: 50%;
  background: rgba(215, 96, 77, 0.1);
  font-family: Georgia, serif;
  font-size: 17px;
}

.leave-confirm-note p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.leave-confirm-actions .button.danger {
  font-weight: 800;
}

.install-guide {
  display: grid;
  gap: 12px;
  margin-top: 5px;
}

.guide-row {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: start;
}

.guide-number {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--coral-dark);
  border-radius: 50%;
  background: rgba(215, 96, 77, 0.1);
  font-family: Georgia, serif;
  font-size: 12px;
}

.guide-row p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.background-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.background-modal {
  width: min(100%, 620px);
}

.background-section {
  display: grid;
  gap: 10px;
  margin-bottom: 17px;
}

.background-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.background-section-heading strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.background-section-heading small {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.background-empty {
  padding: 14px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  line-height: 1.6;
}

.background-option {
  position: relative;
  min-height: 105px;
  overflow: hidden;
  padding: 0;
  color: #fffaf0;
  border: 2px solid transparent;
  border-radius: 15px;
  background-color: var(--paper-deep);
  background-position: center;
  background-size: cover;
  text-align: left;
  transition: 160ms ease;
}

.background-option::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 30%, rgba(28, 29, 25, 0.65));
}

.background-option span {
  position: absolute;
  right: 9px;
  bottom: 8px;
  left: 9px;
  font-size: 10px;
  font-weight: 700;
}

.background-option:hover,
.background-option.is-selected {
  border-color: var(--coral);
  box-shadow: 0 7px 15px rgba(77, 61, 45, 0.14);
  transform: translateY(-2px);
}

.background-upload {
  display: grid;
  min-height: 105px;
  padding: 10px;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--coral-dark);
  border: 1px dashed rgba(215, 96, 77, 0.45);
  border-radius: 15px;
  background: rgba(255, 241, 231, 0.55);
  font-size: 11px;
  text-align: center;
}

.background-upload:hover {
  background: rgba(255, 241, 231, 0.9);
}

.background-upload svg {
  width: 22px;
  height: 22px;
}

.background-upload small {
  color: var(--muted);
  font-size: 9px;
}

.card-library-entry {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin: 0 0 18px;
  padding: 11px 12px;
  color: var(--ink-soft);
  border: 1px solid rgba(215, 96, 77, 0.2);
  border-radius: 14px;
  background: rgba(255, 241, 231, 0.68);
  text-align: left;
  transition: 160ms ease;
}

.card-library-entry:hover {
  color: var(--coral-dark);
  border-color: rgba(215, 96, 77, 0.45);
  background: rgba(255, 241, 231, 0.95);
  transform: translateY(-1px);
}

.card-library-entry > svg {
  width: 19px;
  height: 19px;
  color: var(--coral-dark);
}

.card-library-entry > span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

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

.card-library-entry small {
  color: var(--muted);
  font-size: 10px;
}

.card-library-entry-arrow {
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 22px;
  text-align: center;
}

.card-gallery-modal,
.card-gallery-root .modal-card {
  width: min(100%, 620px);
}

.card-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: min(510px, 57vh);
  overflow-y: auto;
  padding: 2px 3px 3px 1px;
}

.card-gallery-option {
  position: relative;
  min-height: 145px;
  overflow: hidden;
  padding: 0;
  color: #fffaf0;
  border: 2px solid transparent;
  border-radius: 15px;
  background-color: var(--paper-deep);
  background-position: center;
  background-size: cover;
  text-align: left;
  transition: 160ms ease;
}

.card-gallery-option::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 30%, rgba(28, 29, 25, 0.68));
}

.card-gallery-option span {
  position: absolute;
  right: 9px;
  bottom: 8px;
  left: 9px;
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-gallery-option:hover,
.card-gallery-option.is-selected {
  border-color: var(--coral);
  box-shadow: 0 7px 15px rgba(77, 61, 45, 0.14);
  transform: translateY(-2px);
}

.gallery-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 30px 18px;
  color: var(--muted);
  text-align: center;
}

.gallery-empty-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--coral);
  border-radius: 50%;
  background: rgba(215, 96, 77, 0.1);
  font-family: Georgia, serif;
  font-size: 23px;
}

.gallery-empty strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.gallery-empty p {
  max-width: 300px;
  margin: 0;
  font-size: 10px;
  line-height: 1.65;
}

.crop-modal {
  width: min(100%, 500px);
}

.crop-instruction {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 10px;
}

.crop-instruction span {
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 700;
}

.crop-instruction small {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.crop-viewport {
  position: relative;
  display: flex;
  min-height: 230px;
  height: min(54vh, 350px);
  overflow-x: hidden;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 18px;
  outline: 2px solid rgba(215, 96, 77, 0.58);
  outline-offset: -6px;
  background: #343a34;
  box-shadow: inset 0 0 0 5px rgba(24, 29, 24, 0.12);
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 250, 240, 0.58) transparent;
  scrollbar-width: thin;
  touch-action: pan-y;
}

.crop-viewport img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  flex: 0 0 auto;
}

.crop-viewport.is-tall img {
  cursor: ns-resize;
}

.crop-position-hint {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.crop-position-hint span:first-child,
.crop-position-hint span:last-child {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 14px;
  line-height: 10px;
}

.toast-region {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: calc(98px + env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  width: min(340px, calc(100% - 44px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 15px;
  color: #fffaf0;
  border-radius: 13px;
  background: rgba(43, 48, 42, 0.92);
  box-shadow: 0 16px 38px rgba(43, 36, 30, 0.2);
  font-size: 11px;
  line-height: 1.5;
  animation: toast-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast.is-leaving {
  animation: toast-out 180ms ease both;
}

.toast-mark {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  color: #fff9ef;
  border-radius: 50%;
  background: var(--coral);
  font-family: Georgia, serif;
  font-size: 13px;
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(215, 96, 77, 0.1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(215, 96, 77, 0.02);
  }
}

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

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

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

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

@media (max-width: 1120px) {
  .main-grid {
    grid-template-columns: minmax(250px, 0.63fr) minmax(0, 1.4fr);
    gap: 35px;
  }

  .welcome-copy h1 {
    font-size: clamp(40px, 5vw, 60px);
  }

  .ritual-card {
    margin-top: 52px;
  }

  .welcome-footer {
    margin-top: 58px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding-right: 22px;
    padding-left: 22px;
  }

  .topbar {
    margin-bottom: 40px;
  }

  .main-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .welcome-panel {
    position: static;
    display: block;
    min-height: 0;
    padding: 0;
  }

  .welcome-copy {
    max-width: 680px;
  }

  .welcome-copy h1 {
    margin-top: 16px;
    font-size: clamp(46px, 9vw, 72px);
  }

  .welcome-description {
    max-width: 480px;
  }

  .ritual-card {
    max-width: 620px;
    margin-top: 35px;
  }

  .ritual-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .ritual-item {
    min-width: 0;
  }

  .ritual-line {
    width: 13px;
    margin-right: 7px;
    margin-left: 7px;
  }

  .ritual-detail {
    display: grid;
    gap: 2px;
  }

  .welcome-footer {
    margin-top: 31px;
  }

  .workspace-panel {
    padding: 22px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: max(18px, env(safe-area-inset-top)) 14px calc(122px + env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 35px;
  }

  .header-actions {
    gap: 4px;
  }

  .sync-label,
  .header-icon-button span,
  .install-button {
    display: none;
  }

  .sync-status {
    width: 31px;
    min-height: 34px;
    padding: 0;
  }

  .header-icon-button.only-icon {
    width: 34px;
    min-height: 34px;
  }

  .header-icon-button:not(.only-icon) {
    width: 34px;
    min-height: 34px;
    padding: 0;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px 13px 13px 5px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .brand-copy em {
    font-size: 9px;
  }

  .welcome-copy h1 {
    margin-top: 15px;
    font-size: clamp(42px, 13vw, 62px);
  }

  .welcome-description {
    max-width: 300px;
    font-size: 13px;
  }

  .ritual-card {
    margin-top: 29px;
    padding: 16px 14px 17px;
    border-radius: 17px;
  }

  .ritual-heading {
    margin-bottom: 13px;
  }

  .ritual-caption {
    font-size: 9px;
  }

  .ritual-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .ritual-item {
    min-height: 29px;
  }

  .ritual-day {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
    font-size: 14px;
  }

  .ritual-line {
    width: 22px;
    margin-right: 11px;
    margin-left: 11px;
  }

  .ritual-detail {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .welcome-footer {
    margin-top: 25px;
  }

  .workspace-panel {
    padding: 16px;
    border-radius: 24px;
  }

  .workspace-toolbar {
    margin-bottom: 18px;
  }

  .view-button {
    min-width: 60px;
    padding: 0 12px;
  }

  .quiet-label {
    display: none;
  }

  .quiet-toggle {
    padding-right: 0;
    padding-left: 0;
  }

  .date-strip {
    grid-template-columns: repeat(7, minmax(43px, 1fr));
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 18px;
    scrollbar-width: none;
  }

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

  .date-button {
    min-height: 61px;
    padding-right: 3px;
    padding-left: 3px;
    border-radius: 12px;
  }

  .date-weekday {
    font-size: 9px;
  }

  .date-number {
    font-size: 18px;
  }

  .content-heading {
    margin-top: 23px;
    margin-bottom: 16px;
  }

  .content-heading h2 {
    font-size: 29px;
  }

  .content-count {
    font-size: 23px;
  }

  .event-list {
    gap: 14px;
  }

  .event-card {
    min-height: 236px;
    padding: 17px 17px 16px;
    border-radius: 20px;
  }

  .event-copy h3 {
    font-size: 31px;
  }

  .event-copy p {
    font-size: 11px;
  }

  .card-checklist {
    margin-top: 10px;
  }

  .card-action {
    width: 29px;
    padding: 0;
    place-content: center;
  }

  .card-footer {
    align-items: center;
  }

  .gesture-hint {
    right: 17px;
    bottom: 16px;
  }

  .week-overview {
    overflow: visible;
  }

  .week-summary {
    align-items: start;
  }

  .week-grid-scroll {
    margin-right: -3px;
    margin-left: -3px;
    padding-right: 3px;
    padding-left: 3px;
  }

  .week-grid {
    display: flex;
    width: max-content;
    min-width: 945px;
    gap: 8px;
  }

  .week-day {
    width: 135px;
    min-height: 230px;
    flex: 0 0 135px;
    scroll-snap-align: start;
  }

  .week-day:first-child {
    margin-left: 0;
  }

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

  .modal-card,
  .modal-card.compact {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 23px 17px max(22px, env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
  }

  .modal-heading h2 {
    font-size: 28px;
  }

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

  .form-field.full {
    grid-column: auto;
  }

  .reschedule-options {
    gap: 7px;
  }

  .reschedule-option {
    min-height: 72px;
    padding-right: 3px;
    padding-left: 3px;
  }

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

  .background-section-heading {
    align-items: start;
    flex-direction: column;
    gap: 3px;
  }

  .background-section-heading small {
    text-align: left;
  }

  .card-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    max-height: 55vh;
  }

  .card-gallery-option {
    min-height: 142px;
  }

  .crop-modal {
    padding-top: 20px;
  }

  .crop-instruction {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .crop-instruction small {
    text-align: left;
  }

  .crop-viewport {
    height: min(56vh, 360px);
    min-height: 230px;
  }

  .card-image-manager-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .card-image-thumb {
    width: 64px;
    height: 64px;
  }

  .card-image-manager-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .toast-region {
    right: 14px;
    width: calc(100% - 28px);
  }

  .bottom-tabbar {
    bottom: max(10px, env(safe-area-inset-bottom));
    height: 66px;
    grid-template-columns: 1fr 70px 1fr;
    border-radius: 22px;
  }

  .bottom-add {
    width: 55px;
    height: 55px;
  }

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

  .profile-save {
    width: 100%;
  }

  .join-space-reveal {
    grid-template-columns: 1fr;
  }

  .join-space-reveal .button {
    width: 100%;
  }

}

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