.crypto-card {
    max-width: 980px;
}

.crypto-card > .tab-content,
.crypto-card .tab-content {
    text-align: center;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.2rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--muted-text, #526173);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tab:hover {
    background: var(--surface-subtle);
    color: var(--text-color);
    transform: translateY(-1px);
}

.tab.active {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.crypto-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.crypto-grid.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.crypto-grid.settings-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.password-settings-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.password-settings-grid .form-group {
    width: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.94) 100%);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 18px;
    padding: 1.1rem 1.15rem 1.2rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.password-settings-grid .form-group label {
    margin-bottom: 0.85rem;
}

.tool-intro {
    margin: 0 auto 1rem;
    max-width: 70ch;
    color: var(--muted-text, #526173);
    text-align: center;
}

.helper-text {
    margin: 1rem 0 0;
    color: var(--muted-text, #526173);
    font-size: 0.95rem;
}

.file-name {
    text-align: center;
}

.stack-card {
    background: var(--surface-subtle);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.form-group {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    width: min(100%, 560px);
}

.form-group label {
    display: block;
    margin-bottom: 0.55rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group textarea,
.form-group input,
.form-group select {
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    padding: 0.85rem 1rem;
    font: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group textarea[readonly] {
    background: rgba(148, 163, 184, 0.08);
}

.range-with-number {
    display: grid;
    grid-template-columns: 1fr 88px;
    gap: 0.75rem;
    align-items: center;
}

.range-with-number input[type="range"] {
    padding: 0;
    accent-color: var(--primary);
}

.password-settings-grid .range-with-number input[type="number"],
.password-settings-grid > .form-group > input[type="number"] {
    text-align: center;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.92);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.button-group.compact {
    justify-content: center;
}

.button-group-base64-primary,
.button-group-base64-secondary {
    flex-wrap: nowrap;
}

.crypto-card .btn,
.crypto-card .btn:visited {
    color: #ffffff !important;
    min-width: 170px;
    justify-content: center;
}

.crypto-card .btn:not(.btn-secondary) {
    background: #2563eb;
}

.crypto-card .btn:not(.btn-secondary):hover {
    background: #1d4ed8;
}

.btn.btn-secondary {
    background: #475569;
    color: #ffffff;
}

.btn.btn-secondary:hover {
    background: #334155;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.option-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.94) 100%);
    border-radius: 18px;
    padding: 0.95rem 1rem 0.95rem 4.25rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.option-toggle:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.option-toggle input {
    position: absolute;
    left: 1rem;
    top: 50%;
    width: 0;
    height: 0;
    margin: 0;
    opacity: 0;
}

.option-toggle span {
    display: block;
    width: 100%;
    text-align: center;
}

.option-toggle::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 50%;
    width: 2.35rem;
    height: 1.4rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.4);
    transform: translateY(-50%);
    transition: background-color 0.2s ease;
}

.option-toggle::after {
    content: "";
    position: absolute;
    left: 1.14rem;
    top: 50%;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    transform: translateY(-50%);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.option-toggle:has(input:checked) {
    border-color: rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.96) 0%, rgba(239, 246, 255, 1) 100%);
    box-shadow: 0 18px 38px rgba(37, 99, 235, 0.14);
}

.option-toggle:has(input:checked)::before {
    background: rgba(37, 99, 235, 0.85);
}

.option-toggle:has(input:checked)::after {
    transform: translate(0.95rem, -50%);
}

.option-toggle:has(input:focus-visible) {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 2px;
}

.strength-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.strength-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    font-weight: 700;
}

.status-message {
    display: none;
    margin-top: 1.5rem;
    padding: 0.95rem 1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 500;
    text-align: center;
}

.status-message.is-visible {
    display: block;
}

.status-message.status-success {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.25);
    color: #166534;
}

.status-message.status-error {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.24);
    color: #991b1b;
}

.status-message.status-info {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.24);
    color: #1d4ed8;
}

.file-upload-area {
    position: relative;
    overflow: hidden;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem 1.25rem;
    text-align: center;
    margin-top: 0;
}

.file-upload-area:hover {
    background: var(--surface-subtle);
}

.file-upload-area i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.file-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 900px) {
    .crypto-grid.two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        flex: 1 1 45%;
        justify-content: center;
    }

    .range-with-number {
        grid-template-columns: 1fr 78px;
    }

    .strength-panel {
        flex-direction: column;
        align-items: center;
    }

    .crypto-card .btn,
    .crypto-card .btn:visited {
        width: 100%;
        min-width: 0;
    }

    .button-group-base64-primary,
    .button-group-base64-secondary {
        flex-wrap: wrap;
    }
}
