/* Design panels: add to your existing stylesheet and adjust colours to match */

.qr-panel { margin-top: 16px; }
.qr-panel[hidden] { display: none; }

.qr-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.qr-choices {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin: 0; padding: 0; border: 0;
}

.qr-choice { position: relative; cursor: pointer; }
.qr-choice input { position: absolute; opacity: 0; pointer-events: none; }

.qr-choice__box {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 12px 8px;
    border: 1.5px solid #e2e2e2; border-radius: 10px;
    text-align: center; font-size: 14px;
    transition: border-color .15s, background-color .15s;
}
.qr-choice__box svg { fill: currentColor; }
.qr-choice__box small { color: #777; font-size: 12px; line-height: 1.3; }

.qr-choice input:checked + .qr-choice__box { border-color: #e11d48; background: #fff1f2; }
.qr-choice input:focus-visible + .qr-choice__box { outline: 2px solid #e11d48; outline-offset: 2px; }

.qr-colours { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qr-colour { display: flex; flex-direction: column; gap: 6px; }
.qr-colour input[type="color"] {
    width: 100%; height: 44px; padding: 4px;
    border: 1.5px solid #e2e2e2; border-radius: 10px; background: #fff; cursor: pointer;
}

.qr-hint { margin: 10px 0 0; color: #777; font-size: 13px; }

/* SVG has no fixed size, so set it here. Framed codes are taller than wide. */
#qr-preview-image {
    display: block; margin: 0 auto;
    width: 100%; max-width: 280px; height: auto; max-height: 360px;
    object-fit: contain;
    transition: opacity .2s;
}

/* ---------- Loader over the preview ----------
   Class names avoid the words "loader" and "spin", so other site styles
   that target those words can't add extra movement. */
.qr-preview-box { position: relative; }

.qr-busy {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .55);
    border-radius: inherit;
    opacity: 0; visibility: hidden;
    transition: opacity .15s, visibility .15s;
    animation: none !important;   /* the overlay itself never moves */
    transform: none !important;
}
.qr-preview-box.is-loading .qr-busy { opacity: 1; visibility: visible; }
.qr-preview-box.is-loading #qr-preview-image { opacity: .35; }

/* The ring (same style as the .loader you liked).
   --qr-ring-color : colour of the ring
   --qr-ring-size  : 1px = 48px wide; 0.5px = 24px wide
   --qr-ring-speed : time for ONE full turn - bigger = slower */
.qr-busy-ring {
    --qr-ring-color: #e11d48;
    --qr-ring-size: 1px;
    --qr-ring-speed: 1s;

    display: inline-block;
    box-sizing: border-box;
    width: calc(48 * var(--qr-ring-size));
    height: calc(48 * var(--qr-ring-size));
    border: calc(5 * var(--qr-ring-size)) solid var(--qr-ring-color);
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: qr-ring-turn var(--qr-ring-speed) linear infinite !important;
}

@keyframes qr-ring-turn {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---------- Ring inside the Generate button ---------- */
#qr-generate-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }

.qr-busy-ring--button {
    --qr-ring-color: #fff;
    --qr-ring-size: 0.4px;   /* about 19px */
    display: none;
}
#qr-generate-button.is-loading .qr-busy-ring--button { display: inline-block; }
#qr-generate-button:disabled { cursor: wait; opacity: .85; }

/* ---------- Messages under the preview ---------- */
.qr-status {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 12px 0;
    padding: 10px 14px;
    border: 1px solid; border-left-width: 4px; border-radius: 8px;
    font-size: 14px; font-weight: 500; line-height: 1.4;
    text-align: left;
}
.qr-status[hidden] { display: none; }

.qr-status::before {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; margin-top: 1px;
    border-radius: 50%;
    font-size: 13px; font-weight: 700; color: #fff;
}

.qr-status--error   { color: #991b1b; background: #fef2f2; border-color: #fca5a5; border-left-color: #dc2626; }
.qr-status--error::before   { content: "!"; background: #dc2626; }

.qr-status--warning { color: #92400e; background: #fffbeb; border-color: #fcd34d; border-left-color: #d97706; }
.qr-status--warning::before { content: "!"; background: #d97706; }

.qr-status--success { color: #166534; background: #f0fdf4; border-color: #86efac; border-left-color: #16a34a; }
.qr-status--success::before { content: "\2713"; background: #16a34a; }