:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --surface: rgba(255, 252, 246, 0.82);
  --surface-strong: #ffffff;
  --text: #1d1d1f;
  --muted: #776f66;
  --hairline: rgba(88, 65, 42, 0.12);
  --sticker-white: #ffffff;
  --speckle: radial-gradient(circle, rgba(42, 37, 32, 0.12) 0 0.7px, transparent 0.8px);
  --blue: #0a84ff;
  --warm: #ff7a59;
  --green: #30a46c;
  --rose: #d94f70;
  --action-post: #ff9f86;
  --action-post-deep: #ff8f78;
  --action-done: #abd9b8;
  --action-done-deep: #9bceaa;
  --saved-green: #dff2da;
  --saved-green-ink: #2f684d;
  --note-yellow: #fff1aa;
  --note-blue: #dbefff;
  --note-green: #e1f5d6;
  --note-pink: #ffe0df;
  --note-cream: #fffdf0;
  --note-lilac: #ebe4ff;
  --ink: #2a2520;
  --shadow: 0 22px 70px rgba(80, 56, 32, 0.1);
  --sticker-shadow: 0 0 0 1px rgba(88, 65, 42, 0.1), 0 16px 30px rgba(80, 56, 32, 0.1);
  --note-fill: #fff4a8;
  --note-edge: rgba(42, 37, 32, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    var(--speckle),
    linear-gradient(180deg, #fffaf1 0%, var(--bg) 54%, #eef5f0 100%);
  background-size: 10px 10px, auto;
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

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

button:focus-visible {
  outline: 2px solid rgba(255, 122, 89, 0.5);
  outline-offset: 3px;
}

.app-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.live-shell {
  width: min(430px, calc(100% - 22px));
  min-height: 100vh;
  padding: max(14px, env(safe-area-inset-top)) 0 calc(34px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 4px 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 38px;
  line-height: 0.95;
  font-weight: 720;
}

h2 {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
}

.viewer-control,
.mode-tabs,
.composer,
.wall {
  border: 5px solid var(--sticker-white);
  background:
    var(--speckle),
    var(--surface);
  background-size: 10px 10px, auto;
  box-shadow: 0 0 0 1px rgba(42, 37, 32, 0.08), var(--shadow);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.viewer-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 10px 12px 10px 14px;
  border-radius: 24px;
  color: var(--muted);
  font-size: 14px;
}

.viewer-control span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.viewer-control select {
  min-width: 0;
}

.live-userbar strong {
  color: var(--text);
}

.mini-plain-button {
  min-height: 30px;
  padding: 0 10px;
  border: 4px solid var(--sticker-white);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 0 0 1px var(--hairline);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

select {
  min-height: 44px;
  padding: 0 12px;
}

input,
textarea {
  padding: 11px 12px;
}

input {
  min-height: 44px;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(0, 122, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
  background: #ffffff;
}

.mode-tabs {
  position: sticky;
  top: 10px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(430px, 100%);
  padding: 4px;
  border-radius: 24px;
  margin-bottom: 16px;
}

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

.mobile-app {
  display: block;
}

.app-view {
  display: grid;
  gap: 14px;
}

.app-view.is-hidden {
  display: none;
}

.app-panel {
  display: grid;
  gap: 14px;
}

.app-panel.is-hidden {
  display: none;
}

.app-screen {
  width: 100%;
}

.app-topbar {
  display: grid;
  align-items: start;
  gap: 12px;
}

.app-topbar > div:first-child {
  min-height: 46px;
  padding-right: 160px;
}

.mobile-app.is-subview .app-topbar > div:first-child {
  padding-right: 56px;
}

.app-topbar .viewer-control {
  width: 100%;
}

.floating-actions {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(14px, calc((100vw - 430px) / 2 + 14px));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 3px solid var(--sticker-white);
  outline: 1px solid rgba(42, 37, 32, 0.1);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.94);
  box-shadow: none;
  color: var(--ink);
  font-size: 18px;
  font-weight: 820;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.floating-button img {
  width: 31px;
  height: 31px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.floating-button:hover {
  background: #ffffff;
}

.floating-button:active {
  transform: scale(0.96);
}

.floating-button:focus-visible {
  outline: 2px solid rgba(255, 137, 111, 0.5);
  outline-offset: 3px;
}

.back-button {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(14px, calc((100vw - 430px) / 2 + 14px));
  z-index: 45;
  font-size: 23px;
  font-weight: 680;
}

.back-button img {
  display: none;
}

.home-compose-entry {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 7px 12px 7px 10px;
  border: 3px solid var(--sticker-white);
  outline: 1px solid rgba(42, 37, 32, 0.1);
  border-radius: 18px;
  background: #fff0b8;
  box-shadow: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 780;
  line-height: 1;
}

.home-compose-entry img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}

.home-compose-entry:hover {
  background: #ffeaa1;
}

.home-compose-entry:active {
  transform: scale(0.99);
}

.home-compose-entry:focus-visible {
  outline: 2px solid rgba(255, 137, 111, 0.5);
  outline-offset: 3px;
}

.home-compose-arrow {
  margin-left: auto;
  color: rgba(42, 37, 32, 0.48);
  font-size: 25px;
  font-weight: 520;
  line-height: 1;
}

.pane-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: -6px 0 14px;
}

.pane-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(42, 37, 32, 0.2);
}

.pane-dots span.is-active {
  width: 20px;
  background: rgba(42, 37, 32, 0.55);
}

.swipe-shell {
  touch-action: pan-y;
}

.swipe-pane.is-hidden {
  display: none;
}

.group-columns {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 394px;
  margin: 0 auto;
}

.group-column {
  display: grid;
  gap: 10px;
  width: 100%;
}

.group-column .note-grid {
  width: 100%;
  max-width: none;
  margin: 0;
}

.group-column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.group-column-title small {
  font-size: 12px;
  font-weight: 680;
}

.app-tabbar {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: max(12px, env(safe-area-inset-bottom));
  top: auto;
  z-index: 30;
  width: min(408px, calc(100% - 28px));
  margin: 0;
  transform: translateX(-50%);
  border-radius: 28px;
  background:
    var(--speckle),
    rgba(255, 252, 246, 0.9);
  background-size: 10px 10px, auto;
}

.mode-tab {
  min-height: 38px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}

.mode-tab.is-active {
  background: #fff3d1;
  color: var(--text);
}

.mode-tab[data-mode="saved"].is-active {
  background: var(--saved-green);
  color: var(--saved-green-ink);
}

.mode-tab[data-live-mode="saved"].is-active {
  background: var(--saved-green);
  color: var(--saved-green-ink);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(360px, 430px);
  gap: 18px;
  align-items: start;
  justify-content: center;
}

.workspace.is-hidden {
  display: none;
}

.auth-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

.auth-panel[hidden],
[hidden] {
  display: none !important;
}

.auth-card {
  min-height: 330px;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px;
  border: 5px solid var(--sticker-white);
  border-radius: 32px;
  background:
    var(--speckle),
    rgba(255, 252, 246, 0.84);
  background-size: 10px 10px, auto;
  box-shadow: 0 0 0 1px rgba(42, 37, 32, 0.08), var(--shadow);
}

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

.auth-card-primary {
  min-height: calc(100vh - 84px);
  align-content: center;
}

.auth-card-primary h1 {
  margin-bottom: 4px;
}

.auth-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
  line-height: 1.55;
}

.todo-card {
  background:
    var(--speckle),
    rgba(240, 232, 255, 0.76);
  background-size: 10px 10px, auto;
}

.invite-card,
.invite-banner {
  background:
    var(--speckle),
    rgba(255, 226, 217, 0.78);
  background-size: 10px 10px, auto;
}

.invite-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 5px solid var(--sticker-white);
  border-radius: 28px;
  box-shadow: 0 0 0 1px rgba(42, 37, 32, 0.08), var(--shadow);
}

.invite-banner strong {
  display: block;
  color: var(--text);
  font-size: 17px;
}

.composer,
.wall {
  border-radius: 38px;
}

.composer {
  padding: 18px;
  position: static;
  background:
    var(--speckle),
    rgba(255, 252, 246, 0.86);
  background-size: 10px 10px, auto;
}

.section-title,
.wall-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-title {
  margin-bottom: 18px;
}

.section-title p {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

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

.task-form {
  display: grid;
  gap: 14px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border: 4px solid var(--sticker-white);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 0 0 1px var(--hairline);
}

.segment-button {
  min-height: 44px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  font-weight: 720;
}

.segment-button.is-active {
  background: #fff3d1;
  color: var(--text);
}

.task-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
}

.relation-form {
  margin-bottom: 14px;
}

.relation-list {
  margin-top: 14px;
}

.form-message {
  min-height: 18px;
  margin: -2px 0 0;
  color: #b94646;
  font-size: 13px;
  font-weight: 680;
  line-height: 1.35;
}

.success-message {
  color: var(--saved-green-ink);
}

.form-message[hidden] {
  display: none;
}

.primary-action,
.ghost-action {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 0;
  font-weight: 700;
  line-height: 1.2;
}

.primary-action {
  background: var(--action-post);
  color: #ffffff;
}

.primary-action:hover {
  background: var(--action-post-deep);
}

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

.ghost-action {
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  border: 1px solid var(--hairline);
  box-shadow: none;
}

.ghost-action:disabled {
  cursor: default;
  opacity: 0.48;
}

.wall {
  min-height: calc(100vh - 194px);
  padding: 18px;
  overflow: hidden;
  background:
    var(--speckle),
    rgba(255, 252, 246, 0.84);
  background-size: 10px 10px, auto;
}

.wall::before {
  content: "";
  display: block;
  width: 34%;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.12);
}

