/* Free browser tools: shared styles (builds on /styles.css and /blog/blog.css) */

.tool-page .container { max-width: 980px; }
.tool-page .prose { max-width: 780px; }
.tool-page .prose a:not(.btn):not(.tool-btn),
.tool-page .lead a,
.tool-side a { color: #111; text-decoration: underline; text-underline-offset: 2px; }

.tool-privacy {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #111;
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    margin-bottom: 1.5rem;
}

.dropzone {
    display: block;
    border: 2px dashed #111;
    border-radius: 10px;
    background: var(--gray-100, #f5f5f5);
    padding: 2.5rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 1.5rem;
}
.dropzone:hover, .dropzone.is-over { background: var(--gray-200, #e5e5e5); }
.dropzone:focus-within { outline: 3px solid #111; outline-offset: 2px; }
.dropzone strong { display: block; font-size: 1.2rem; margin-bottom: 0.35rem; color: #111; }
.dropzone span { color: var(--gray-600, #525252); font-size: 0.95rem; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.tool-error {
    border: 2px solid #111;
    background: #fff;
    border-left-width: 8px;
    padding: 0.9rem 1.1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.tool-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 2.5rem;
}

.screen-frame {
    background: #1a1a1a;
    border-radius: 18px;
    padding: 18px 14px 26px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.screen-frame canvas {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    background: #fff;
    image-rendering: pixelated;
    touch-action: none;
}
.screen-frame canvas[data-zoom="fit"] { max-height: 78vh; }
.screen-frame canvas[data-zoom="1"] { max-width: none; max-height: none; }
.screen-frame.is-scroll { overflow: auto; justify-content: flex-start; }
#ss-canvas { cursor: grab; }
#ss-canvas:active { cursor: grabbing; }
#xv-canvas { cursor: pointer; }

.tool-side {
    border: 1px solid var(--gray-300, #d4d4d4);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    background: #fff;
}
.tool-side h2 { font-size: 1.05rem !important; margin: 0 0 0.75rem !important; }
.tool-side .field { margin-bottom: 0.9rem; }
.tool-side label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; color: #222; }
.tool-side select,
.tool-side input[type="text"],
.tool-side input[type="number"] {
    width: 100%;
    font: inherit;
    font-size: 0.95rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--gray-400, #a3a3a3);
    border-radius: 6px;
    background: #fff;
    color: #111;
}
.tool-side input[type="range"] { width: 100%; accent-color: #111; }
.tool-side .check { display: flex; gap: 0.5rem; align-items: center; font-weight: 500; }
.tool-side .hint { font-size: 0.8rem; color: var(--gray-500, #737373); margin: 0.25rem 0 0; line-height: 1.4; }

.tool-btn {
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.55rem 0.9rem;
    border-radius: 6px;
    border: 1.5px solid #111;
    background: #fff;
    color: #111;
    cursor: pointer;
}
.tool-btn:hover:not(:disabled) { background: var(--gray-100, #f5f5f5); }
.tool-btn:disabled { opacity: 0.35; cursor: default; }
.tool-btn.primary { background: #111; color: #fff; width: 100%; padding: 0.75rem; font-size: 1rem; }
.tool-btn.primary:hover { background: #333; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.btn-row .tool-btn { flex: 1; }

.pager { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.pager input[type="number"] { width: 5rem; text-align: center; }
.pager span { font-size: 0.9rem; color: var(--gray-600, #525252); white-space: nowrap; }

.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.75rem; font-size: 0.88rem; margin: 0; }
.meta-list dt { font-weight: 600; color: #222; }
.meta-list dd { margin: 0; color: #444; overflow-wrap: anywhere; }

.tool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 2.5rem;
}
.tool-card {
    border: 2px solid #111;
    border-radius: 10px;
    padding: 1.4rem 1.4rem 1.2rem;
    background: #fff;
}
.tool-card h2 { font-size: 1.35rem !important; margin: 0 0 0.5rem !important; }
.tool-card h2 a { color: #111 !important; text-decoration: none !important; }
.tool-card h2 a:hover { text-decoration: underline !important; }
.tool-card p { font-size: 1rem !important; margin-bottom: 0.75rem !important; }
.tool-card ul { font-size: 0.95rem !important; margin-bottom: 0.75rem !important; }

@media (max-width: 820px) {
    .tool-panel { grid-template-columns: minmax(0, 1fr); }
    .screen-frame { padding: 10px 8px 16px; border-radius: 12px; }
    .screen-frame canvas { max-height: 70vh; }
}
