:root {
  color-scheme: light;
  --page-bg: #fdf8ec;
  --panel-bg: #fffdf7;
  --line: #e9dfcc;
  --text-main: #2f2b28;
  --text-soft: #7c736d;
  --mint: #dcf6d7;
  --mint-strong: #7edb9c;
  --lilac: #d8c8fb;
  --peach: #ffd9c8;
  --pink: #ffd4da;
  --purple: #8f73ea;
  --shadow: 0 18px 40px rgba(132, 111, 88, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-ui: "Quicksand", "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text-main);
  background: var(--page-bg);
}

body.viewer-open {
  overflow: hidden;
}

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

button {
  border: 0;
  background: none;
}

.app-shell {
  min-height: 100vh;
  padding: 24px 16px 40px;
}

.app-layout {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.home-shell {
  display: grid;
  gap: 24px;
}

.hero-card,
.panel-card {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.hero-topbar,
.modal-head,
.panel-head,
.timeline-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.avatar-button {
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}

.avatar-image,
.avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.avatar-image {
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0.08)),
    radial-gradient(circle at 30% 30%, #d8c8fb, #b99ef6);
}

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

.eyebrow {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
}

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

h1 {
  font-size: 34px;
  line-height: 1.08;
  font-weight: 700;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

h3 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.status-pill {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.status-pill strong {
  font-size: 26px;
  line-height: 1.1;
}

.status-pill small {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.feature-card {
  display: grid;
  gap: 12px;
}

.feature-media-panel,
.feature-copy-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.feature-media {
  min-height: 240px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0)),
    linear-gradient(120deg, #d9d9d9, #c8c8c8);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.feature-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -18deg,
    rgba(255,255,255,0.24) 0 10px,
    rgba(255,255,255,0) 10px 24px
  );
}

.feature-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f7f1e8;
  z-index: 1;
  cursor: zoom-in;
}

.feature-copy {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f4f0ff;
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
  justify-self: start;
}

.feature-copy p {
  color: var(--text-soft);
  line-height: 1.6;
}

.quick-access {
  display: grid;
  gap: 14px;
}

.section-caption h2 {
  font-size: 16px;
}

.action-grid {
  display: grid;
  gap: 12px;
}

.action-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  padding: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  box-shadow: var(--shadow);
}

.action-card-primary {
  background: var(--mint);
}

.action-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.86);
  color: #63b97f;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
}

.action-icon-lilac {
  color: var(--purple);
  background: #f2ebff;
}

.action-icon-peach {
  color: #f0a06b;
  background: #fff1e7;
}

.action-content {
  display: grid;
  gap: 4px;
  flex: 1;
}

.action-content strong {
  font-size: 18px;
}

.action-content small {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.action-arrow {
  font-size: 24px;
  color: #5fbc7d;
}

.workspace-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(320px, 1.08fr);
  gap: 24px;
  align-items: start;
}

.workspace-shell > .panel-card:last-child {
  grid-column: 1 / -1;
}

.panel-card {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.stack-form,
.field-row,
.timeline-list {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.date-field {
  display: grid;
  gap: 10px;
}

.date-shortcuts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.date-chip {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #e7dcc9;
  background: #fffaf1;
  color: #6f675f;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.date-chip:hover {
  border-color: #d7c5ff;
  background: #f7f1ff;
  color: var(--purple);
}

.field span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-main);
  outline: none;
}

input[type="date"] {
  min-height: 56px;
  appearance: none;
  -webkit-appearance: none;
}

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

.field-upload {
  position: relative;
}

.field-upload input[type="file"] {
  position: absolute;
  inset: 30px 0 0 0;
  width: 100%;
  height: calc(100% - 30px);
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  border: 1px dashed #d7c5ff;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fff, #fcf7ff);
  min-height: 88px;
}

.upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f3eeff;
  color: var(--purple);
  font-size: 20px;
  flex: 0 0 auto;
}

.upload-copy {
  display: grid;
  gap: 4px;
}

.upload-copy strong {
  font-size: 16px;
}

.upload-copy small {
  color: var(--text-soft);
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #d7c5ff;
  box-shadow: 0 0 0 4px rgba(216, 200, 251, 0.3);
}

.primary-btn {
  min-height: 54px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, #ae8cf0, #d8a0c2);
  cursor: pointer;
  font-weight: 700;
}

.primary-btn-soft {
  background: linear-gradient(90deg, #8fd6a3, #bfe7b1);
  color: #274133;
}

.summary-note {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.timeline-item,
.timeline-empty {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  gap: 12px;
}

.timeline-date,
.timeline-tags {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.timeline-date {
  background: #f3eeff;
  color: var(--purple);
}

.timeline-tags {
  background: #fff1e7;
  color: #d58544;
}

.timeline-text,
.timeline-empty p {
  color: var(--text-soft);
  line-height: 1.65;
}

.timeline-photos {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.timeline-photos img {
  width: 104px;
  height: 104px;
  border-radius: 16px;
  object-fit: cover;
  flex: 0 0 auto;
  cursor: zoom-in;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(47, 43, 40, 0.38);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 30;
}

.modal-card {
  width: min(100%, 420px);
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 48px rgba(47, 43, 40, 0.18);
  padding: 20px;
  display: grid;
  gap: 16px;
}

.cleanup-panel {
  display: grid;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.cleanup-head {
  display: grid;
  gap: 4px;
}

.cleanup-head h3 {
  margin: 0;
  font-size: 16px;
}

.cleanup-head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.summary-modal-card {
  width: min(100%, 430px);
  max-height: min(96svh, 860px);
  overflow: hidden;
  padding: 18px 18px 16px;
}

.summary-head-spacer {
  width: 24px;
  height: 24px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-main);
  font-size: 24px;
  cursor: pointer;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 10, 12, 0.92);
  display: grid;
  grid-template-rows: auto 1fr;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

.photo-viewer-close {
  width: 42px;
  height: 42px;
  margin-left: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.photo-viewer-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding-top: 10px;
}

.photo-viewer-image {
  width: 100%;
  height: 100%;
  max-width: min(100vw - 24px, 1100px);
  max-height: min(100dvh - 96px, 92svh);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.is-hidden {
  display: none !important;
}

.summary-poster {
  display: grid;
  gap: 18px;
  padding: 8px 4px 4px;
  background: linear-gradient(180deg, #fffef8, #f6ffef);
}

.summary-poster-head {
  display: flex;
}

.summary-poster-section {
  display: grid;
  gap: 8px;
  padding: 0;
}

.summary-poster-section h4 {
  margin: 0;
  font-size: 18px;
}

.summary-poster-section p {
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 17px;
  display: block;
  overflow: visible;
}

.summary-modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-action-btn {
  min-height: 52px;
}

.danger-btn {
  min-height: 50px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, #de8a8a, #c46262);
  cursor: pointer;
  font-weight: 700;
}

.danger-btn:disabled {
  opacity: 0.75;
}

@media (max-width: 899px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-shell > .panel-card:last-child {
    grid-column: auto;
  }
}

@media (max-width: 639px) {
  .app-shell {
    padding: 16px 12px 28px;
  }

  .app-layout {
    gap: 18px;
  }

  .hero-card,
  .panel-card {
    padding: 18px;
  }

  .feature-media {
    min-height: 180px;
  }

  .photo-viewer {
    padding: max(10px, env(safe-area-inset-top)) 10px max(16px, env(safe-area-inset-bottom));
  }

  .photo-viewer-close {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .photo-viewer-image {
    max-width: 100%;
    max-height: min(100dvh - 76px, 94svh);
  }

  h1 {
    font-size: 24px;
  }

  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}