.wall-heading {
  margin-bottom: 18px;
}

.wall-heading > div {
  min-width: 0;
}

.member-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.member-pill {
  border: 4px solid var(--sticker-white);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 0 0 1px var(--hairline);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.note-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 394px;
  margin: 0 auto;
}

.note {
  position: relative;
  min-height: 184px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 18px 16px;
  border: 5px solid var(--sticker-white);
  border-radius: 28px;
  background: var(--note-fill);
  box-shadow: var(--sticker-shadow);
}

.note:nth-child(5n + 1) {
  --note-fill: #fff1a8;
}

.note:nth-child(5n + 2) {
  --note-fill: #dff3f7;
}

.note:nth-child(5n + 3) {
  --note-fill: #e6f4d8;
}

.note:nth-child(5n + 4) {
  --note-fill: #fff6e7;
}

.note:nth-child(5n + 5) {
  --note-fill: #f4e8ff;
}

.note.is-done {
  opacity: 0.62;
}

.note.is-done .note-description {
  text-decoration: line-through;
}

.note-topline,
.note-meta,
.completion-list {
  color: rgba(29, 29, 31, 0.62);
  font-size: 12px;
  font-weight: 650;
}

.note-topline,
.note-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(42, 37, 32, 0.62);
}

.note-description {
  margin: 13px 0 0;
  font-size: 19px;
  line-height: 1.28;
  font-weight: 720;
  color: var(--ink);
}

