/* Shared styles for Yasaboy image/photo tools */
.img-preview {
    display: grid;
    place-items: center;
    min-height: 280px;
    padding: 1rem;
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius-sm);
    background:
        linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.img-preview img,
.img-preview canvas {
    max-width: 100%;
    max-height: 520px;
    height: auto;
    border-radius: 4px;
}

/* Crop tool */
.crop-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    touch-action: none;
    user-select: none;
}

.crop-stage img {
    display: block;
    max-width: 100%;
    height: auto;
}

.crop-box {
    position: absolute;
    border: 2px dashed var(--tool-accent);
    background: rgba(97, 208, 148, 0.14);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
    cursor: move;
}

/* Range row helper */
.opt-range {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.6rem;
    align-items: center;
}

.opt-range output {
    min-width: 48px;
    color: var(--tool-muted);
    font-family: var(--font-mono);
    font-size: 0.84rem;
    text-align: right;
}

.swatch-input {
    height: 46px;
    padding: 4px;
    cursor: pointer;
}

/* Related tools footer on tool pages */
.tool-related {
    margin-top: 0.5rem;
}

.tool-related-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.tool-related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.1rem;
    margin: 0;
}

.tool-related-links a {
    color: var(--tool-accent);
    text-decoration: none;
    font-size: 0.92rem;
}

.tool-related-links a:hover {
    text-decoration: underline;
}
