:root {
  --paper: #fffdf9;
  --paper-deep: #f5efe7;
  --card: rgba(255, 255, 255, 0.92);
  --ink: #2d211b;
  --muted: #8d7b70;
  --line: #e6d8ca;
  --brown: #6f4f3f;
  --green: #8fa56d;
  --green-soft: #f1f6e9;
  --pink: #c96b68;
  --pink-soft: #fff3f1;
  --shadow: 0 12px 28px rgba(79, 57, 43, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 10%, rgba(245, 239, 231, 0.9), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #faf7f2 52%, #fffdf9 100%);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", Meiryo, sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

.phone-shell {
  width: min(100vw, 430px);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--paper) 100%);
  box-shadow: var(--shadow);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 14px 20px 16px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.app-header::before,
.bottom-nav::before {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0.13;
  background-repeat: no-repeat;
  background-size: contain;
}

.app-header::before {
  right: 22px;
  bottom: 6px;
  width: 92px;
  height: 46px;
  background-image: url("./plant-header.png");
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title-row {
  min-height: 44px;
  text-align: center;
}

.title-row > div {
  flex: 1;
}

.header-list-tools {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-top: 8px;
}

.header-list-tools.hidden {
  display: none;
}

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

#screenTitle {
  color: var(--brown);
  font-size: clamp(18px, 4.8vw, 23px);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#screenSubtitle {
  margin-top: 4px;
  color: var(--brown);
  font-size: 14px;
  font-weight: 700;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  color: var(--brown);
  font-size: 30px;
  line-height: 1;
}

.icon-button.hidden {
  visibility: hidden;
}

.header-spacer {
  width: 38px;
  height: 38px;
  display: block;
}

.app-main {
  min-height: calc(100vh - 120px);
  padding: 22px 18px 112px;
}

.guide-main {
  padding-top: 14px;
  padding-bottom: 92px;
}

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

.add-task-top-button {
  margin-bottom: 16px;
}

.screen-head h2 {
  color: var(--brown);
  font-size: 21px;
  font-weight: 800;
}

.list-note {
  display: inline-block;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid #ffc4cc;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--pink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.guide-link {
  margin-top: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.soft-toggle {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #d8c4b1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brown);
  font-size: 12px;
  font-weight: 700;
}

.member-tabs {
  display: flex;
  gap: 6px;
  margin: -2px -18px 16px;
  padding: 6px 18px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(247, 239, 227, 0.56);
  border-top: 1px solid rgba(236, 220, 202, 0.72);
  border-bottom: 1px solid rgba(236, 220, 202, 0.72);
}

.member-tabs::-webkit-scrollbar {
  display: none;
}

.member-tab {
  flex: 0 0 auto;
  min-height: 34px;
  max-width: 180px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-tab.active {
  border-color: #cdbbaa;
  background: #fffdf8;
  color: var(--brown);
  box-shadow: 0 4px 12px rgba(111, 67, 31, 0.08);
}

.all-tasks-button {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border: 1px solid #d9c8b9;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brown);
  font-size: 14px;
  font-weight: 850;
}

.primary-button,
.secondary-button,
.line-button,
.copy-button,
.danger-button {
  width: 100%;
  min-height: 54px;
  border-radius: 999px;
  font-weight: 800;
}

.primary-button {
  border: 1px solid #bfa99a;
  background: #fffdf8;
  color: var(--brown);
  box-shadow: none;
}

.secondary-button {
  border: 1px solid #b9d59c;
  background: #fbfff4;
  color: #4f8d31;
}

.inline-save.secondary-button {
  width: auto;
  min-width: 74px;
  min-height: 32px;
  display: block;
  margin-left: auto;
  padding: 0 12px;
  border-color: #d9c8b9;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brown);
  font-size: 12px;
}

.save-block {
  display: flex;
  justify-content: flex-end;
}

.task-save-button {
  min-width: 112px;
  min-height: 38px;
  padding: 0 20px;
  border: 1px solid #b85b50;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #a9463d;
  font-size: 14px;
  font-weight: 850;
}

.line-button {
  border: 1px solid #93c879;
  background: #fbfff4;
  color: #3b9e37;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #b9d59c;
  background: #f5fbec;
  color: #3b8d35;
}

.danger-button {
  border: 1px solid #efc8bc;
  background: #fff7f3;
  color: #a8533d;
}

.tiny-delete-button {
  width: auto;
  min-height: 28px;
  justify-self: end;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #b18576;
  font-size: 11px;
  font-weight: 700;
}

.line-mark {
  min-width: 42px;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #12be33;
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.task-groups {
  display: grid;
  gap: 12px;
}

.overview-groups {
  grid-template-rows: repeat(4, minmax(116px, auto));
}

.group-card,
.detail-card,
.form-card,
.member-card,
.empty-card {
  position: relative;
  border: 1px solid rgba(230, 216, 202, 0.78);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 6px 18px rgba(79, 57, 43, 0.035);
}

.group-card {
  padding: 18px 18px 16px;
}

.compact-group-card {
  min-height: 116px;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 18px;
}

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

.task-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 18px;
  gap: 8px;
  align-items: start;
  width: 100%;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.task-chevron {
  align-self: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.checkbox {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1.5px solid #a37b62;
  border-radius: 4px;
  background: white;
  color: var(--green);
  font-size: 15px;
  font-weight: 900;
}

.task-row.done .task-name {
  color: var(--muted);
  text-decoration: line-through;
}

.task-name {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.55;
}

.task-plan {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.continue-button {
  width: auto;
  min-height: 28px;
  display: block;
  margin: 8px 0 0 auto;
  padding: 0 4px;
  background: transparent;
  color: var(--brown);
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-card,
.form-card {
  padding: 18px;
}

.detail-title {
  display: block;
  padding-bottom: 8px;
}

.editable-fields-box {
  margin: 8px 0 12px;
  padding: 14px;
  border: 1.5px solid #d8c4b1;
  border-radius: 16px;
  background: #fffbf4;
}

.dot {
  width: 14px;
  height: 14px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--pink);
}

.detail-title h2 {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.5;
}

.title-input {
  min-height: 58px;
  max-height: 96px;
  line-height: 1.5;
  font-size: 17px;
  font-weight: 400;
  resize: none;
  overflow-y: auto;
  overflow-wrap: anywhere;
}

.field-block {
  padding: 10px 0;
}

.field-block:last-child {
  padding-bottom: 0;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
}

.field-hint {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.field-value {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.7;
  white-space: pre-wrap;
}

.assignee-display {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 800;
}

.choice-title {
  font-size: 19px;
  line-height: 1.45;
}

.assignee-choice-list {
  display: grid;
  gap: 10px;
}

.assignee-choice {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  text-align: left;
}

.selected-assignee {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.selected-assignee .field-label {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.selected-assignee strong {
  font-size: 17px;
}

.soft-field {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.plan-block,
.deadline-block,
.plan-form-field {
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.nudge-label {
  display: inline-block;
  padding: 0 5px 2px;
  border-radius: 5px;
  background: linear-gradient(to top, rgba(246, 108, 121, 0.22) 48%, transparent 48%);
  color: var(--ink);
}

.plan-input,
.deadline-input {
  border-color: #d8c4b1;
  background: #fffbf4;
  color: var(--ink);
  font-weight: 400;
}

.plan-save {
  border-color: #d9c8b9;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brown);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 58px;
  padding: 14px;
  border: 1px solid #e4d6c9;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  outline: none;
}

.input::placeholder,
.textarea::placeholder {
  color: #cfc4bb;
  opacity: 1;
}

.textarea {
  min-height: 58px;
  max-height: 96px;
  resize: none;
  overflow-y: auto;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: #bdd59d;
  box-shadow: 0 0 0 4px rgba(139, 180, 107, 0.14);
}

.complete-check {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: 1.5px solid #d8c4b1;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.complete-check.pending {
  border-color: #f6b5c2;
  background: #fff7f9;
}

.done-stack {
  display: grid;
  gap: 10px;
}

.done-save-button,
.done-return-button {
  width: 100%;
  min-height: 46px;
  border-radius: 999px;
  font-weight: 850;
}

.done-save-button {
  background: linear-gradient(135deg, #b86b62, #ca7b70);
  color: white;
  box-shadow: 0 10px 22px rgba(142, 85, 75, 0.18);
}

.done-return-button {
  border: 1px solid #efc8bc;
  background: #fff7f3;
  color: #a8533d;
}

.history {
  display: grid;
  gap: 16px;
}

.history-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
}

.history-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 18px;
  bottom: -17px;
  width: 1px;
  background: #f5b6c0;
}

.history-item:last-child::before {
  display: none;
}

.history-dot {
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--pink);
}

.history-meta {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 800;
}

.history-text {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.detail-actions {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.share-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.detail-top-note {
  margin: -8px 0 12px;
  color: var(--brown);
}

.top-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brown);
  font-size: 14px;
  font-weight: 850;
}

.guide-card {
  padding: 16px 16px 14px;
}

.guide-section {
  padding: 10px 0;
  border-bottom: 1px solid #f4dce2;
}

.guide-section:first-child {
  padding-top: 0;
}

.guide-section:last-of-type {
  border-bottom: 0;
}

.guide-card h2 {
  position: relative;
  margin-bottom: 10px;
  padding-left: 14px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
}

.guide-card h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 4px;
  border-radius: 999px;
  background: var(--pink);
}

.guide-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
}

.guide-list li::marker {
  color: var(--pink);
}

.guide-steps {
  display: grid;
  gap: 4px;
}

.guide-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.step-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #b86b62, #ca7b70);
  color: white;
  font-size: 16px;
  font-weight: 900;
}

.step-box {
  min-height: 42px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 2px solid #ffd2dc;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.step-icon,
.line-badge {
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--pink);
  font-size: 10px;
  font-weight: 900;
}

.step-icon {
  border: 2px solid var(--pink);
}

.line-badge {
  border-radius: 999px;
  background: #12be33;
  color: white;
}

.step-arrow {
  color: var(--pink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.inline-save {
  margin-top: 8px;
}

.form-stack,
.member-stack {
  display: grid;
  gap: 18px;
}

.member-card,
.empty-card {
  padding: 16px;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.member-edit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 8px;
}

.member-card.dragging {
  opacity: 0.56;
}

.member-card.drag-over {
  border-color: #b9d59c;
  box-shadow: 0 0 0 4px rgba(139, 180, 107, 0.14);
}

.drag-handle {
  width: 44px;
  height: 48px;
  align-self: center;
  border-radius: 12px;
  background: var(--green-soft);
  color: #5f8d3f;
  font-size: 12px;
  font-weight: 800;
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.member-name {
  font-size: 17px;
  font-weight: 850;
}

.member-count {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.member-input {
  min-height: 48px;
}

.tiny-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #5f8d3f;
  font-size: 12px;
  font-weight: 800;
}

.tiny-button:disabled {
  opacity: 0.62;
  cursor: default;
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  min-height: 86px;
  padding: 9px 14px 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.bottom-nav::before {
  left: 16px;
  top: 4px;
  width: 82px;
  height: 58px;
  background-image: url("./plant-footer.png");
}

.nav-item {
  display: grid;
  gap: 4px;
  justify-items: center;
  background: transparent;
  color: var(--brown);
  font-size: 11px;
  font-weight: 800;
}

.nav-item.active {
  color: var(--pink);
}

.nav-add.active {
  outline: 4px solid rgba(111, 79, 63, 0.1);
}

.nav-add {
  width: 58px;
  height: 58px;
  justify-self: center;
  border-radius: 50%;
  border: 1px solid #bfa99a;
  background: #fffdf8;
  color: var(--brown);
  font-size: 34px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(79, 57, 43, 0.08);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 18px);
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(47, 33, 24, 0.92);
  color: white;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.share-popup {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(47, 33, 24, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.share-popup.show {
  opacity: 1;
  pointer-events: auto;
}

.share-popup-card {
  width: min(320px, calc(100vw - 48px));
  padding: 22px 20px 18px;
  border: 1px solid #d7e8c2;
  border-radius: 20px;
  background: #fbfff4;
  box-shadow: 0 20px 50px rgba(95, 61, 31, 0.18);
  text-align: center;
}

.share-popup-title {
  margin-bottom: 10px;
  color: #4f8d31;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.45;
}

.share-popup-text {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.7;
}

.share-popup-button {
  min-width: 112px;
  min-height: 40px;
  margin-top: 16px;
  padding: 0 20px;
  border-radius: 999px;
  background: #7faf57;
  color: white;
  font-size: 14px;
  font-weight: 900;
}

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

  .phone-shell {
    min-height: 880px;
    max-height: 920px;
    border: 1px solid var(--line);
    border-radius: 28px;
  }

  .bottom-nav {
    position: sticky;
  }
}
