/*
 * ToolsHash converters.
 *
 * Scoped under .thc and reads the theme's palette variables rather than
 * redefining :root, so light and dark both work without extra rules. One
 * stylesheet covers all four converters.
 */

.thc {
    --thc-card: var(--dark-gray, #1a1a1a);
    --thc-text: var(--light, #f5f5f5);
    --thc-accent: var(--primary, #00ff88);
    --thc-border: rgba(128, 128, 128, 0.28);
    --thc-inset: rgba(128, 128, 128, 0.12);
    --thc-warn: #ffb020;

    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding-top: 20px;
    color: var(--thc-text);
}

.thc .generator-card {
    background: var(--thc-card);
    border: 1px solid var(--thc-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 26px;
}

.thc .generator-card:last-child { margin-bottom: 0; }

.thc h3 {
    color: var(--thc-text);
    margin: 0 0 6px;
}

.thc h3 i { color: var(--thc-accent); }

.thc .thc-lead {
    opacity: 0.7;
    font-size: 0.9rem;
    margin-bottom: 22px;
}

/* --------------------------------------------------------------- layout */

.thc .thc-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 26px;
    align-items: start;
}

.thc .thc-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.thc .thc-grow { flex: 1 1 120px; }
.thc .thc-grow2 { flex: 2 1 180px; }

.thc .option-group { margin-bottom: 18px; }

.thc .option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.thc .option-label i { color: var(--thc-accent); }

.thc .thc-hint {
    display: block;
    font-size: 0.8rem;
    opacity: 0.65;
    margin-top: 8px;
}

/* --------------------------------------------------------------- inputs */

.thc input[type="number"],
.thc select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--thc-border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--thc-text);
    font: inherit;
}

.thc select { cursor: pointer; }

.thc input:focus,
.thc select:focus {
    outline: 2px solid var(--thc-accent);
    outline-offset: 1px;
}

/* -------------------------------------------------------------- toggles */

.thc .thc-toggle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.thc .thc-toggle button {
    flex: 1 1 100px;
    padding: 11px 14px;
    border-radius: 11px;
    border: 1px solid var(--thc-border);
    background: var(--thc-inset);
    color: var(--thc-text);
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thc .thc-toggle button:hover { border-color: var(--thc-accent); }

.thc .thc-toggle button.active {
    background: var(--thc-accent);
    border-color: var(--thc-accent);
    color: #0a0a0a;
}

.thc .thc-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.thc .thc-chips button {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--thc-border);
    background: var(--thc-inset);
    color: var(--thc-text);
    font: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thc .thc-chips button:hover {
    border-color: var(--thc-accent);
    color: var(--thc-accent);
}

/* -------------------------------------------------------------- results */

.thc .result-display {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--thc-border);
    border-radius: 15px;
    padding: 20px 22px;
    margin-bottom: 16px;
}

.thc .result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--thc-border);
}

.thc .result-row:first-child { padding-top: 0; }
.thc .result-row:last-child { border-bottom: none; padding-bottom: 0; }

.thc .result-label {
    opacity: 0.75;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
}

.thc .result-label small {
    font-size: 0.72rem;
    opacity: 0.7;
    font-weight: 400;
}

.thc .result-value {
    font-weight: 700;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.thc .result-row:first-child .result-value {
    color: var(--thc-accent);
    font-size: 1.35rem;
}

/* -------------------------------------------------------------- notices */

.thc .thc-warn {
    padding: 13px 15px;
    border-radius: 11px;
    background: rgba(255, 176, 32, 0.12);
    border: 1px solid rgba(255, 176, 32, 0.4);
    font-size: 0.84rem;
    line-height: 1.55;
}

.thc .thc-warn p { margin: 0 0 8px; }
.thc .thc-warn p:last-child { margin-bottom: 0; }

.thc .thc-warn-static {
    display: flex;
    gap: 11px;
    align-items: flex-start;
}

.thc .thc-warn-static i { color: var(--thc-warn); margin-top: 2px; }

/* --------------------------------------------------------------- button */

.thc .thc-copy {
    width: 100%;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--thc-accent);
    background: var(--thc-accent);
    color: #0a0a0a;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.thc .thc-copy:hover { filter: brightness(1.1); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 820px) {
    .thc .thc-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 600px) {
    .thc .generator-card { padding: 20px; border-radius: 16px; }
    .thc .result-row:first-child .result-value { font-size: 1.2rem; }
    .thc .thc-toggle button { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .thc * { transition: none !important; }
}
