:root {
  color-scheme: light;
  --paper: #f7f7f4;
  --ink: #20272b;
  --muted: #606a70;
  --accent: #365568;
  --accent-hover: #233e4e;
  --surface-soft: #e7ecef;
  --line: #bcc6cc;
  --soft-line: #d8dde0;
  --danger: #963c4d;
  --sans: 'DM Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: var(--sans);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-underline-offset: 4px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #416e89; outline-offset: 4px; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 100; padding: 12px 18px; background: var(--accent); color: white; }
.skip-link:focus { position: fixed; top: 10px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 18px 36px; border-bottom: 1px solid var(--soft-line); min-height: 84px; overflow: visible; }
.wordmark { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; white-space: nowrap; font-size: 25px; font-weight: 800; letter-spacing: .2px; line-height: 1; }
.wordmark svg { width: 28px; height: 26px; color: #526976; }
.site-nav { display: flex; align-items: center; gap: 42px; align-self: stretch; }
.site-nav a { position: relative; display: inline-flex; align-items: center; font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-active::after { content: ''; position: absolute; height: 4px; left: -5px; right: -5px; bottom: -5px; background: #365568; border-radius: 4px; }
.header-music { display: flex; align-items: center; gap: 16px; min-width: 0; }
.header-track { display: grid; border-left: 1px solid var(--line); padding-left: 19px; line-height: 1.35; white-space: nowrap; }
.header-track strong { font-size: 15px; font-weight: 700; }
.header-track span { font-size: 13px; color: var(--muted); }
.share-page { max-width: 1536px; margin: 0 auto; padding: 0 28px; }
#memories-wall { scroll-margin-top: 22px; }
.memories-heading { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 39px 20px 28px; }
.memories-heading h1 { margin: 0 0 0; font-size: clamp(42px,5.3vw,80px); line-height: 1.06; font-weight: 800; letter-spacing: -3.2px; text-wrap: balance; }
.memories-heading p { margin: 7px 0 0; font-size: clamp(19px,2.2vw,29px); color: var(--muted); line-height: 1.4; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 23px; border: 1px solid transparent; border-radius: 6px; font-size: 16px; font-weight: 600; line-height: 1.35; text-decoration: none; transition: background .16s, border-color .16s; }
.button-solid { background: var(--accent); color: #fff; border-color: var(--accent); }
.button-solid:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-outline { color: var(--accent); border-color: var(--line); background: transparent; }
.button-outline:hover:not(:disabled) { background: #e8edf0; border-color: #8197a5; }
#add-your-memory { white-space: nowrap; min-height: 52px; padding: 13px 29px; font-size: 19px; flex-shrink: 0; }
.text-button { padding: 8px 0; border: 0; background: none; color: var(--accent); font-size: 14px; line-height: 1.4; text-decoration: underline; text-underline-offset: 4px; }
#memories-status { font-size: 14px; color: var(--muted); }
#memories-status:empty { display: none; }
.guestbook-intro { font-size: 16px !important; margin-top: 7px !important; font-style: italic; }
.contribution-form { margin-top: 26px; scroll-margin-top: 26px; }
.signature-step, .signed-step { display: flex; gap: 24px; align-items: center; background: var(--surface-soft); border-radius: 8px; padding: 22px 27px; }
.signature-intro { display: flex; align-items: center; gap: 21px; flex: 1; min-width: 0; }
.signature-intro > svg { width: 48px; height: 44px; color: #6a7f8b; padding-right: 14px; border-right: 1px solid #b9c6cd; flex-shrink: 0; }
.signature-intro h3 { font-size: 25px; font-weight: 800; line-height: 1.15; margin: 0 0 4px; letter-spacing: -.6px; }
.signature-intro p { font-size: 14px; color: #48565f; line-height: 1.45; margin: 0; max-width: 435px; }
.signature-field { width: 260px; min-width: 170px; border-left: 1px solid #b9c6cd; padding-left: 24px; }
.signature-field label { display: block; font-size: 13px; margin-bottom: 4px; }
.signature-field input, .detail-field input, .detail-field textarea { display: block; width: 100%; border: 1px solid #a9bac4; border-radius: 8px; background: #fff; color: var(--ink); padding: 11px 13px; min-height: 44px; font-size: 16px; line-height: 1.5; }
.signature-field input { padding: 8px 12px; }
.signature-field input::placeholder, .detail-field input::placeholder, .detail-field textarea::placeholder { color: #6c7880; opacity: 1; }
#sign-book { white-space: nowrap; margin-top: 22px; }
.signed-step { justify-content: space-between; }
.signed-confirmation { margin: 0 0 4px; font-size: 14px; color: #53636d; }
#signed-name { font-size: 24px; line-height: 1.25; margin: 0; font-weight: 700; overflow-wrap: anywhere; }
#signed-date { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.book-sign-status { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 14px 0 0; }
.book-sign-status:empty { display: none; }
.contribution-fields { margin-top: 22px; padding: 26px 30px 30px; border: 1px solid var(--soft-line); border-radius: 8px; background: #f1f3f3; }
.composer-heading { margin-bottom: 22px; }
.composer-heading h3 { font-size: 27px; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; margin: 0 0 7px; }
.composer-heading p { margin: 0; font-size: 15px; color: var(--muted); }
.composer-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 25px; align-items: start; }
.detail-field { min-width: 0; }
.detail-field label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 600; }
.detail-field label span { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 5px; }
.detail-field textarea { resize: vertical; min-height: 118px; }
.detail-field small { display: block; margin-top: 7px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.file-picker { position: relative; display: flex; align-items: center; gap: 20px; padding: 23px 24px; border: 1px dashed #91a5b2; border-radius: 8px; margin-top: 0; transition: background .16s; }
.file-picker.dragging { background: #e1e8ec; }
.upload-icon { flex: 0 0 34px; width: 34px; height: 34px; color: var(--accent); }
.picker-copy { display: grid; gap: 2px; flex: 1; min-width: 0; }
.picker-copy strong { font-size: 16px; font-weight: 600; }
.picker-copy span { font-size: 13px; color: var(--muted); }
.picker-copy small { font-size: 12px; color: var(--muted); }
#choose-files { flex-shrink: 0; }
.config-notice { font-size: 13px; color: var(--muted); margin-top: 12px; }
.config-notice p { margin: 0; }
.selection-error { color: var(--danger); border-left: 3px solid var(--danger); background: #f6e9ed; padding: 13px 16px; font-size: 14px; margin: 18px 0; }
.queue-section { margin-top: 25px; }
.queue-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.queue-heading h4 { margin: 0; font-size: 18px; font-weight: 600; }
.queue-heading span { font-size: 13px; color: var(--muted); }
.file-list { padding: 0; margin: 0; list-style: none; }
.file-item { display: flex; align-items: center; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--soft-line); }
.file-thumb { flex: 0 0 58px; width: 58px; height: 58px; border-radius: 8px; background: #e3e8eb; color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 11px; overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-details { min-width: 0; flex: 1; }
.file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.file-status { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.file-status.error, .story-status { color: var(--danger); }
.file-status.saved { color: #365568; }
.file-action { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 10px 0 10px 8px; text-decoration: underline; text-underline-offset: 4px; }
progress { display: block; appearance: none; width: 100%; height: 5px; border: 0; border-radius: 5px; overflow: hidden; margin: 10px 0 2px; background: #dce3e7; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #dce3e7; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.submit-row { margin-top: 22px; font-size: 14px; color: var(--muted); }
.submit-row p { margin: 0 0 14px; }
.submit-row p:empty { display: none; }
.queue-actions, .success-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.thank-you { margin-top: 25px; border-top: 1px solid var(--line); padding-top: 22px; }
.thank-you h4 { font-size: 22px; line-height: 1.3; margin: 0 0 8px; font-weight: 700; }
.thank-you p { font-size: 15px; color: var(--muted); margin: 0 0 20px; }
.success-actions a { color: var(--accent); font-size: 14px; }
.share-footer { display: flex; align-items: center; gap: 24px; justify-content: center; padding: 26px 0 30px; color: var(--muted); }
.share-footer::before, .share-footer::after { content: ''; height: 1px; width: 170px; background: var(--line); }
.share-footer p { font-size: 15px; font-style: normal; margin: 0; text-align: center; }
@media (min-width: 1600px) { .site-header { padding-left: max(36px,calc((100vw - 1480px)/2)); padding-right: max(36px,calc((100vw - 1480px)/2)); } }
@media (max-width: 1120px) {
  .site-header { gap: 24px; padding-left: 24px; padding-right: 24px; }
  .wordmark { font-size: 22px; gap: 10px; }
  .site-nav { gap: 27px; }
  .header-music { gap: 10px; }
  .header-track { padding-left: 13px; }
  .header-track strong { font-size: 13px; }
  .header-track span { font-size: 12px; }
  .signature-step { flex-wrap: wrap; }
  .signature-intro { flex-basis: 100%; }
  .signature-field { flex: 1; width: auto; padding-left: 0; border-left: 0; }
  #sign-book { min-height: 44px; }
}
@media (max-width: 750px) {
  .site-header { flex-wrap: wrap; gap: 16px 20px; padding: 18px 20px 14px; }
  .wordmark { font-size: 20px; }
  .wordmark svg { width: 25px; height: 24px; }
  .site-nav { margin-left: auto; gap: 19px; }
  .site-nav a { font-size: 13px; }
  .site-nav .nav-active::after { bottom: -7px; height: 3px; }
  .header-music { width: 100%; justify-content: flex-end; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--soft-line); padding-top: 11px; }
  .header-track { border: 0; padding-left: 0; margin-right: auto; }
  .header-track strong { font-size: 13px; }
  .header-track span { font-size: 12px; }
  .share-page { padding: 0 16px; }
  .memories-heading { display: block; padding: 27px 4px 22px; }
  .memories-heading h1 { font-size: 43px; letter-spacing: -1.8px; line-height: 1.08; }
  .memories-heading p { font-size: 18px; line-height: 1.5; margin-top: 8px; text-wrap: balance; }
  #add-your-memory { min-height: 44px; padding: 10px 19px; margin-top: 18px; font-size: 15px; }
  .signature-step, .signed-step { padding: 20px; border-radius: 8px; gap: 18px; }
  .signature-intro { gap: 14px; align-items: flex-start; }
  .signature-intro > svg { width: 39px; height: 40px; padding-right: 10px; }
  .signature-intro h3 { font-size: 23px; }
  .signature-intro p { font-size: 13px; }
  .signature-field { flex-basis: 100%; }
  #sign-book { margin-top: 0; width: 100%; }
  .signed-step { align-items: flex-start; flex-direction: column; gap: 10px; }
  #signed-name { font-size: 23px; }
  .contribution-fields { padding: 22px 17px; }
  .composer-grid { grid-template-columns: 1fr; gap: 21px; }
  .composer-heading h3 { font-size: 25px; }
  .composer-heading p { font-size: 14px; }
  .detail-field label { font-size: 14px; }
  .detail-field label span { font-size: 12px; }
  .file-picker { flex-wrap: wrap; padding: 20px 17px; gap: 14px; }
  .picker-copy { min-width: 190px; }
  #choose-files { width: 100%; font-size: 15px; }
  .queue-actions { align-items: stretch; gap: 12px; }
  .queue-actions > .button { width: 100%; }
  .file-thumb { flex-basis: 46px; width: 46px; height: 46px; }
  .file-item { gap: 11px; }
  .file-name { font-size: 13px; }
  .file-status { font-size: 12px; }
  .file-action { font-size: 12px; }
  .share-footer { gap: 13px; padding-top: 28px; }
  .share-footer p { font-size: 13px; flex-shrink: 0; }
  .share-footer::before, .share-footer::after { width: auto; flex: 1; }
}
@media (max-width: 380px) {
  .site-header { padding-left: 16px; padding-right: 16px; gap: 15px; }
  .wordmark { font-size: 18px; gap: 7px; }
  .site-nav { gap: 13px; }
  .site-nav a { font-size: 12px; }
  .memories-heading h1 { font-size: 39px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.story-sign-hint { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
#story-fields { margin-top: 24px; }

.set-comment-field { margin-top: 20px; }
.set-comment-field textarea { min-height: 82px; }
.story-details { border-top: 1px solid var(--soft-line); padding-top: 10px; }
.story-details summary { min-height: 44px; padding: 10px 0; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
.story-details .composer-grid { margin-top: 12px; }
.story-details summary:focus-visible { outline: 3px solid #416e89; outline-offset: 4px; }
@media (max-width: 750px) {
  .set-comment-field { margin-top: 18px; }
  .file-action { min-height: 44px; padding-left: 10px; padding-right: 3px; }
  .text-button { min-height: 44px; }
  .composer-heading { margin-bottom: 17px; }
}
