:root {
    --ht-accent: #10b981;
    --ht-bg: #f9fafb;
    --ht-card-bg: #ffffff;
    --ht-text: #1f2937;
    --ht-text-muted: #6b7280;
    --ht-border: #e5e7eb;
    --ht-success: #d1fae5;
    --ht-success-text: #065f46;
    --ht-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ht-radius: 12px;
    --ht-radius-sm: 8px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.5;
    color: var(--ht-text);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.htools-wrap {
    margin: 24px auto;
    padding: 24px;
    border: 1px solid var(--ht-border);
    border-radius: var(--ht-radius);
    background-color: var(--ht-card-bg);
    box-shadow: var(--ht-shadow);
}

.htools-wrap h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--ht-text);
}

.hmuted {
    color: var(--ht-text-muted);
    font-size: 16px;
    margin-bottom: 24px;
}

.htools-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--ht-border);
    padding-bottom: 16px;
}

.htab {
    padding: 12px 20px;
    border: none;
    border-radius: var(--ht-radius-sm);
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--ht-text-muted);
    transition: all 0.2s ease;
    position: relative;
}

.htab:hover {
    background-color: #f3f4f6;
}

.htab[aria-selected="true"] {
    background: var(--ht-accent);
    color: #ffffff;
}

.htab[aria-selected="true"]::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--ht-accent);
    border-radius: 3px 3px 0 0;
}

.hgrid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.hcard {
    padding: 20px;
    border: 1px solid var(--ht-border);
    border-radius: var(--ht-radius);
    background: var(--ht-card-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.htools-wrap label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ht-text);
}

.hnum, .hsel, .htext {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ht-border);
    border-radius: var(--ht-radius-sm);
    background: var(--ht-card-bg);
    font-size: 16px;
    transition: border-color 0.2s;
}

.hnum:focus, .hsel:focus, .htext:focus {
    outline: none;
    border-color: var(--ht-accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.hbox {
    margin-top: 16px;
}

.hsmall {
    font-size: 12px;
    color: var(--ht-text-muted);
    margin-top: 4px;
}

.hbtn {
    padding: 12px 20px;
    border: 0;
    border-radius: var(--ht-radius-sm);
    background: var(--ht-accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hbtn:hover {
    background-color: #0ea371;
}

.hout {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 20px;
    padding: 20px;
    border: 1px solid var(--ht-border);
    border-radius: var(--ht-radius);
    background-color: #f8fafc;
}

.hbadge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--ht-success);
    color: var(--ht-success-text);
    font-size: 12px;
    font-weight: 700;
    margin-top: 8px;
}

.htools-wrap details {
    margin-top: 16px;
}

.htools-wrap summary {
    cursor: pointer;
    font-weight: 700;
    padding: 8px 0;
}

.hsep {
    margin: 20px 0;
    border-top: 1px dashed var(--ht-border);
}

.htools-wrap ul {
    padding-left: 20px;
}

.htools-wrap li {
    margin-bottom: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .htools-wrap {
        padding: 16px;
        margin: 16px auto;
    }
    
    .htools-nav {
        overflow-x: auto;
        padding-bottom: 12px;
        scrollbar-width: none;
    }
    
    .htools-nav::-webkit-scrollbar {
        display: none;
    }
    
    .htab {
        white-space: nowrap;
        flex: 1;
        min-width: max-content;
    }
    
    .hgrid {
        grid-template-columns: 1fr;
    }
    
    .hout {
        grid-template-columns: 1fr;
    }
}

/* Loading animation for buttons */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s ease infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Affiliate box styling */
.affiliate-box {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid var(--ht-border);
    border-radius: var(--ht-radius);
    background: var(--ht-card-bg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.affiliate-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

.affiliate-coming-soon {
    color: var(--ht-text-muted);
    font-weight: 400;
}

.affiliate-link {
    display: inline-block;
    margin-top: 8px;
    padding: 10px 16px;
    background: linear-gradient(180deg, #10b981, #0ea371);
    color: #fff;
    border-radius: var(--ht-radius-sm);
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.affiliate-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.4);
}

/* Result card styling */
.result-card {
    padding: 16px;
    border-radius: var(--ht-radius-sm);
    background: var(--ht-card-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.result-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--ht-text-muted);
}

.result-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--ht-text);
}