/* qrcode demo */

.qr-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
    width: 860px;
    max-width: 100%;
    margin: 1rem auto 0;
    text-align: left;
}

.qr-input {
    flex: 1 1 320px;
    min-width: 0;
}

.qr-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b949e;
}

.qr-input textarea {
    width: 100%;
    padding: 0.5rem 0.7rem;
    background: #0d1117;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 6px;
    font: inherit;
    resize: vertical;
}

.qr-input textarea:focus { outline: none; border-color: #58a6ff; }

.qr-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: #8b949e;
}

.qr-output canvas {
    display: block;
    width: 400px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    image-rendering: pixelated;
}

/* Penalty bars: one row per mask, chosen mask highlighted */
.qr-penalty {
    margin-top: 0.8rem;
    display: grid;
    gap: 3px;
}

.qr-bar {
    display: grid;
    grid-template-columns: 1.2rem 1fr 3.2rem;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #8b949e;
}

.qr-bar i {
    display: block;
    height: 8px;
    border-radius: 4px;
    background: #30363d;
    transform-origin: left;
}

.qr-bar em { font-style: normal; text-align: right; }
.qr-bar.best i { background: #3fb950; }
.qr-bar.chosen { color: #f0883e; }
.qr-bar.chosen i { background: #f0883e; }
