/* ===== BestQR — QR utility tools (shared) ===== */

/* Per-tool accent themes */
body.tscan {
    --accent: #16a34a;
    --accent-600: #12833c;
    --accent-soft: #e6f6ec;
    --accent-ring: #16a34a2e
}

body.tdecode {
    --accent: #0891b2;
    --accent-600: #0b7c96;
    --accent-soft: #e0f5fa;
    --accent-ring: #0891b22e
}

body.tvalid {
    --accent: #d97706;
    --accent-600: #b45f05;
    --accent-soft: #fdf1e0;
    --accent-ring: #d977062e
}

body.tanalyze {
    --accent: #7c3aed;
    --accent-600: #6b28d9;
    --accent-soft: #f1eafe;
    --accent-ring: #7c3aed2e
}

body.tsize {
    --accent: #e11d48;
    --accent-600: #c01840;
    --accent-soft: #fde7ec;
    --accent-ring: #e11d482e
}

body.tcolor {
    --accent: #0ea5e9;
    --accent-600: #0284c7;
    --accent-soft: #e0f2fe;
    --accent-ring: #0ea5e92e
}

/* Hero */
.u-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border)
}

.u-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(760px 360px at 82% -14%, var(--accent-soft), transparent 60%), radial-gradient(620px 320px at 10% -8%, var(--accent-soft), transparent 55%)
}

.u-hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 0 44px
}

.u-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--accent-600);
    background: #fff;
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: 100px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px
}

.u-badge .icon {
    width: 14px;
    height: 14px
}

.u-hero h1 {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(32px, 4.6vw, 48px);
    line-height: 1.05;
    letter-spacing: -.03em;
    margin: 0 0 14px
}

.u-hero h1 em {
    font-style: normal;
    color: var(--accent)
}

.u-hero .lede {
    font-size: 17px;
    color: var(--muted);
    margin: 0 auto;
    max-width: 560px;
    line-height: 1.6
}

/* Workspace */
.u-main {
    padding: 44px 0 20px
}

.u-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 26px;
    align-items: start
}

@media(max-width:900px) {
    .u-grid {
        grid-template-columns: 1fr
    }
}

.u-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 26px
}

.u-panel-title {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin: 0 0 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px
}

.u-panel-title .icon {
    width: 15px;
    height: 15px;
    color: var(--accent)
}

/* Fields */
.u-field {
    margin-bottom: 16px
}

.u-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px
}

.u-input,
.u-textarea,
.u-select {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 15px;
    padding: 12px 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s
}

.u-input:focus,
.u-textarea:focus,
.u-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring)
}

.u-textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.5
}

.u-hint {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 7px
}

.u-hint .icon {
    width: 13px;
    height: 13px;
    flex: none;
    margin-top: 2px
}

/* Buttons */
.u-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform .15s, background .15s, border-color .15s, opacity .15s
}

.u-btn .icon {
    width: 17px;
    height: 17px
}

.u-btn.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 20px -10px var(--accent)
}

.u-btn.primary:hover {
    background: var(--accent-600);
    transform: translateY(-2px)
}

.u-btn.ghost {
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border-strong)
}

.u-btn.ghost:hover {
    border-color: var(--accent);
    color: var(--accent-600)
}

.u-btn.block {
    width: 100%
}

.u-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none
}

.u-btn-row {
    display: flex;
    gap: 11px;
    flex-wrap: wrap
}

/* Dropzone */
.u-drop {
    display: block;
    border: 2px dashed var(--border-strong);
    border-radius: 16px;
    background: var(--surface);
    padding: 34px 22px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s
}

.u-drop:hover,
.u-drop.drag {
    border-color: var(--accent);
    background: var(--accent-soft)
}

.u-drop .di {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    margin: 0 auto 14px
}

.u-drop .di .icon {
    width: 26px;
    height: 26px
}

.u-drop b {
    display: block;
    font-family: var(--display);
    font-size: 16px;
    margin-bottom: 4px
}

