/* Per-instance color token injected via inline style on .wibn-container */
.wibn-container {
    --wibn-btn-bg: #0073aa;
    font-family: inherit;
    max-width: 820px;
    margin: 1em 0;
    box-sizing: border-box;
}

.wibn-container *,
.wibn-container *::before,
.wibn-container *::after {
    box-sizing: border-box;
}

.wibn-title {
    margin: 0 0 16px;
}

/* ── Two-column layout ───────────────────────────────────────────────────── */

.wibn-layout {
    display: flex;
    flex-direction: row;
    gap: 28px;
    align-items: flex-start;
    width: 100%;
}

.wibn-col-left {
    flex: 0 0 260px;
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wibn-col-right {
    flex: 1;
    min-width: 0;
}

/* ── Form fields ─────────────────────────────────────────────────────────── */

.wibn-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.wibn-label {
    font-size: 13px;
    font-weight: 600;
    color: inherit;
    display: block;
}

.wibn-container .wibn-isbn-input,
.wibn-container .wibn-price-input,
.wibn-container .wibn-format-select {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    line-height: 1.4;
    background: #fff;
    color: inherit;
    appearance: auto;
}

.wibn-container .wibn-isbn-input:focus,
.wibn-container .wibn-price-input:focus,
.wibn-container .wibn-format-select:focus {
    outline: 2px solid var(--wibn-btn-bg, #0073aa);
    outline-offset: 1px;
    border-color: transparent;
}

/* ── Action buttons ──────────────────────────────────────────────────────── */

.wibn-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wibn-container .wibn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid var(--wibn-btn-bg, #0073aa);
    background: var(--wibn-btn-bg, #0073aa);
    color: #fff;
    text-decoration: none;
    transition: filter 0.15s;
    white-space: nowrap;
}

.wibn-container .wibn-btn:hover:not(:disabled) {
    filter: brightness(0.85);
}

.wibn-container .wibn-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.wibn-container .wibn-btn-secondary {
    background: transparent;
    color: var(--wibn-btn-bg, #0073aa);
}

.wibn-container .wibn-btn-secondary:hover:not(:disabled) {
    background: var(--wibn-btn-bg, #0073aa);
    color: #fff;
    filter: none;
}

/* ── Right column: output ────────────────────────────────────────────────── */

.wibn-output {
    width: 100%;
    border-radius: 6px;
    min-height: 160px;
}

/* Empty / placeholder state */
.wibn-output.is-empty {
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wibn-placeholder-msg {
    margin: 0;
    color: #bbb;
    font-size: 13px;
    text-align: center;
}

/* Filled state */
.wibn-output:not(.is-empty) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    border: none;
    padding: 0;
}

.wibn-svg-wrap {
    width: 100%;
}

.wibn-svg-wrap svg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.wibn-price-display {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.wibn-container .wibn-download-btn {
    font-size: 13px;
    padding: 6px 14px;
    font-weight: normal;
}

/* ── Status messages ─────────────────────────────────────────────────────── */

.wibn-message {
    margin: 0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
}

.wibn-message--success { background: #edfaed; color: #1a6e1a; border: 1px solid #b2dfb2; }
.wibn-message--error   { background: #fdf2f2; color: #8b1a1a; border: 1px solid #f5c6c6; }
.wibn-message--info    { background: #f0f6fc; color: #0c4a6e; border: 1px solid #bde0fe; font-family: monospace; }

/* ── Email opt-in ────────────────────────────────────────────────────────── */

.wibn-email-section {
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.wibn-email-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

.wibn-email-fields {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.wibn-container .wibn-email-input {
    flex: 1;
    min-width: 140px;
    padding: 7px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.wibn-email-status         { font-size: 13px; }
.wibn-email-status.success { color: #1a6e1a; }
.wibn-email-status.error   { color: #8b1a1a; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 580px) {
    .wibn-layout {
        flex-direction: column;
        gap: 20px;
    }

    .wibn-col-left {
        flex: none;
        width: 100%;
    }
}
