/* Standalone, accessible submission UI. The active theme can supply these colors. */
.sp-submission {
  --submit-accent: var(--sp-primary, #087b43);
  --submit-ink: var(--sp-text, #263b4a);
  --submit-link: var(--sp-secondary, #064d7c);
  --submit-pale: color-mix(in srgb, var(--submit-accent) 8%, var(--sp-surface, white));
  --submit-border: var(--sp-border, #dce4e9);
  --submit-muted: var(--sp-muted, #526277);
  max-width: 76rem; margin: 1.5rem auto; color: var(--submit-ink); font-size: 1rem; line-height: 1.55;
}
.sp-submission *, .sp-submission *::before, .sp-submission *::after { box-sizing: border-box; }
.sp-submission [hidden] { display: none !important; }
.sp-submission :where(h2,h3,p,ul,ol,dl,figure) { margin: 0; }
.sp-submission button, .sp-submission input, .sp-submission textarea { font: inherit; }
.sp-submission :is(input,textarea,button,a,summary):focus-visible { outline: 3px solid var(--submit-link); outline-offset: 3px; }
.sp-submit-icon { width: 1.35rem; height: 1.35rem; flex: none; vertical-align: middle; }
.sp-submit-intro { margin-bottom: 2rem; }
.sp-submit-badge { display: inline-flex; padding: .3rem .65rem; border-radius: 4px; color: var(--sp-primary-ink, var(--submit-accent)); background: var(--submit-pale); font-size: .75rem; font-weight: 750; letter-spacing: .025em; }
.sp-submit-intro h2 { font-size: clamp(1.375rem, 1rem + 1vw, 1.875rem); letter-spacing: -.025em; line-height: 1.25; margin: .75rem 0 .5rem; }
.sp-submit-intro > p { max-width: 45rem; color: var(--submit-muted); }
.sp-submit-intro ul { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 0; margin-top: 1rem; list-style: none; font-size: .875rem; }
.sp-submit-intro li { display: flex; align-items: center; gap: .5rem; }
.sp-submit-intro li > svg { color: var(--sp-primary-ink, var(--submit-accent)); }
.sp-submit-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 1.5rem; align-items: start; }
.sp-submission--enhanced .sp-submit-layout { grid-template-columns: 14.5rem minmax(0,1fr); }
.sp-submit-steps { position: sticky; top: 6.5rem; padding: 1rem; border: 1px solid var(--submit-border); border-radius: 12px; background: var(--sp-surface, white); }
.sp-submit-steps ol { list-style: none; padding: 0; }
.sp-submit-steps li + li { margin-top: .375rem; }
.sp-submit-steps button { display: flex; align-items: center; gap: .65rem; width: 100%; border: 0; border-radius: 6px; padding: .625rem; background: transparent; color: var(--submit-ink); font-size: .875rem; line-height: 1.4; text-align: left; cursor: pointer; }
.sp-submit-steps button:disabled { opacity: .6; cursor: default; }
.sp-submit-step-number { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; flex: none; border: 1px solid var(--submit-border); border-radius: 50%; font-size: .8125rem; font-weight: 700; background: var(--sp-surface, white); }
.sp-submit-steps [aria-current=step] { background: var(--submit-pale); color: var(--sp-primary-ink, var(--submit-accent)); font-weight: 750; }
.sp-submit-steps [aria-current=step] .sp-submit-step-number, .sp-submit-steps [data-visited] .sp-submit-step-number { border-color: var(--sp-primary-ink, var(--submit-accent)); background: var(--submit-accent); color: white; }
.sp-submit-steps > p { display: flex; gap: .5rem; padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--submit-border); font-size: .8125rem; color: var(--submit-muted); }
.sp-submission-form { min-width: 0; }
.sp-submit-progress { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.sp-step-progress { color: var(--sp-primary-ink, var(--submit-accent)); font-size: .875rem; font-weight: 700; flex: none; }
.sp-submit-progress progress { width: 100%; max-width: 15rem; height: .5rem; margin-left: auto; accent-color: var(--sp-primary-ink, var(--submit-accent)); border: 0; border-radius: 10px; overflow: hidden; background: var(--submit-pale); }
.sp-submit-progress progress::-webkit-progress-bar { background: var(--submit-pale); }
.sp-submit-progress progress::-webkit-progress-value { background: var(--submit-accent); border-radius: 10px; }
.sp-submit-progress progress::-moz-progress-bar { background: var(--submit-accent); }
.sp-submit-step { min-width: 0; padding: 1.75rem; margin: 0 0 1.5rem; border: 1px solid var(--submit-border); border-radius: 12px; background: var(--sp-surface, white); scroll-margin-top: 7rem; }
.sp-submit-step > legend { padding: 0 .5rem; margin-left: -.5rem; color: var(--submit-ink); font-size: clamp(1.25rem, 1rem + .6vw, 1.5rem); line-height: 1.3; font-weight: 750; letter-spacing: -.02em; overflow-wrap: anywhere; }
.sp-submit-step > .sp-submit-step__intro { color: var(--submit-muted); margin-bottom: 1.5rem; font-size: .9375rem; }
.sp-submit-field { min-width: 0; margin: 0 0 1.25rem; padding: 0; border: 0; }
.sp-submit-field > label, .sp-submit-field > legend { display: block; padding: 0; margin: 0 0 .5rem; color: var(--submit-ink); font-size: .9375rem; font-weight: 650; line-height: 1.4; }
.sp-submit-field input:not([type=checkbox]):not([type=radio]), .sp-submit-field textarea { display: block; width: 100%; max-width: 100%; min-height: 48px; padding: .75rem; border: 1px solid var(--submit-border); border-radius: 6px; background: var(--sp-surface, white); color: var(--submit-ink); font-size: 1rem; line-height: 1.5; }
.sp-submit-field textarea { resize: vertical; }
.sp-submit-field input::placeholder, .sp-submit-field textarea::placeholder { color: var(--submit-muted); opacity: .9; }
.sp-submit-field--muted { opacity: .65; }
.sp-submit-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 1.25rem; }
.sp-submit-field--choices { grid-column: 1 / -1; }
.sp-choice-grid { display: flex; flex-wrap: wrap; gap: .625rem; }
.sp-choice { position: relative; display: block; min-width: 0; cursor: pointer; }
.sp-choice > input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sp-choice__body { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; height: 100%; padding: .625rem .875rem; border: 1px solid var(--submit-border); border-radius: 7px; background: var(--sp-surface, white); color: var(--submit-ink); font-size: .9375rem; line-height: 1.4; overflow-wrap: anywhere; }
.sp-choice__label { display: block; font-weight: 600; }
.sp-choice small { display: block; font-size: .8125rem; color: var(--submit-muted); margin-top: .25rem; }
.sp-choice__check { display: none; width: 1.125rem; height: 1.125rem; flex: none; }
.sp-choice__check svg { width: 100%; height: 100%; }
.sp-choice > input:checked + .sp-choice__body { background: var(--submit-pale); color: var(--sp-primary-ink, var(--submit-accent)); border-color: var(--sp-primary-ink, var(--submit-accent)); box-shadow: inset 0 0 0 1px var(--submit-accent); }
.sp-choice > input:checked + .sp-choice__body .sp-choice__check { display: flex; }
.sp-choice > input:focus-visible + .sp-choice__body { outline: 3px solid var(--submit-link); outline-offset: 3px; }
.sp-choice:hover .sp-choice__body { border-color: var(--sp-primary-ink, var(--submit-accent)); }
.sp-submit-field--purpose .sp-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.sp-submit-field--purpose .sp-choice__body { justify-content: flex-start; gap: .875rem; padding: 1.25rem; min-height: 120px; }
.sp-submit-field--purpose .sp-choice__body > svg { width: 2rem; height: 2rem; color: var(--sp-primary-ink, var(--submit-accent)); }
.sp-submit-field--purpose .sp-choice__label { font-size: 1.0625rem; }
.sp-submit-field--type .sp-choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.sp-submit-field--type .sp-choice__body { flex-direction: column; min-height: 110px; padding: .875rem .5rem; text-align: center; }
.sp-submit-field--type .sp-choice__body > svg { width: 1.875rem; height: 1.875rem; color: var(--sp-primary-ink, var(--submit-accent)); }
.sp-submit-field--type .sp-choice__check { position: absolute; right: .5rem; top: .5rem; }
.sp-submit-field--check > label { display: flex; align-items: flex-start; gap: .65rem; padding: .875rem; border: 1px solid var(--submit-border); border-radius: 7px; cursor: pointer; font-weight: 500; }
.sp-submit-field--check input { width: 1.125rem; height: 1.125rem; flex: none; margin: .125rem 0 0; accent-color: var(--sp-primary-ink, var(--submit-accent)); }
.sp-submit-field--check:has(input:checked) > label { background: var(--submit-pale); border-color: var(--sp-primary-ink, var(--submit-accent)); }
.sp-submit-counts { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .625rem; }
.sp-submission .sp-submit-counts button { min-width: 42px; min-height: 44px; padding: .4rem; border: 1px solid var(--submit-border); border-radius: 6px; background: var(--sp-surface, white); color: var(--submit-ink); cursor: pointer; }
.sp-submission .sp-submit-counts [aria-pressed=true] { color: white; background: var(--submit-accent); border-color: var(--sp-primary-ink, var(--submit-accent)); }
.sp-submit-more { margin-bottom: 1.25rem; padding: 1rem; border: 1px solid var(--submit-border); border-radius: 7px; background: color-mix(in srgb, var(--submit-accent) 3%, var(--sp-surface, white)); }
.sp-submit-more > summary { cursor: pointer; font-size: .9375rem; font-weight: 650; }
.sp-submit-more > .sp-submit-grid { margin-top: 1rem; }
.sp-submit-more > .sp-submit-help { margin-top: .625rem; }
.sp-submit-help { color: var(--submit-muted); font-size: .8125rem; line-height: 1.5; margin-top: .375rem; }
.sp-submit-navigation { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .75rem; padding-top: 1.25rem; margin-top: 1.5rem; border-top: 1px solid var(--submit-border); }
.sp-submit-navigation .sp-next { margin-left: auto; }
.sp-submission .sp-submit-button { display: inline-flex; align-items: center; justify-content: center; gap: .625rem; min-height: 48px; padding: .75rem 1.25rem; border: 1px solid var(--submit-accent); border-radius: 6px; background: var(--submit-accent); color: white; font-size: .9375rem; font-weight: 700; line-height: 1.4; text-decoration: none; cursor: pointer; }
.sp-submission .sp-submit-button:hover { background: color-mix(in srgb,var(--submit-accent) 85%,black); color: white; }
.sp-submission .sp-submit-button--secondary { background: var(--sp-surface, white); color: var(--submit-link); border-color: var(--submit-link); }
.sp-submission .sp-submit-button--secondary:hover { background: var(--sp-secondary-soft, var(--submit-pale)); color: var(--submit-link); }
.sp-submit-upload { padding: 1.25rem; border: 1px dashed var(--submit-border); border-radius: 8px; background: color-mix(in srgb,var(--submit-accent) 3%,var(--sp-surface,white)); }
.sp-submit-upload > label { display: flex; align-items: center; gap: .625rem; }
.sp-submit-upload .sp-submit-help { margin-bottom: .875rem; }
.sp-submit-upload input[type=file] { font-size: .875rem; padding: .625rem; }
.sp-submit-upload input::file-selector-button { margin-right: .75rem; padding: .5rem .75rem; border: 1px solid var(--submit-border); border-radius: 5px; background: var(--submit-pale); color: var(--submit-ink); cursor: pointer; }
.sp-submit-photo-status { margin-top: .75rem; font-size: .875rem; color: var(--submit-muted); }
.sp-submit-previews { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .625rem; }
.sp-submit-previews figure { min-width: 0; margin-top: .75rem; }
.sp-submit-previews img { display: block; width: 100%; height: auto; aspect-ratio: 1.45; object-fit: cover; border-radius: 5px; }
.sp-submit-previews figcaption { margin-top: .25rem; font-size: .75rem; overflow-wrap: anywhere; }
.sp-submission .sp-submit-clear, .sp-submission .sp-submit-review-edit { padding: .375rem .125rem; border: 0; background: transparent; color: var(--submit-link); font-size: .875rem; font-weight: 650; cursor: pointer; min-height: 32px; }
.sp-submit-review-section { margin-bottom: 1rem; border: 1px solid var(--submit-border); border-radius: 8px; overflow: hidden; }
.sp-submit-review-section h3 { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .625rem 1rem; background: var(--submit-pale); font-size: 1rem; }
.sp-submit-review-section dl { display: grid; grid-template-columns: minmax(7rem,1fr) minmax(0,2fr); gap: .625rem 1rem; padding: 1rem; font-size: .875rem; }
.sp-submit-review-section dt { color: var(--submit-muted); }
.sp-submit-review-section dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-submit-review-notice { display: flex; align-items: flex-start; gap: .625rem; padding: 1rem; margin-bottom: 1rem; border-radius: 7px; background: var(--submit-pale); font-size: .875rem; }
.sp-submit-errors { border: 1px solid var(--sp-danger, #b42318); border-radius: 8px; background: var(--sp-danger-soft, #fff7f6); padding: 1.25rem; margin-bottom: 1.5rem; color: var(--sp-danger, #7b241c); }
.sp-submit-errors h2 { font-size: 1.25rem; margin-bottom: .5rem; }
.sp-submit-errors ul { padding-left: 1.25rem; }
.sp-submit-notice { border: 1px solid var(--submit-border); border-left: 4px solid var(--submit-accent); border-radius: 8px; background: var(--submit-pale); padding: 1.5rem; }
.sp-submit-notice h2 { font-size: 1.5rem; margin-bottom: .75rem; }
.sp-submit-welcome { padding: clamp(1.5rem,4vw,3rem); border: 1px solid var(--submit-border); border-radius: 12px; background: var(--sp-surface, white); text-align: center; }
.sp-submit-welcome__icon { display: inline-grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; background: var(--submit-pale); color: var(--sp-primary-ink, var(--submit-accent)); margin-bottom: 1rem; }
.sp-submit-welcome__icon svg { width: 2.25rem; height: 2.25rem; }
.sp-submit-welcome h2 { font-size: clamp(1.375rem,1rem + 1vw,1.75rem); margin-bottom: .75rem; }
.sp-submit-welcome > p { max-width: 34rem; margin-inline: auto; color: var(--submit-muted); }
.sp-submit-welcome__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-block: 1.25rem; }
@media(max-width:1000px) {
  .sp-submission--enhanced .sp-submit-layout { grid-template-columns: minmax(0,1fr); }
  .sp-submit-steps { position: static; padding: .625rem; overflow-x: auto; }
  .sp-submit-steps ol { display: flex; min-width: max-content; gap: .375rem; }
  .sp-submit-steps li + li { margin: 0; }
  .sp-submit-steps button { width: auto; white-space: nowrap; }
  .sp-submit-steps > p { display: none; }
}
@media(max-width:600px) {
  .sp-submission { margin-block: 1rem; }
  .sp-submit-intro { margin-bottom: 1.5rem; }
  .sp-submit-intro ul { display: grid; gap: .625rem; }
  .sp-submit-layout { gap: 1rem; }
  .sp-submit-step { padding: 1.125rem; }
  .sp-submit-grid { grid-template-columns: minmax(0,1fr); }
  .sp-submit-field--purpose .sp-choice-grid { grid-template-columns: minmax(0,1fr); }
  .sp-submit-field--purpose .sp-choice__body { min-height: 90px; padding: 1rem; }
  .sp-submit-field--type .sp-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sp-choice__body { padding: .625rem .75rem; font-size: .875rem; }
  .sp-submit-more { padding: .875rem; }
  .sp-submit-upload { padding: 1rem; }
  .sp-submit-upload input[type=file] { padding: .5rem; }
  .sp-submit-previews { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sp-submit-review-section dl { grid-template-columns: minmax(0,1fr); gap: .25rem; }
  .sp-submit-review-section dd + dt { margin-top: .625rem; }
  .sp-submit-final { width: 100%; }
}
@media(prefers-reduced-motion:reduce) { .sp-submission * { scroll-behavior: auto; } }

.sp-submission :is(h2,h3),.sp-submit-step > legend { color:var(--sp-heading,var(--submit-ink)); }

/* Early uploads and ordered gallery; native file controls remain the fallback. */
.sp-submit-upload[data-photo-enhanced] { border:2px dashed var(--submit-border); border-radius:10px; background:var(--sp-surface,var(--submit-pale)); }
.sp-submit-upload[data-photo-enhanced].is-dragover { border-color:var(--submit-accent); background:var(--submit-pale); }
.sp-submit-upload[data-photo-enhanced] .sp-submit-previews { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; margin-top:1rem; }
.sp-submit-upload .sp-photo-item { min-width:0; overflow:hidden; border:1px solid var(--submit-border); border-radius:8px; background:var(--sp-surface,white); }
.sp-submit-upload .sp-photo-item[draggable=true] { cursor:grab; }
.sp-submit-upload .sp-photo-item img,.sp-submit-upload .sp-photo-placeholder { display:block; width:100%; height:auto; aspect-ratio:16/11; object-fit:cover; }
.sp-submit-upload .sp-photo-placeholder { display:grid; place-items:center; background:var(--submit-pale); color:var(--submit-accent); font-size:1.5rem; }
.sp-submit-upload .sp-photo-item figcaption { display:grid; gap:.25rem; padding:.625rem; }
.sp-submit-upload .sp-photo-name { overflow-wrap:anywhere; font-size:.8125rem; color:var(--submit-ink); }
.sp-submit-upload .sp-photo-state { font-size:.75rem; color:var(--submit-muted); overflow-wrap:anywhere; }
.sp-submit-upload .sp-photo-actions { display:flex; flex-wrap:wrap; gap:.375rem; padding:0 .625rem .625rem; }
.sp-submit-upload .sp-photo-actions button { min-height:36px; padding:.375rem .5rem; border:1px solid var(--submit-border); border-radius:5px; background:var(--sp-surface,white); color:var(--sp-primary-ink,var(--submit-accent)); font-size:.75rem; cursor:pointer; }
.sp-submit-upload .sp-photo-actions button:disabled { opacity:.5; cursor:default; }
.sp-submit-upload .sp-photo-actions button:hover:not(:disabled) { background:var(--submit-pale); }
@media(max-width:359px) { .sp-submit-upload[data-photo-enhanced] .sp-submit-previews { grid-template-columns:minmax(0,1fr); } }

/* Compact ordered gallery: five desktop thumbnails, adapting to the actual form width. */
.sp-submit-upload[data-photo-kind=gallery] { container:sp-photo-gallery / inline-size; }
.sp-submit-upload[data-photo-kind=gallery] .sp-submit-previews { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.625rem; }
.sp-submit-upload[data-photo-kind=gallery] .sp-photo-item { position:relative; }
.sp-submit-upload[data-photo-kind=gallery] .sp-photo-item img,.sp-submit-upload[data-photo-kind=gallery] .sp-photo-placeholder { aspect-ratio:4/3; }
.sp-submit-upload[data-photo-kind=gallery] .sp-photo-item figcaption { padding:.5rem .375rem .375rem; gap:.125rem; }
.sp-submit-upload[data-photo-kind=gallery] .sp-photo-name { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:.75rem; }
.sp-submit-upload[data-photo-kind=gallery] .sp-photo-state { font-size:.6875rem; line-height:1.4; }
.sp-submit-upload[data-photo-kind=gallery] .sp-photo-actions { gap:3px; padding:0 .25rem .375rem; }
.sp-submit-upload[data-photo-kind=gallery] .sp-photo-action-icon { display:inline-grid; place-items:center; flex:0 0 28px; width:28px; min-height:28px; padding:0; }
.sp-photo-action-icon svg { width:16px; height:16px; pointer-events:none; }
.sp-submit-upload[data-photo-kind=gallery] .sp-photo-action-icon--remove { margin-left:auto; color:var(--sp-danger,var(--submit-ink)); }
.sp-submit-upload[data-photo-kind=gallery] .sp-photo-action-icon--remove:hover { background:var(--sp-danger-soft,var(--submit-pale)); }
.sp-photo-order,.sp-photo-grip { position:absolute; z-index:1; top:.375rem; display:grid; place-items:center; height:24px; border:1px solid var(--submit-border); border-radius:5px; background:color-mix(in srgb,var(--sp-surface,white) 94%,transparent); color:var(--sp-heading,var(--submit-ink)); pointer-events:none; }
.sp-photo-order { left:.375rem; min-width:24px; padding-inline:.25rem; font-size:.75rem; font-weight:700; font-variant-numeric:tabular-nums; }
.sp-photo-grip { right:.375rem; width:24px; }
.sp-photo-grip svg { width:15px; height:15px; }
.sp-submit-upload .sp-photo-item.is-dragging { opacity:.45; cursor:grabbing; }
.sp-submit-upload .sp-photo-item.is-drop-target { outline:2px solid var(--submit-accent); outline-offset:-2px; background:var(--submit-pale); }
@container sp-photo-gallery (min-width:380px) { .sp-submit-upload[data-photo-kind=gallery] .sp-submit-previews { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@container sp-photo-gallery (min-width:520px) {
 .sp-submit-upload[data-photo-kind=gallery] .sp-submit-previews { grid-template-columns:repeat(4,minmax(0,1fr)); }
 .sp-submit-upload[data-photo-kind=gallery] .sp-photo-action-icon { flex-basis:30px; width:30px; min-height:30px; }
}
@container sp-photo-gallery (min-width:680px) { .sp-submit-upload[data-photo-kind=gallery] .sp-submit-previews { grid-template-columns:repeat(5,minmax(0,1fr)); } }
@supports not (container-type:inline-size) {
 @media(min-width:768px) { .sp-submit-upload[data-photo-kind=gallery] .sp-submit-previews { grid-template-columns:repeat(4,minmax(0,1fr)); } }
 @media(min-width:1280px) { .sp-submit-upload[data-photo-kind=gallery] .sp-submit-previews { grid-template-columns:repeat(5,minmax(0,1fr)); } }
}

/* Inline validation uses the theme's semantic error palette and keeps choice labels intact. */
.sp-submission .sp-submit-field-error { margin: .55rem 0 0; color: var(--sp-danger, #b42318); font-size: .875rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.sp-submission .sp-submit-field--invalid input:not([type=radio]):not([type=checkbox]):not([type=hidden]),
.sp-submission .sp-submit-field--invalid textarea,
.sp-submission .sp-submit-field--invalid select,
.sp-submission .sp-submit-field--invalid .sp-choice__body { border-color: var(--sp-danger, #b42318); }
.sp-submission .sp-submit-field--invalid { scroll-margin-top: 6rem; }
.sp-submission .sp-submit-validation-summary { margin: 0 0 1rem; padding: 1rem; }
.sp-submission .sp-submit-validation-summary p { margin: 0 0 .4rem; font-weight: 600; color: inherit; }
.sp-submission .sp-submit-validation-summary ul { margin: 0; }
.sp-submission .sp-submit-validation-summary a { color: inherit; text-decoration: underline; text-underline-offset: .15em; }
