:root {
  --blush: #fbf7f7;
  --card: #ffffff;
  --pink-wash: #f8eeee;
  --pink-line: #ead9dc;
  --pink-line-strong: #d7b4bb;
  --rose: #b46674;
  --rose-dark: #874b58;
  --ink: #30272b;
  --muted: #7e6d72;
  --forest: #4d5e58;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
  --shadow: 0 20px 50px rgba(112, 76, 84, 0.08), 0 3px 12px rgba(112, 76, 84, 0.04);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--blush);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { border: 0; }

.app-shell { min-height: 100vh; display: flex; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  width: 238px;
  display: flex;
  flex-direction: column;
  padding: 38px 24px 30px;
  background: rgba(255, 255, 255, 0.56);
  border-right: 1px solid var(--pink-line);
}

.sidebar-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding: 0 14px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--rose);
  border-radius: 50%;
  color: var(--rose-dark);
  font-family: var(--serif);
  font-size: 27px;
  font-style: italic;
  line-height: 1;
}
.brand-rule, .footer-line { display: block; width: 100%; height: 1px; background: linear-gradient(90deg, var(--pink-line-strong), transparent); }
.module-nav { margin-top: 58px; }
.module-link {
  width: 100%;
  display: grid;
  grid-template-columns: 26px 1fr 18px;
  gap: 10px;
  align-items: center;
  padding: 15px 12px 15px 14px;
  background: transparent;
  border-left: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: 180ms ease;
}
.module-link:hover, .module-link:focus-visible, .module-link.is-active { background: rgba(255,255,255,.8); border-left-color: var(--rose); color: var(--rose-dark); outline: none; }
.module-index { color: var(--rose); font-family: var(--serif); font-size: 17px; font-style: italic; }
.module-name { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.module-arrow { color: var(--rose); font-size: 17px; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 0 14px; }
.footer-line { flex: 1; }
.footer-dot, .header-ornament span { display: block; width: 5px; height: 5px; border: 1px solid var(--rose); border-radius: 50%; }

.main-content {
  width: calc(100% - 238px);
  margin-left: 238px;
  padding: 62px clamp(34px, 5vw, 84px) 78px;
}

.page-header { display: flex; align-items: flex-end; justify-content: space-between; max-width: 1360px; margin: 0 auto; }
h1 { margin: 0; color: var(--rose-dark); font-family: var(--serif); font-size: clamp(48px, 5.2vw, 76px); font-weight: 500; letter-spacing: -0.04em; line-height: .88; }
.header-ornament { display: flex; gap: 8px; padding: 0 6px 13px 0; }
.header-ornament span:nth-child(2) { width: 7px; height: 7px; background: var(--rose); }
.section-divider { display: grid; grid-template-columns: 1fr auto 1fr; gap: 13px; align-items: center; max-width: 1360px; margin: 39px auto 36px; }
.section-divider > span:first-child, .section-divider > span:last-child { height: 1px; background: linear-gradient(90deg, var(--pink-line-strong), transparent); }
.section-divider > span:last-child { background: linear-gradient(90deg, transparent, var(--pink-line-strong)); }
.divider-diamond { width: 7px; height: 7px; background: var(--rose); transform: rotate(45deg); }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 1360px; margin: 0 auto; align-items: stretch; }
.overview-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 18px 18px 26px;
  background: var(--card);
  border: 1px solid var(--pink-line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.image-slot { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--pink-wash); border-radius: 8px; }