.note-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.note-title-row .note-description {
  min-width: 0;
}

.object-tag {
  flex: 0 0 auto;
  max-width: 96px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 5px solid var(--sticker-white);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(42, 37, 32, 0.08);
  color: rgba(42, 37, 32, 0.68);
  font-size: 13px;
  font-weight: 820;
  line-height: 1.1;
  text-align: center;
}

.reward {
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(42, 37, 32, 0.78);
  border: 4px solid var(--sticker-white);
  box-shadow: 0 0 0 1px rgba(42, 37, 32, 0.12);
  font-size: 13px;
  font-weight: 700;
}

.note-actions {
  display: grid;
  gap: 10px;
}

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

.complete-action,
.reject-action,
.withdraw-action,
.danger-action,
.quiet-danger-action {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  font-weight: 720;
}

.complete-action {
  background: var(--action-done);
  color: #285b3d;
}

.complete-action:hover {
  background: var(--action-done-deep);
}

.complete-action:active {
  transform: scale(0.99);
}

.reject-action,
.withdraw-action {
  border: 1px solid rgba(29, 29, 31, 0.1);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
  color: rgba(29, 29, 31, 0.68);
}

.danger-action {
  width: fit-content;
  min-height: 44px;
  padding: 0 12px;
  justify-self: end;
  border: 0;
  background: rgba(169, 77, 77, 0.08);
  box-shadow: none;
  color: rgba(169, 77, 77, 0.78);
  font-size: 12px;
  font-weight: 760;
}

