/* The gift dedication screen reuses the generator's original form controls. */
.gift-dedication-form[hidden], .gift-dedication-form [hidden] { display: none !important; }
body:is(.gift-generator-active, .general-dedication-active) #dedication-fields > :not(.gift-dedication-form) { display: none !important; }
body:is(.gift-generator-active, .general-dedication-active) #song-form #advanced-fields { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; overflow: visible; }
body:is(.gift-generator-active, .general-dedication-active) #song-form #dedication-fields { padding: 0; margin: 0; border: 0; background: transparent; box-shadow: none; }
.gift-dedication-form { display: grid; gap: 8px; color: #0d1938; font-family: var(--font-ui, Arial, sans-serif); }
.gift-dedication-form * { box-sizing: border-box; }
.gift-dedication-form svg { flex: 0 0 auto; width: 20px; height: 20px; }
.gift-dedication-form p { margin: 0; color: #7c8ca7; font-size: 11px; line-height: 1.35; }
.gift-dedication-form .gift-dedication-banner { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 8px 12px; border-radius: 14px; color: #413123; background: linear-gradient(115deg, #fcf5f1, #fcf6f2); }
.gift-dedication-banner > svg { width: 27px; height: 27px; color: #dc5500; }
.gift-dedication-banner > div { min-width: 0; }
.gift-dedication-banner strong { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 650; line-height: 1.25; }
.gift-dedication-banner p { font-size: 10px; color: #6c8299; }
.gift-names-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; position: relative; border-radius: 14px; background: #fff; box-shadow: 0 8px 22px #57372110; }
.gift-name-card { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 7px 10px 3px; border: 1px solid #f0ebe8; border-bottom: 0; border-radius: 14px 14px 0 0; }
.gift-name-card label { display: flex; align-items: center; gap: 9px; margin: 0; min-height: 28px; }
.gift-name-card strong { font-size: 13px; font-weight: 650; line-height: 1.2; }
.gift-dedication-icon { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 9px; color: #fff; background: linear-gradient(130deg, #e07938, #b34300); box-shadow: inset 0 0 9px #ffffff18; }
.gift-dedication-icon svg { width: 21px; height: 21px; }
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-dedication-form input,
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-dedication-form textarea { display: block; width: 100%; min-width: 0; min-height: 28px; height: 28px; margin: 0; padding: 5px 10px; border: 1px solid #d4dbe6; border-radius: 10px; box-shadow: none; background: #fff; color: #14242e; font: inherit; font-size: 12px; line-height: 1.4; }
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-dedication-form input::placeholder,
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-dedication-form textarea::placeholder { color: #8893a2; opacity: 1; }
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-dedication-form input:focus,
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-dedication-form textarea:focus { outline: 2px solid #df5d0d; outline-offset: 1px; border-color: #df5d0d; }
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-dedication-form input[readonly] { background: #f3f7f8; color: #728296; }
.gift-dedication-form .gift-names-note { display: flex; align-items: center; gap: 6px; grid-column: 1 / -1; padding: 2px 10px 7px; border: 1px solid #f0ebe8; border-top: 0; border-radius: 0 0 14px 14px; font-size: 9px; }
.gift-names-note svg { width: 12px; height: 12px; }
.gift-answer-card { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid #f0ebe8; border-radius: 14px; background: #fff; box-shadow: 0 8px 22px #5737210b; }
.gift-answer-content { flex: 1; min-width: 0; }
.gift-dedication-form .gift-answer-content { display: block; }
.gift-answer-content > label { display: block; margin: 1px 0 5px; font-size: 13px; font-weight: 650; line-height: 1.2; }
.gift-editable { position: relative; }
.gift-editable > svg { position: absolute; right: 8px; top: 7px; width: 15px; height: 15px; pointer-events: none; color: #142640; }
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-editable input { padding-right: 30px; }
.gift-example-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0; }
.gift-example-chips button { padding: 4px 11px; min-height: 24px; border: 1px solid #dce1e8; border-radius: 20px; background: #fff; color: #15233e; font: inherit; font-size: 10px; line-height: 1.2; cursor: pointer; }
.gift-example-chips button[aria-pressed="true"] { background: #fbf4ef; border-color: #de5b09; color: #ab4200; font-weight: 650; }
.gift-example-chips :is(.gift-more-occasions, .gift-more-relations) { display: inline-flex; align-items: center; gap: 4px; }
:is(.gift-more-occasions, .gift-more-relations) svg { width: 13px; height: 13px; }
:is(.gift-occasion-chips, .gift-relation-chips) { gap: 3px; flex-wrap: nowrap; contain: inline-size; }
:is(.gift-occasion-chips, .gift-relation-chips) > button { flex: 1 1 auto; min-width: 0; }
:is(.gift-occasion-chips, .gift-relation-chips) :is(.gift-more-occasions, .gift-more-relations) { justify-content: center; gap: 2px; }
.gift-answer-content:has(.gift-occasion-menu) { position: relative; }
.gift-occasion-menu[hidden] { display: none; }
.gift-example-chips.gift-occasion-menu { top: calc(100% - 16px); display: block; margin: 0; }
:is(.gift-occasion-chips, .gift-relation-chips) button { padding: 4px 3px; font-size: 9px; white-space: nowrap; }
.gift-answer-content > p { font-size: 10px; margin-top: 2px; }
.gift-phrase-position { margin: 9px 0 6px; }
.gift-phrase-position > span { display: block; margin-bottom: 6px; font-size: 10px; }
.gift-phrase-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.gift-phrase-tabs button { min-width: 0; min-height: 30px; padding: 5px 3px; border: 1px solid #dce1e8; border-radius: 20px; background: #fff; color: #15233e; font: inherit; font-size: 10px; cursor: pointer; }
.gift-phrase-tabs button[aria-pressed="true"] { border-color: #de5b09; background: #fbf4ef; color: #ab4200; font-weight: 650; }
.gift-phrase-tabs button:disabled { opacity: .55; cursor: default; }
.gift-message-control { position: relative; display: block; }
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-message-control { margin: 0; padding: 0; }
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-message-control textarea { min-height: 168px; height: 168px; padding: 7px 9px 20px; font-size: 11px; resize: vertical; }
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-message-control .ai-step-field-count { position: absolute; right: 9px; bottom: 6px; margin: 0; padding: 0; background: transparent; color: #8996aa; font-size: 9px; line-height: 1; pointer-events: none; }
.gift-extra-details { min-width: 0; padding: 6px 10px; border: 1px solid #f0ebe8; border-radius: 14px; background: #fff; box-shadow: 0 8px 22px #5737210b; }
.gift-extra-details summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; }
.gift-extra-details summary::-webkit-details-marker { display: none; }
.gift-extra-details summary > span:nth-child(2) { flex: 1; min-width: 0; }
.gift-extra-details summary strong { display: block; font-size: 12px; font-weight: 650; line-height: 1.3; }
.gift-extra-details summary strong span { font-weight: 400; }
.gift-extra-details summary small { display: block; color: #7c8ca7; font-size: 10px; line-height: 1.35; }
.gift-extra-details summary > svg { color: #8d999f; width: 18px; height: 18px; transition: transform .15s; }
.gift-extra-details[open] summary > svg { transform: rotate(180deg); }
.gift-extra-details-body { display: grid; gap: 7px; padding: 14px 0 3px; }
.gift-extra-details-body > label { font-size: 12px; font-weight: 600; }
body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-extra-details-body textarea { height: 70px; resize: vertical; }
.gift-dedication-outro { margin-top: 0; }
.gift-dedication-outro > div { flex: 1; }
.gift-dedication-outro > svg:last-child { width: 24px; height: 24px; }
.gift-dedication-form .gift-dedication-outro p { font-size: 9px; line-height: 1.2; }
.gift-dedication-form button:focus-visible, .gift-extra-details summary:focus-visible { outline: 2px solid #dc5500; outline-offset: 2px; }
.gift-message-inspiration { margin-top: 14px; }
.gift-dedication-form .gift-message-inspire { margin: 0 0 9px; font-size: 12px; }
.gift-message-themes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gift-message-themes button, .gift-message-more summary { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 6px 10px; border: 1px solid transparent; border-radius: 99px; background: #fbf7f3; color: #694e39; font: 12px var(--font-ui, Arial, sans-serif); cursor: pointer; }
.gift-message-themes button[aria-pressed="true"] { border-color: #e95a00; color: #b54700; background: #fffcfa; }
.gift-message-more { position: relative; }
.gift-message-more summary { list-style: none; border-color: #dde3ed; background: #fff; color: #172440; }
.gift-message-more summary::-webkit-details-marker { display: none; }
.gift-message-more summary svg { width: 14px; height: 14px; }
.gift-message-more > div, .gift-occasion-menu { position: absolute; z-index: 10; right: 0; top: calc(100% + 6px); width: 185px; max-height: 210px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; border: 1px solid #eee7e2; border-radius: 12px; background: #fff; box-shadow: 0 12px 25px #452a1925; }
.gift-message-more button, .gift-example-chips.gift-occasion-menu button { display: block; width: 100%; min-height: 32px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; text-align: left; background: #fff; color: #694e39; font: 12px var(--font-ui, Arial, sans-serif); cursor: pointer; }
.gift-message-more button:hover, .gift-occasion-menu button:hover { background: #fbf6f3; }
.gift-example-chips.gift-occasion-menu button[aria-pressed="true"] { border-color: #e95a00; color: #b54700; background: #fffcfa; }
.gift-message-more summary:focus-visible { outline: 2px solid #dc5500; outline-offset: 2px; }
.gift-message-ai { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 43px; margin-top: 13px; padding: 8px; border: 1px solid #f4e3d9; border-radius: 12px; background: #fdf8f5; color: #bf4b00; font: 650 13px var(--font-ui, Arial, sans-serif); cursor: pointer; }
.gift-message-ai > span:first-child { flex-shrink: 0; font: 28px/1 Arial, sans-serif; }
.gift-message-inspiration button:disabled { opacity: .55; cursor: default; }
.gift-message-ai[aria-busy="true"] { opacity: 1; cursor: wait; }
.gift-message-ai[aria-busy="true"] > span:first-child { width: 21px; height: 21px; font-size: 0; border: 0; border-radius: 50%; background: var(--am-vinyl-mini-bg, #833906); box-shadow: var(--am-vinyl-mini-shadow, none); animation: gift-message-loading 1.2s linear infinite; }
@keyframes gift-message-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gift-message-ai[aria-busy="true"] > span:first-child { animation-duration: 3s; } }
@media (max-width: 860px) {
  /* Keep intrinsic content widths from widening the mobile form's grid track. */
  .gift-dedication-form { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .gift-message-themes { flex-wrap: nowrap; gap: 4px; }
  .gift-message-themes button, .gift-message-more summary, .gift-example-chips.gift-occasion-menu button { padding: 5px 6px; font-size: 11px; }
  .gift-message-themes > button, .gift-message-more summary { white-space: nowrap; }
  .gift-message-more > div { right: 0; left: auto; }
}
@media (max-width: 359px) {
  .gift-message-themes { gap: 2px; }
  .gift-message-themes > button, .gift-message-more summary { padding-inline: 3px; font-size: 10px; }
}
@media (min-width: 861px) {
  .gift-phrase-position { margin: 14px 0 8px; }
  .gift-phrase-position > span { font-size: 14px; margin-bottom: 8px; }
  .gift-phrase-tabs { gap: 8px; }
  .gift-phrase-tabs button { min-height: 36px; padding: 7px 10px; font-size: 13px; }
  .gift-message-inspiration { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; column-gap: 8px; }
  .gift-dedication-form .gift-message-inspire { margin: 0; }
  .gift-message-themes { flex-wrap: nowrap; gap: 4px; }
  .gift-message-themes > button, .gift-message-more summary { white-space: nowrap; }
  .gift-message-ai { grid-column: 1 / -1; }
  /* Keep the open menu above the sibling wizard footer's stacking context. */
  #song-form #post-lyrics-fields:has(.gift-message-more[open]) { z-index: 2; }
  .gift-dedication-form { gap: 20px; }
  .gift-dedication-form .gift-dedication-banner { padding: 18px 22px; }
  .gift-dedication-banner strong { font-size: 16px; }
  .gift-dedication-form p, .gift-dedication-banner p { font-size: 14px; line-height: 1.55; color: #68788d; }
  .gift-dedication-form .gift-dedication-outro p { font-size: 14px; line-height: 1.5; }
  .gift-names-grid { gap: 12px 20px; padding: 20px 22px; border: 1px solid #f0ebe8; border-radius: 18px; }
  .gift-name-card { gap: 10px; padding: 0; border: 0; border-radius: 0; }
  .gift-answer-card, .gift-extra-details { padding: 20px 22px; border-radius: 18px; }
  .gift-answer-card, .gift-extra-details summary { gap: 14px; }
  .gift-name-card strong, .gift-answer-content > label { font-size: 18px; line-height: 1.35; }
  .gift-answer-content > label { margin: 3px 0 12px; }
  .gift-dedication-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }
  body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-dedication-form input { height: 48px; padding: 11px 14px; font-size: 16px; line-height: 1.5; border-radius: 12px; }
  body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-dedication-form .gift-editable input { padding-right: 40px; }
  .gift-editable > svg { top: 16px; right: 12px; width: 17px; height: 17px; }
  .gift-example-chips { gap: 8px; margin: 12px 0 8px; }
  :is(.gift-occasion-chips, .gift-relation-chips) { flex-wrap: wrap; justify-content: flex-end; contain: none; }
  .gift-example-chips button { font-size: 13px; min-height: 34px; padding: 7px 14px; }
  :is(.gift-occasion-chips, .gift-relation-chips) > button { flex: 0 1 auto; }
  .gift-dedication-form .gift-answer-content:has(> :is(.gift-occasion-chips, .gift-relation-chips)) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); column-gap: 16px; align-items: center; }
  .gift-answer-content:has(> :is(.gift-occasion-chips, .gift-relation-chips)) > :is(label, .gift-editable) { grid-column: 1 / -1; }
  .gift-answer-content > :is(.gift-occasion-chips, .gift-relation-chips) { grid-column: 2; grid-row: 3; margin: 12px 0 0; }
  .gift-answer-content:has(> :is(.gift-occasion-chips, .gift-relation-chips)) > p { grid-column: 1; grid-row: 3; margin: 12px 0 0; }
  .gift-dedication-form .gift-names-note { padding: 4px 0 0; border: 0; font-size: 13px; gap: 8px; }
  .gift-names-note svg { width: 15px; height: 15px; }
  body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-message-control textarea { min-height: 270px; height: 270px; padding: 14px 16px 30px; font-size: 16px; line-height: 1.55; border-radius: 12px; }
  body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-message-control .ai-step-field-count { right: 14px; bottom: 12px; font-size: 12px; }
  .gift-extra-details summary strong { font-size: 18px; }
  .gift-extra-details summary small { margin-top: 4px; font-size: 14px; line-height: 1.5; }
  .gift-extra-details-body { gap: 12px; padding: 22px 0 0; }
  .gift-extra-details-body > label { font-size: 16px; line-height: 1.4; }
  .gift-extra-details-body > label:not(:first-child) { margin-top: 8px; }
  body:is(.gift-generator-active, .general-dedication-active) #song-form .gift-extra-details-body textarea { height: 100px; min-height: 100px; padding: 12px 14px; font-size: 15px; line-height: 1.5; border-radius: 12px; }
}
@media (max-width: 860px) {
  body:is(.gift-generator-active, .general-dedication-active) .form-card.mobile-form-stage-active #advanced-fields { margin: 0; }
}
@media (max-width: 359px) {
  .gift-name-card { padding-left: 7px; padding-right: 7px; }
  .gift-name-card label { gap: 6px; }
  .gift-name-card strong { font-size: 11px; }
  .gift-dedication-banner { gap: 9px !important; }
  .gift-dedication-banner strong { font-size: 11px; }
}

body.gift-generator-active .gift-dedication-form .gift-mood-slot { display: none !important; }
