/* SpeedTool shared component fallbacks.
   Loaded BEFORE page-level styles so individual pages can override anything here. */

/* Keep empty ad slots in the layout: on the homepage they are explicit grid
   columns (180px / 1fr / 180px); hiding them moves the content into column 1
   and everything appears shifted to the left. */
#ad-unified-top:empty {
    display: none;
}

/* Defensive: on wide screens the homepage uses a 3-column grid
   (left ad / content / right ad). Pin the content to the middle column so it
   stays centred even if an ad slot is hidden by an extension or future change. */
@media (min-width: 1301px) {
    .main > .center {
        grid-column: 2;
    }
}

.print-only {
    display: none;
}

@media print {
    .print-only {
        display: block !important;
    }

    .no-print,
    #global-header,
    #global-footer,
    .ad-slot-wrapper,
    .related-tools-section {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }
}

/* Generic button fallbacks used by older tool templates */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(79, 70, 229, .35);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, .16);
}

/* Keep long tables and formulas inside the viewport on mobile */
.conv-table,
table {
    max-width: 100%;
}

main {
    overflow-wrap: break-word;
}

/* Focus visibility for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #14d8ff;
    outline-offset: 2px;
}
