/* Group cards: start form, signing page, manage page and the board of wishes. */

.grp .page-head h1 { overflow-wrap: anywhere; }
.grp-lead { margin: 8px 0 0; }
.grp-center { text-align: center; margin: 0; }
.grp-h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.grp-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; }
.grp-paper { width: min(100%, 420px); margin: 0 auto; transform: rotate(-1.5deg); }

/* Start form */
.grp-new { display: flex; flex-direction: column; gap: 28px; max-width: 680px; }

/* Create page: below the card, the wishes to come. */
.grp-preview { display: flex; flex-direction: column; gap: 16px; }
.grp-preview-board { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: #E6DAC3; }
.grp-preview-note { margin: 0; padding: 12px 14px; border-radius: 4px; background: #FFFDF6; box-shadow: 0 3px 8px rgba(0, 0, 0, .08); font-family: "Caveat", cursive; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; white-space: pre-line; }
.grp-preview-note strong { display: block; margin-top: 4px; font-family: var(--body); font-size: 15px; }
.grp-preview-empty { margin: 0; color: #6B5E45; font-size: 16px; }
.grp-step { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 20px; border: 2px solid var(--line); border-radius: 22px; background: var(--surface); min-width: 0; }
.grp-step legend { display: flex; align-items: center; gap: 10px; padding: 0 6px; font: 800 22px/1.2 var(--display); color: var(--green); }
.grp-step-nr { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--lime); font-size: 18px; }
.grp-optional { font-weight: 400; color: var(--muted); }
.grp-designs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grp-design { position: relative; display: block; border-radius: 12px; cursor: pointer; }
.grp-design input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.grp-design img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 4px solid transparent; }
.grp-design-caption { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-design:has(input:checked) .grp-design-caption { color: var(--green); font-weight: 700; }
.grp-design input:checked + img { border-color: var(--green); box-shadow: 0 0 0 3px var(--lime); }
.grp-design input:focus-visible + img { outline: 3px solid var(--green); outline-offset: 3px; }
.grp-design:has(input:checked)::after { content: "✓"; position: absolute; top: 8px; right: 8px; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: var(--lime); font-weight: 700; }
.grp-more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* Signing page: card, form, then the board on phones; card and board left, form right on wide screens. */
.grp-owner { margin: 16px 0 0; }
.grp-owner a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--lime); color: var(--green); font-weight: 700; text-decoration: none; }
.grp-sign { display: grid; gap: 28px; grid-template-areas: "card" "form" "board"; }
.grp-sign-card { grid-area: card; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.grp-sign-card .grp-paper { width: min(62%, 240px); }
.grp-manage-side .grp-paper { width: min(70%, 260px); }
.grp-sign-form { grid-area: form; min-width: 0; }
.grp-sign-board { grid-area: board; min-width: 0; }
.grp-count { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-weight: 700; color: var(--green); text-align: center; }
.grp-form { display: flex; flex-direction: column; gap: 16px; }
.grp-form h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.grp-form p { margin: 0; }
.grp-counter { align-self: flex-end; }
.grp-thanks, .grp-delivered { gap: 14px; padding: 22px; border-color: #DCEB9C; background: #F6FBE1; }
.grp-thanks p, .grp-delivered p, .grp-done p, .grp-invite p, .grp-deliver p { margin: 0; }
.grp-thanks-title { display: flex; align-items: center; gap: 10px; font: 800 30px/1.1 var(--display); color: var(--green); }
.grp-thanks-title .heart { width: 30px; height: 30px; }
.grp-done { padding: 22px; }

/* The board of wishes: cork-coloured, notes flow in columns. */
.grp-board { padding: 22px; border-radius: 22px; background: #E6DAC3; background-image: radial-gradient(rgb(23 34 28 / .07) 1px, transparent 1.5px); background-size: 14px 14px; box-shadow: var(--shadow-card); }
.grp-board-title { margin: 0 0 16px; font: 800 clamp(24px, 3vw, 32px)/1.05 var(--display); color: var(--green); }
.grp-board-empty { margin: 0; padding: 18px; border-radius: 4px; background: rgb(255 253 248 / .7); font: 600 24px/1.2 var(--hand); color: var(--navy); text-align: center; }
.grp-notes { columns: 2 220px; column-gap: 14px; margin: 0; padding: 0; list-style: none; }
.grp-note { break-inside: avoid; margin: 0 0 14px; padding: 14px 16px 12px; border-radius: 4px; background: #FFFDF8; color: var(--navy); box-shadow: 0 3px 8px rgb(0 0 0 / .14); font: 600 24px/1.18 var(--hand); }
.grp-note p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.grp-note-name { display: block; margin-top: 8px; font-size: 21px; text-align: right; }
.grp-note-name::before { content: "— "; }
.grp-note-1 { transform: rotate(-1.4deg); }
.grp-note-2 { transform: rotate(1.1deg); color: #7A1F18; background: #FFF6E0; }
.grp-note-3 { transform: rotate(.6deg); color: var(--green); }
.grp-note-4 { transform: rotate(-.8deg); color: #4A3520; background: #F4F9E4; }
.grp-note-5 { transform: rotate(1.6deg); color: var(--navy); background: #EEF4FB; }
.grp-note-6 { transform: rotate(-1.8deg); color: #5B2A5E; }
.grp-note.is-mine { outline: 3px solid var(--green); outline-offset: 2px; }

/* Under the card on the recipient page. */
.grp-for-card { grid-column: 1 / -1; order: 3; display: flex; flex-direction: column; gap: 14px; }
.grp-for-card-lead { margin: 0; font: 800 clamp(24px, 3vw, 32px)/1.1 var(--display); color: var(--lime); }

/* Manage page */
.grp-keep { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; padding: 14px 18px; border-radius: 14px; background: var(--sand); color: var(--ink); font-size: 16px; }
.grp-manage { display: grid; gap: 28px; }
.grp-manage-main, .grp-manage-side { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.grp-invite, .grp-deliver, .grp-invite-mail { gap: 14px; padding: 22px; }
.grp-invite-mail p { margin: 0; }
.grp-invite-mail textarea { width: 100%; }
.grp-invited { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.grp-invited li { display: flex; justify-content: space-between; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.grp-status { flex: none; padding: 2px 10px; border-radius: 999px; background: var(--sand); color: var(--muted); font-size: 14px; }
.grp-status.is-signed { background: var(--green); color: var(--ground); font-weight: 700; }
.grp-deliver-now summary { list-style: none; }
.grp-deliver-now summary::-webkit-details-marker { display: none; }
.grp-deliver-now[open] summary { margin-bottom: 10px; }
.grp-deliver-now form { gap: 12px; }
.grp-url { padding: 12px 14px; border-radius: 12px; background: var(--sand); font-weight: 700; overflow-wrap: anywhere; }
.grp-wishes { display: flex; flex-direction: column; gap: 14px; }
.grp-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.grp-list li { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.grp-list-text { flex: 1 1 240px; min-width: 0; }
.grp-list-text p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--muted); }
.grp-remove { min-height: 46px; padding: 0 16px; font-size: 16px; }
.grp-removed summary, .grp-plan summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--green); }
.grp-removed .grp-list { margin-top: 10px; }
.grp-plan-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.grp-plan .field input { min-height: 52px; }
/* A date needs its room; side by side only where both fit. */
.grp-plan .two { grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); }
.grp-title-form { display: flex; flex-direction: column; gap: 12px; }

@media (min-width: 640px) {
  .grp-designs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .grp-sign { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "card form" "board form"; gap: 32px 56px; align-items: start; }
  .grp-sign-form { position: sticky; top: 96px; }
  .grp-sign-card .grp-paper { width: min(100%, 360px); }
  .grp-manage { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 56px; align-items: start; }
}

/* Anchored sections stay clear of the sticky header. */
.grp-thanks, .grp-delivered, .grp-wishes { scroll-margin-top: 96px; }
.grp .two .btn { padding: 0 12px; }