.u-drop span {
    font-size: 13px;
    color: var(--muted)
}

.u-drop input {
    display: none
}

.u-preview-img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: block;
    margin: 0 auto
}

/* Camera stage */
.u-cam {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #0b0d12;
    border-radius: 16px;
    overflow: hidden;
    display: grid;
    place-items: center
}

.u-cam video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.u-cam canvas {
    display: none
}

.u-cam-reticle {
    position: absolute;
    inset: 16%;
    border-radius: 18px;
    pointer-events: none;
    box-shadow: 0 0 0 100vmax rgba(8, 10, 16, .35)
}

.u-cam-reticle::before,
.u-cam-reticle::after,
.u-cam-reticle i {
    content: ""
}

.u-cam-reticle span {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #fff;
    opacity: .9
}

.u-cam-reticle .tl {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
    border-radius: 12px 0 0 0
}

.u-cam-reticle .tr {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 12px 0 0
}

.u-cam-reticle .bl {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 12px
}

.u-cam-reticle .br {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 12px 0
}

.u-cam-reticle.hit span {
    border-color: var(--accent)
}

.u-cam-msg {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12.5px;
    color: #fff;
    background: rgba(8, 10, 16, .6);
    padding: 6px 14px;
    border-radius: 100px;
    backdrop-filter: blur(6px);
    white-space: nowrap
}

.u-cam-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, .7);
    padding: 24px
}

.u-cam-placeholder .icon {
    width: 40px;
    height: 40px;
    margin-bottom: 12px
}

.u-cam-placeholder p {
    font-size: 13.5px;
    margin: 0;
    max-width: 240px
}

/* Result / output */
.u-out {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    overflow: hidden
}

.u-out-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: #fff
}

.u-out-head .tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--accent-600);
    background: var(--accent-soft);
    padding: 5px 10px;
    border-radius: 8px;
    font-weight: 600
}

.u-out-head .tag .icon {
    width: 13px;
    height: 13px
}

.u-out-body {
    padding: 18px
}

.u-out-value {
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    word-break: break-all;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    max-height: 220px;
    overflow: auto
}

.u-empty {
    text-align: center;
    color: var(--muted);
    padding: 40px 20px;
    font-size: 14px
}

.u-empty .icon {
    width: 34px;
    height: 34px;
    color: var(--muted-2);
    margin-bottom: 12px
}

/* Detail rows */
.u-rows {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden
}

.u-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: #fff;
    padding: 13px 16px
}

.u-row .k {
    font-size: 13.5px;
    color: var(--muted)
}

.u-row .v {
    font-family: var(--mono);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    text-align: right
}

/* Verdict banners */
.u-verdict {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.5;
    margin-bottom: 16px
}

.u-verdict .icon {
    width: 22px;
    height: 22px;
    flex: none
}

.u-verdict b {
    font-weight: 700
}

.u-verdict.good {
    background: #e6f6ec;
    color: #0f6b34
}

.u-verdict.warn {
    background: #fdf3e0;
    color: #8a5206
}

.u-verdict.bad {
    background: #fdeaea;
    color: #a11d1d
}

/* Chips */
.u-chips {
    display: flex;
    gap: 9px;
    flex-wrap: wrap
}

.u-chip {
    font-size: 13px;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 100px;
    border: 1.5px solid var(--border-strong);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: all .15s
}

.u-chip:hover {
    border-color: var(--accent)
}

.u-chip.sel {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff
}

/* Range control */
.u-range {
    display: flex;
    align-items: center;
    gap: 14px
}

.u-range input[type=range] {
    flex: 1;
    accent-color: var(--accent)
}

.u-range output {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-600);
    min-width: 74px;
    text-align: right
}

/* Info / content bands reuse .band from styles.css?v=3 */
.u-tip {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text)
}

.u-tip .icon {
    width: 19px;
    height: 19px;
    flex: none;
    color: var(--accent-600);
    margin-top: 1px
}

/* Back link */
.u-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: 6px
}

.u-back .icon {
    width: 15px;
    height: 15px
}