.card-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.image-empty { position: absolute; inset: 0; }
.change-image {
  position: absolute;
  z-index: 2;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(234,217,220,.95);
  border-radius: 999px;
  box-shadow: 0 5px 13px rgba(112,76,84,.11);
  color: var(--rose-dark);
  cursor: pointer;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
}
.change-image { right: 12px; }
.change-image:hover { background: #fff; color: var(--rose); }
.lock-icon { position: relative; width: 9px; height: 8px; border: 1px solid currentColor; border-radius: 1px; }
.lock-icon::before { position: absolute; left: 1px; top: -6px; width: 5px; height: 6px; border: 1px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; content: ""; }
.image-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.card-access-panel { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 14px; background: rgba(255,248,249,.78); backdrop-filter: blur(5px); }
.card-access-form { position: relative; width: min(100%, 360px); padding: 22px 19px 17px; background: linear-gradient(145deg, #fff, #fff7f8); border: 1px solid var(--pink-line); border-radius: 24px; box-shadow: 0 17px 35px rgba(84, 48, 58, .17); text-align: center; }
.card-access-form::after { position: absolute; inset: 9px; border: 1px solid rgba(215,180,187,.38); border-radius: 17px; content: ""; pointer-events: none; }
.access-kicker { position: relative; z-index: 1; margin: 0 0 13px; color: var(--rose-dark); font-size: 10px; font-weight: 600; letter-spacing: .16em; }
.access-code-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.access-code { position: relative; z-index: 1; width: 100%; height: 54px; padding: 0 18px; background: rgba(255,255,255,.8); border: 2px solid var(--rose); border-radius: 999px; color: var(--ink); text-align: center; letter-spacing: .17em; }
.access-code::placeholder { color: #ae9299; letter-spacing: .15em; }
.access-code:focus { background: #fff; box-shadow: 0 0 0 4px rgba(180,102,116,.12); }
.access-error { position: relative; z-index: 1; margin: 10px 0 0; color: var(--rose-dark); font-size: 11px; }
.access-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 13px; }
.unlock-button, .cancel-button { min-width: 105px; padding: 12px 15px; border-radius: 999px; cursor: pointer; font-size: 10px; font-weight: 600; letter-spacing: .11em; }
.unlock-button { background: #e98da0; color: #fff; box-shadow: 0 8px 18px rgba(180,102,116,.18); }
.unlock-button:hover { background: var(--rose); }
.cancel-button { background: #fff; border: 1px solid var(--pink-line); color: var(--rose-dark); }
.cancel-button:hover { border-color: var(--pink-line-strong); background: var(--pink-wash); }

.card-meta { display: flex; justify-content: space-between; align-items: center; margin: 22px 4px 11px; color: var(--rose); font-size: 9px; font-weight: 600; letter-spacing: .17em; }
.card-meta b { color: var(--muted); font-family: var(--serif); font-size: 18px; font-style: italic; font-weight: 500; letter-spacing: 0; }
.overview-card h2 { max-width: 570px; margin: 0 4px 13px; color: var(--ink); font-family: var(--serif); font-size: clamp(30px, 3vw, 44px); font-weight: 600; letter-spacing: -.025em; line-height: .95; }
.overview-card p { max-width: 610px; margin: 0 4px 24px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.explore-link { align-self: flex-start; margin: auto 4px 0; padding: 0; background: transparent; color: var(--rose); cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.explore-link span { display: inline-block; margin-left: 7px; font-size: 16px; transition: transform 180ms ease; }
.explore-link:hover { color: var(--rose-dark); }
.explore-link:hover span { transform: translate(3px, -3px); }

.detail-view { max-width: 1000px; margin: 0 auto; padding: 0 0 20px; }
.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.back-link { padding: 0; background: transparent; color: var(--rose); cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.back-link:hover { color: var(--rose-dark); }
.detail-index { color: var(--muted); font-family: var(--serif); font-size: 22px; font-style: italic; }
#detail-content { padding: clamp(28px, 4vw, 50px); background: var(--card); border: 1px solid var(--pink-line); border-radius: 12px; box-shadow: var(--shadow); }
.detail-title-row { border-bottom: 1px solid var(--pink-line); margin-bottom: 30px; padding-bottom: 22px; }
.detail-title-row h2 { margin: 0; color: var(--rose-dark); font-family: var(--serif); font-size: clamp(38px, 5vw, 62px); font-weight: 500; letter-spacing: -.04em; line-height: .9; }
.detail-copy { color: var(--muted); font-family: var(--serif); font-size: 21px; line-height: 1.35; }
.detail-copy p { margin: 0 0 17px; }
.commitment-close { color: var(--rose-dark); font-style: italic; }
.detail-fields { margin-top: 30px; }
.identity-fields { display: grid; grid-template-columns: 1.35fr .8fr; gap: 19px 18px; }
.identity-fields .line-field:last-child { grid-column: 1 / -1; }
.line-field { display: flex; flex-direction: column; gap: 7px; }
.line-field span { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
input, textarea { min-width: 0; color: var(--ink); background: transparent; border: 0; outline: none; resize: vertical; }
input:focus, textarea:focus { border-color: var(--rose) !important; background: rgba(248,238,238,.55); }
.line-field input { width: 100%; height: 31px; padding: 2px 0 7px; border-bottom: 1px solid var(--pink-line-strong); }
.detail-dream-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.detail-dream-field { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 9px; }
.detail-dream-field > span { grid-row: 1 / -1; color: var(--rose); font-family: var(--serif); font-size: 18px; font-style: italic; }
.detail-dream-field b { color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.detail-dream-field textarea { width: 100%; min-height: 65px; margin-top: 5px; padding: 5px 0 7px; border-bottom: 1px solid var(--pink-line-strong); line-height: 1.4; }
.detail-instruction { max-width: 650px; margin: 0 0 25px; color: var(--muted); font-family: var(--serif); font-size: 23px; font-style: italic; line-height: 1.25; }
.detail-large-field { display: flex; min-height: 300px; padding: 18px; background: var(--pink-wash); border: 1px solid var(--pink-line); border-radius: 8px; }
.detail-large-field textarea { width: 100%; min-height: 255px; padding: 3px; background-image: linear-gradient(var(--pink-line) 1px, transparent 1px); background-size: 100% 32px; line-height: 32px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1080px) {
  .sidebar { width: 204px; }
  .main-content { width: calc(100% - 204px); margin-left: 204px; padding-right: 34px; padding-left: 34px; }
  .card-grid { gap: 18px; }
  .overview-card { padding: 15px 15px 23px; }
}

@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 14px 20px; border-right: 0; border-bottom: 1px solid var(--pink-line); }
  .sidebar-brand { flex-direction: row; align-items: center; gap: 12px; padding: 0; }
  .brand-mark { width: 34px; height: 34px; font-size: 22px; }
  .brand-rule, .sidebar-footer { display: none; }
  .module-nav { margin: 0 0 0 auto; }
  .module-link { width: auto; min-width: 210px; padding: 10px 12px; }
  .main-content { width: 100%; margin-left: 0; padding: 45px 20px 50px; }
  .card-grid { grid-template-columns: 1fr; max-width: 620px; }
  .detail-view { max-width: 620px; }
}

@media (max-width: 500px) {
  .module-link { min-width: 0; grid-template-columns: 20px 1fr 16px; gap: 7px; }
  .module-name { font-size: 16px; }
  .main-content { padding-right: 14px; padding-left: 14px; }
  h1 { font-size: 49px; }
  .header-ornament { padding-top: 9px; }
  .detail-dream-list { grid-template-columns: 1fr; }
  .identity-fields { grid-template-columns: 1fr; }
  .identity-fields .line-field:last-child { grid-column: auto; }
  #detail-content { padding: 25px 21px; }
}
