/* FreeSongFinder 1.2.45: flat form with validation that does not shift layout.
   All previous modal-era styles remain archived in style.css and are not loaded. */
.sf-shell,
.sf-shell *,
.sf-shell *::before,
.sf-shell *::after { box-sizing: border-box; }

.sf-shell {
    --sf-accent: var(--fsfs-accent, var(--accent, #6565d9));
    --sf-ink: var(--fsfs-ink, #171b29);
    --sf-muted: var(--fsfs-muted, #687185);
    --sf-line: var(--fsfs-line, #e5e7ec);
    --sf-white: #fff;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    color: var(--sf-ink);
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-family: inherit;
}
/* A shortcode must use the same 1120px responsive container as the site's
   header and hero, even when WordPress adds a wp-block-shortcode wrapper.
   The rest of the Gutenberg text keeps its narrower reading column. */
body.fsfs-theme .fsfs-builder-content > .sf-shell,
body.fsfs-theme .fsfs-builder-content > .wp-block-shortcode:has(.sf-shell) {
    width: min(var(--fsfs-max-width, 1120px), calc(100% - var(--fsfs-container-inset, 48px))) !important;
    max-width: none !important;
    margin-inline: auto !important;
}
body.fsfs-theme .fsfs-builder-content > .wp-block-shortcode:has(.sf-shell) .sf-shell {
    width: 100%;
    max-width: none;
}

.sf-shell [hidden] { display: none !important; }
.sf-shell button, .sf-shell input { font-family: inherit; }
.sf-shell button, .sf-shell input, .sf-shell a { -webkit-tap-highlight-color: transparent; }
.sf-shell button:focus-visible,
.sf-shell input:focus-visible,
.sf-shell a:focus-visible {
    outline: 2px solid var(--sf-accent);
    outline-offset: 2px;
}
.sf-tabs--single { display: none !important; }

.sf-form-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    width: 100%;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--sf-line);
    border-radius: 0;
    background: var(--sf-white);
    box-shadow: none;
}
.sf-panel {
    display: none;
    min-width: 0;
    margin: 0;
    padding: 0;
}
.sf-panel.is-active { display: block; }
.sf-input-link { min-width: 0; width: 100%; margin: 0; }
.sf-input-control {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}
.sf-url-input,
.sf-input-control input#sf-url {
    appearance: none;
    display: block;
    width: 100%;
    min-width: 0;
    height: 52px;
    margin: 0;
    padding-block: 0;
    padding-inline: 0 64px;
    border: 1px solid transparent;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    color: var(--sf-ink);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    outline: none;
    text-overflow: ellipsis;
    transition: border-color .15s ease, background-color .15s ease;
}
.sf-url-input::placeholder,
.sf-input-control input#sf-url::placeholder {
    color: #858b9a;
    opacity: 1;
}
.sf-url-input.is-error-empty::placeholder,
.sf-input-control input#sf-url.is-error-empty::placeholder {
    color: #b53939;
    opacity: 1;
}
.sf-url-input:focus,
.sf-input-control input#sf-url:focus {
    border-color: transparent;
    background: #fff;
    outline: none;
    box-shadow: none;
}
.sf-url-input.is-error,
.sf-input-control input#sf-url.is-error {
    border-color: #df9191;
    background: #fff;
}
.sf-url-input:read-only { cursor: progress; opacity: .8; }
.sf-input-control .sf-input-error,
.sf-input-control .sf-paste-hint {
    position: absolute;
    z-index: 5;
    top: calc(100% + 7px);
    inset-inline-start: 0;
    width: max-content;
    max-width: min(400px, 100%);
    margin: 0;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #e8baba;
    color: #b53939;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 400;
    white-space: normal;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(29, 32, 45, .07);
}
.sf-input-control .sf-paste-hint {
    border-color: var(--sf-line);
    color: var(--sf-muted);
}
/* The empty-field error replaces the placeholder visually but remains
   announced through an invisible alert for assistive technology. */
.sf-input-control .sf-input-error.is-accessibility-only {
    position: absolute;
    width: 1px;
    height: 1px;
    max-width: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    box-shadow: none;
}
.sf-paste-btn {
    appearance: none;
    position: absolute;
    z-index: 1;
    inset-inline-end: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 52px;
    min-width: 52px;
    height: 52px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--sf-line);
    border-radius: 0;
    color: #485266;
    background: #f8f9fc;
    box-shadow: none;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}
.sf-paste-btn:hover { background: #efeffc; color: var(--sf-accent); border-color: #cbcbea; }
.sf-paste-btn.is-pasted { color: #16824e; border-color: #aee2c4; background: #effbf5; }
.sf-paste-btn:disabled { opacity: .5; cursor: not-allowed; }
.sf-paste-icon, .sf-paste-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
}
/* Keep the feedback text accessible, while the control displays only its icon. */
.sf-paste-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sf-submit-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    height: 52px;
    margin: 0;
    padding: 0 24px;
    border: 1px solid var(--sf-accent);
    border-radius: 0;
    background: var(--sf-accent);
    color: #fff;
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, opacity .15s ease;
}
.sf-submit-text { color: inherit; font-size: inherit; font-weight: 600; }
.sf-submit-btn:hover:not(:disabled) { background: #5353c5; color: #fff; }
.sf-submit-btn:disabled { opacity: .7; cursor: wait; }
.sf-form-wrap:focus-within:not(:has(.sf-url-input.is-error)) { border-color: #c2c2eb; }
.sf-form-wrap:has(.sf-url-input.is-error) { border-color: var(--sf-line); }

@media (max-width: 680px) {
    .sf-form-wrap {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 13px;
    }
    /* A bottom toast avoids covering the stacked submit button on mobile. */
    .sf-input-control .sf-input-error:not(.is-accessibility-only),
    .sf-input-control .sf-paste-hint {
        position: fixed;
        z-index: 1000;
        top: auto;
        bottom: max(16px, env(safe-area-inset-bottom));
        inset-inline: 16px;
        width: auto;
        max-width: none;
        box-shadow: 0 7px 20px rgba(29, 32, 45, .12);
    }
    .sf-input-control input#sf-url {
        height: 49px;
        padding-inline-start: 0;
        padding-inline-end: 61px;
        font-size: 13px;
    }
    .sf-paste-btn {
        width: 49px;
        min-width: 49px;
        height: 49px;
        padding: 0;
    }
    .sf-submit-btn {
        display: flex;
        width: 100%;
        min-width: 0;
        height: 49px;
        font-size: 14px;
    }
}
@media (max-width: 390px) {
    .sf-form-wrap { padding: 12px; }
    .sf-input-control input#sf-url { font-size: 12px; }
    .sf-paste-hint { font-size: 12px; line-height: 1.5; }
}
@media (prefers-reduced-motion: reduce) {
    .sf-submit-btn, .sf-url-input { transition: none; }
}