.quiet-danger-action {
  width: fit-content;
  min-height: 44px;
  padding: 0 12px;
  justify-self: end;
  border: 0;
  background: transparent;
  color: rgba(169, 77, 77, 0.72);
  font-size: 12px;
  font-weight: 760;
}

.inline-confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 5px 6px 5px 12px;
  border: 1px solid rgba(169, 77, 77, 0.14);
  border-radius: 16px;
  background: rgba(255, 252, 246, 0.9);
  box-shadow: none;
  color: rgba(42, 37, 32, 0.72);
  font-size: 12px;
  font-weight: 720;
}

.inline-confirm span {
  min-width: 0;
}

.inline-confirm button {
  min-width: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 780;
}

.inline-confirm-yes {
  background: rgba(169, 77, 77, 0.12);
  color: #a94d4d;
}

.inline-confirm-no {
  background: rgba(255, 255, 255, 0.72);
  color: rgba(42, 37, 32, 0.62);
}

.reject-action {
  font-size: 24px;
  line-height: 1;
}

.complete-action:disabled {
  cursor: default;
  background: rgba(80, 91, 84, 0.24);
}

.completion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.done-chip {
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.56);
  border: 3px solid var(--sticker-white);
  box-shadow: 0 0 0 1px rgba(42, 37, 32, 0.08);
}

.member-remove-chip {
  min-height: 36px;
  color: rgba(42, 37, 32, 0.68);
  font: inherit;
}

.member-remove-chip span {
  color: #a94d4d;
  font-weight: 760;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  border: 1px dashed rgba(0, 0, 0, 0.16);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.window-empty-state {
  min-height: 420px;
  display: grid;
  align-items: start;
  justify-items: center;
  padding-top: 250px;
  color: rgba(42, 37, 32, 0.38);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
}

.time-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.saved-workspace {
  grid-template-columns: minmax(360px, 430px);
}

.saved-wall {
  width: 100%;
  border-color: rgba(47, 104, 77, 0.16);
  background:
    var(--speckle),
    rgba(248, 255, 246, 0.78);
  background-size: 10px 10px, auto;
}

.saved-list .note {
  filter: saturate(0.82);
  box-shadow: var(--sticker-shadow);
}

.saved-stamp {
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  border: 4px solid var(--sticker-white);
  background: rgba(223, 242, 218, 0.72);
  box-shadow: 0 0 0 1px rgba(47, 104, 77, 0.16);
  color: var(--saved-green-ink);
  font-size: 12px;
  font-weight: 650;
}

.account-info {
  max-width: 394px;
  margin: 0 auto;
}

.invite-link {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.live-status {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 40;
  width: min(386px, calc(100% - 48px));
  min-height: 38px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 9px 14px;
  transform: translateX(-50%);
  border: 4px solid var(--sticker-white);
  border-radius: 999px;
  background:
    var(--speckle),
    rgba(255, 252, 246, 0.94);
  background-size: 10px 10px, auto;
  box-shadow: 0 0 0 1px rgba(42, 37, 32, 0.08), 0 14px 34px rgba(80, 56, 32, 0.16);
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
  text-align: center;
}

.relations-card {
  min-height: auto;
}

.relations-card + .relations-card {
  margin-top: 14px;
}

@media (max-width: 840px) {
  .app-shell {
    width: min(100% - 22px, 430px);
    padding: 14px 0 24px;
  }

  .live-shell {
    padding-bottom: calc(34px + env(safe-area-inset-bottom));
  }

  .topbar,
  .auth-panel,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  .viewer-control {
    width: 100%;
  }

  .workspace {
    display: grid;
    justify-content: stretch;
  }

  .composer {
    position: static;
  }

  .wall {
    min-height: 560px;
  }
}

@media (max-width: 540px) {
  .wall-heading {
    align-items: center;
  }

  .wall-heading .ghost-action {
    flex: 0 0 auto;
  }

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

  .note {
    transform: none;
  }

  .note-title-row {
    display: grid;
    gap: 10px;
  }

  .object-tag {
    justify-self: start;
    margin-top: 0;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 23px;
  }
}
