.greeting-tool .recorder-shell { max-width: 720px; padding-bottom: 52px; }
.greeting-tool .intro { max-width: 52ch; margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.example-link { display: inline-block; margin-top: 8px; font-size: 14px; }
.greeting-tool .tool-nameplate { min-height: 24px; }
.greeting-tool .tool-nameplate b { min-width: 49px; text-align: center; }
.greeting-tool fieldset { margin: 0; padding: 0; min-width: 0; border: 0; }
.greeting-tool .tool-instrument-surface { display: grid; gap: 16px; }
.greeting-tool .button { min-height: 48px; text-decoration: none; }
.greeting-tool .field-label, #portrait-choices legend { display: block; margin: 0 0 7px; padding: 0; font-size: 14px; font-weight: 600; }
#video-inputs textarea { display: block; width: 100%; margin: 0; padding: 10px 12px; border: 1px solid #aeb59e; border-radius: 3px; color: var(--ink); background: #fffef6; font: 16px/1.5 var(--font-sans); resize: vertical; }
.greeting-tool .hint { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 8px 0 0; }
#video-text-hint { margin-bottom: 12px; }
#voice-picker { margin-bottom: 14px; }
.selection-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border: 1px solid #8d9478; border-radius: 3px; background: #e7eadc; }
.selection-toggle { position: relative; min-width: 0; width: 100%; min-height: 54px; padding: 6px 24px 6px 8px; border: 0; background: transparent; color: inherit; text-align: left; }
.selection-toggle::after { content: ""; position: absolute; right: 8px; top: calc(50% - 5px); width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.selection-toggle[aria-expanded="true"]::after { top: calc(50% - 1px); transform: rotate(225deg); }
.selection-toggle strong { display: block; font-size: 14px; font-weight: 600; }
.selection-toggle small { display: block; margin-top: 3px; font-size: 12px; }
.audition { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 41px; min-width: 88px; padding: 5px 8px; border: 1px solid #a1a78f; border-radius: 3px; background: var(--paper-light); color: var(--olive); font: 12px var(--font-sans); }
.audition::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent currentColor; }
.audition[aria-pressed="true"] { color: #35422a; background: #e2e7d2; }
.audition[aria-pressed="true"]::before { width: 8px; height: 8px; border: 0; background: currentColor; }
.choice-list { margin-top: 4px; max-height: 304px; overflow-y: auto; border: 1px solid #aeb39e; border-radius: 3px; background: var(--paper-light); }
.choice-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 2px 7px; border-bottom: 1px solid var(--line); }
.choice-row:last-child { border-bottom: 0; }
.choice-row:has(:checked) { background: #e1e7d3; }
.choice-row label { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; font-size: 14px; }
.choice-row label span { overflow-wrap: anywhere; }
.choice-row input { flex: 0 0 auto; accent-color: var(--olive); }
.choice-row .audition { border-color: transparent; background: transparent; }
.choice-row .audition:hover, .choice-row .audition[aria-pressed="true"] { border-color: #a9b197; background: var(--soft); }
#status { margin: 0; font-size: 14px; }
#status:empty { display: none; }
#status.error, .portrait-error { color: #853d2c; }
.portrait-upload { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.portrait-upload .hint { flex: 1 1 210px; margin: 0; }
.portrait-error { margin: 7px 0 0; font-size: 13px; }
.portrait-error:empty { display: none; }
.portrait-preview { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; }
.portrait-preview img { flex: 0 0 64px; object-fit: cover; border-radius: 4px; }
.portrait-preview p { overflow-wrap: anywhere; }
#portrait-choices { margin-block: 17px; }
.portrait-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.portrait-gallery label { position: relative; min-width: 0; cursor: pointer; }
.portrait-gallery input { position: absolute; opacity: 0; }
.portrait-gallery label > span { display: grid; height: 100%; align-content: start; overflow: hidden; border: 2px solid transparent; border-radius: 5px; background: #eeefe4; }
.portrait-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 4; object-fit: cover; object-position: 50% 42%; background: #dfe3d2; }
.portrait-gallery span span { padding: 5px 3px 6px; font-size: 12px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.portrait-gallery label:hover > span { border-color: #a2a899; }
.portrait-gallery input:checked + span { border-color: #597448; background: #e1ead9; color: #293f21; }
.portrait-gallery input:focus-visible + span { outline: 2px solid #a35a28; outline-offset: 2px; }
#video-inputs:disabled .portrait-gallery label { cursor: default; }
#create-video[aria-busy="true"] { gap: 8px; opacity: 1; cursor: progress; }
#create-video[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; flex: 0 0 14px; border: 2px solid #ffffff63; border-top-color: currentColor; border-radius: 50%; animation: greeting-spin .75s linear infinite; }
@keyframes greeting-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #create-video[aria-busy="true"]::before { animation: none; } }
.greeting-video-result { margin: 0; padding: 15px; border: 1px solid var(--line); }
.greeting-video-result h2 { font-size: 23px; }
.greeting-video-result video, .greeting-video-example video { display: block; width: 100%; max-height: 420px; height: auto; margin-block: 10px; border-radius: 5px; background: #252920; }
.greeting-video-example video { aspect-ratio: 2 / 1; }
@media (max-width: 420px) {
  .portrait-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
