/* ===== Tool pages (under /tools/*) ===== */
.tool-main { max-width: 760px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.tool-row { display: flex; gap: 0.75rem; margin-bottom: 0.85rem; flex-wrap: wrap; }
.tool-row .tool-field { flex: 1 1 140px; min-width: 0; }
.tool-field label {
    display: block;
    color: var(--text-dim);
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tool-field input[type="text"],
.tool-field input[type="number"],
.tool-field select,
.tool-field textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-strong);
    font-size: 0.92rem;
    font-family: inherit;
    transition: all 0.2s ease;
}
.tool-field textarea {
    min-height: 160px;
    resize: vertical;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.55;
}
.tool-field input:focus, .tool-field select:focus, .tool-field textarea:focus {
    outline: none;
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px var(--indigo-soft);
    background: var(--bg);
}
.tool-toggles { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin: 0.4rem 0 1rem; }
.tool-toggles label {
    display: inline-flex; align-items: center; gap: 0.45rem;
    color: var(--text); font-size: 0.9rem; cursor: pointer;
}
.tool-toggles input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

.tool-button {
    width: 100%;
    padding: 0.85rem;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--accent-ink);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
}
.tool-button:hover:not(:disabled) { background: transparent; color: var(--accent); }
.tool-button:disabled { opacity: 0.6; cursor: not-allowed; }

.tool-result {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    min-height: 80px;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.tool-result.is-empty { color: var(--text-faint); justify-content: center; align-items: center; font-size: 0.9rem; }
.tool-result-headline {
    font-family: var(--mono);
    color: var(--text-strong);
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    word-break: break-all;
    line-height: 1.35;
}
.tool-result-headline.small { font-size: 1.1rem; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.tool-chip {
    background: var(--accent);
    color: var(--accent-ink);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.95rem;
}
.tool-chip.alt { background: transparent; color: var(--text-strong); }
.tool-coin {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--accent); color: var(--accent-ink);
    font-weight: 800; font-family: var(--mono); font-size: 0.85rem;
    border: 1px solid var(--accent);
}
.tool-coin.tails { background: transparent; color: var(--text-strong); border-color: var(--border-strong); }
.tool-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.tool-team {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}
.tool-team h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    font-weight: 700;
}
.tool-team ul { list-style: none; padding: 0; margin: 0; }
.tool-team li {
    padding: 0.25rem 0;
    color: var(--text-strong);
    font-size: 0.92rem;
    border-bottom: 1px solid var(--border);
}
.tool-team li:last-child { border-bottom: 0; }

.tool-summary {
    display: flex; gap: 1.25rem; flex-wrap: wrap;
    color: var(--text-dim); font-size: 0.85rem;
    justify-content: center;
}
.tool-summary strong { color: var(--text-strong); font-family: var(--mono); }

.tool-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.tool-actions button, .tool-actions a {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-strong);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
}
.tool-actions button:hover, .tool-actions a:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.tool-verify {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-dim);
    display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center;
}
.tool-verify strong { color: var(--text-strong); }
.tool-verify a { color: var(--text-strong); text-decoration: underline; }

.tool-status { font-size: 0.8rem; color: var(--text-dim); text-align: center; min-height: 1.2em; }
.tool-status.error { color: var(--error); }

.tool-body { color: var(--text); }
.tool-body h2 {
    color: var(--text-strong);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 800;
    margin: 2rem 0 0.6rem;
}
.tool-body p, .tool-body li { color: var(--text); line-height: 1.7; font-size: 0.95rem; }
.tool-body ul, .tool-body ol { padding-left: 1.4rem; margin-bottom: 0.8rem; }
.tool-body code { font-family: var(--mono); font-size: 0.88em; background: var(--surface); padding: 0.1rem 0.4rem; border-radius: 4px; border: 1px solid var(--border); }
.tool-body a { color: var(--text-strong); text-decoration: underline; }

.tool-faq-item { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.tool-faq-item:last-child { border-bottom: 0; }
.tool-faq-item h3 { color: var(--text-strong); font-size: 1rem; margin-bottom: 0.4rem; font-weight: 700; }
.tool-faq-item p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.65; margin: 0; }

.tools-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.tools-index-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s ease;
}
.tools-index-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.tools-index-card h2 { color: var(--text-strong); font-size: 1.1rem; margin-bottom: 0.3rem; font-weight: 700; letter-spacing: -0.01em; }
.tools-index-card p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.55; margin: 0; }
.tools-index-card .feature-icon { margin-bottom: 1rem; }

.tool-history {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.tool-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 700;
}
.tool-history-header-empty {
    justify-content: flex-end;
    margin-top: 0.75rem;
    margin-bottom: 0;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}
.tool-link-button {
    background: transparent;
    border: 0;
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: color 0.15s ease, background 0.15s ease;
}
.tool-link-button:hover { color: var(--text-strong); background: rgba(255, 255, 255, 0.05); }
.tool-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tool-history-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}
.tool-history-index {
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 700;
}
.tool-history-summary {
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.78rem;
    white-space: nowrap;
}
.tool-history-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.75rem;
}
.tool-history-link:hover { color: var(--text-strong); }
.tool-history-link code { font-family: var(--mono); }
.tool-chips-compact { justify-content: flex-start; gap: 0.25rem; }
.tool-coin-sm {
    width: 26px; height: 26px;
    font-size: 0.7rem;
}
