/* QR tool: only what the shared tools.css does not cover */

.qr-layout {
    display: grid;
    gap: 1rem;
}

@media (min-width: 960px) {
    .qr-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

/* ---------- Generator ---------- */
.options {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 560px) {
    .options {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 960px) and (max-width: 1199px) {
    .options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.color-picker {
    display: block;
    width: 100%;
    height: 2.75rem;
    padding: 0.1875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    cursor: pointer;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: 0;
    border-radius: 0.5rem;
}

.color-picker::-moz-color-swatch {
    border: 0;
    border-radius: 0.5rem;
}

.preview {
    display: flex;
    justify-content: center;
    padding: 1rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.qr-canvas {
    width: min(100%, 22rem);
    height: auto;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    image-rendering: pixelated;
}

/* ---------- Reader ---------- */
.divider-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.875rem;
}

.divider-label::before,
.divider-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.camera-box {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
    aspect-ratio: 4 / 3;
}

.camera-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-frame {
    position: absolute;
    inset: 18%;
    border: 3px solid rgb(255 255 255 / 0.9);
    border-radius: var(--radius);
    box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.35);
    pointer-events: none;
}

.result {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.result .label {
    margin-bottom: 0.5rem;
}

.result-output {
    margin: 0 0 0.75rem;
    padding: 0.75rem;
    max-height: 14rem;
    overflow: auto;
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: var(--mono);
    font-size: 0.9375rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
