* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Exo 2', system-ui, sans-serif;
}

body {
    background: #0a0a23;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    background: #16213e;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(15, 52, 96, 0.2);
    padding: 1.5rem;
    max-width: 100%;
    width: 100%;
    max-width: 480px;
    border: 1px solid #0f3460;
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.pi-logo img {
    max-width: 70px;
    height: auto;
}

h1 {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1.5rem, 5vw, 1.8rem);
    color: #fff;
    margin: 0.5rem 0;
}

.subtitle {
    font-size: clamp(0.9rem, 3vw, 1rem);
    color: #a0a0c0;
}

.network-indicator {
    background: #00ff88;
    color: #1a1a2e;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    font-weight: 600;
    margin: 0.75rem auto;
    display: inline-block;
}

.icon-bar {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 1001;
}

.icon-btn {
    background: #1a1a2e;
    color: #fff;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    border: 1px solid #3b3b7a;
    transition: background 0.2s ease;
}

.icon-btn:hover {
    background: #3b3b7a;
}

.log-section, .settings-section {
    width: calc(100% - 2rem);
    max-width: 400px;
    position: fixed;
    top: 4rem;
    right: 1rem;
    z-index: 1000;
}

.log-content, .settings-content {
    display: none;
    background: #1a1a2e;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #3b3b7a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    max-height: 70vh;
    overflow-y: auto;
}

.log-content.show, .settings-content.show {
    display: block;
}

.close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.close-btn:hover {
    color: #ff6b6b;
}

.log-header {
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #3b3b7a;
    font-size: clamp(1rem, 3vw, 1.1rem);
}

.log-entry {
    font-size: clamp(0.8rem, 2.5vw, 0.85rem);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #0f3460;
    border-radius: 0.3rem;
    line-height: 1.4;
}

.log-entry.error {
    color: #ff6b6b;
}

.log-entry.success {
    color: #4caf50;
}

.log-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #3b3b7a;
}

.clear-log-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 0.3rem;
    font-size: clamp(0.75rem, 2vw, 0.8rem);
    cursor: pointer;
}

.clear-log-btn:hover {
    background: #c82333;
}

.balance-display {
    background: #0f3460;
    border: 1px solid #1a1a2e;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.balance-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.balance-item {
    text-align: center;
    padding: 1rem;
    background: #1a1a2e;
    border-radius: 0.5rem;
    border: 1px solid #3b3b7a;
}

.balance-label {
    color: #b8b8d1;
    font-size: clamp(0.75rem, 2vw, 0.8rem);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-amount {
    color: #00ff88;
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.address-short {
    font-family: 'Roboto Mono', monospace;
    font-size: clamp(0.7rem, 2vw, 0.75rem);
    color: #a0a0c0;
}

.available-amount {
    color: #4caf50;
    font-size: clamp(0.7rem, 2vw, 0.75rem);
    margin-top: 0.3rem;
}

.locked-balance {
    margin-top: 1rem;
    padding: 1rem;
    background: #0f3460;
    border-radius: 0.5rem;
    border: 1px solid #3b3b7a;
}

.locked-balance-header {
    color: #fff;
    font-size: clamp(0.85rem, 2.5vw, 0.9rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.locked-info {
    color: #fff;
    font-size: clamp(0.8rem, 2.5vw, 0.85rem);
    margin-bottom: 0.3rem;
}

.unlock-status {
    color: #4caf50;
    font-size: clamp(0.75rem, 2vw, 0.8rem);
    font-weight: 500;
}

.unlock-status.pending {
    color: #ffca28;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: #e0e0e0;
    font-weight: 500;
    font-size: clamp(0.85rem, 2.5vw, 0.9rem);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="time"],
.form-group input[type="date"],

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: #0f3460;
    border: 1px solid #1a1a2e;
    border-radius: 0.5rem;
    color: #e0e0e0;
    font-size: clamp(0.85rem, 2.5vw, 0.9rem);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.2);
}

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

.form-group input[type="time"] {
    box-sizing: border-box;
}

.form-group input[type="date"] {
    box-sizing: border-box;
}

.btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: clamp(0.85rem, 2.5vw, 0.9rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.btn-primary {
    background: linear-gradient(45deg, #6B00D7, #A100FF);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 0, 215, 0.3);
}

.btn-success {
    background: linear-gradient(45deg, #00ff88, #00cc66);
    color: #1a1a2e;
}

.btn-danger {
    background: linear-gradient(45deg, #ff4d4d, #cc0000);
    color: #fff;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.alert {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: clamp(0.85rem, 2.5vw, 0.9rem);
    display: none;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
    color: #00ff88;
}

.alert-danger {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
}

.alert-warning {
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid #ffcc00;
    color: #ffcc00;
}

.alert-info {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid #007bff;
    color: #007bff;
}

.security-warning {
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid #ffcc00;
    color: #ffcc00;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: clamp(0.8rem, 2.5vw, 0.85rem);
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.step {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #0f3460;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.85rem, 2.5vw, 0.9rem);
    font-weight: 600;
    color: #a0a0c0;
    transition: all 0.2s ease;
}

.step.active {
    background: #6B00D7;
    color: #fff;
}

.step.completed {
    background: #00ff88;
    color: #1a1a2e;
}

.transaction-summary {
    background: #0f3460;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: clamp(0.85rem, 2.5vw, 0.9rem);
    color: #e0e0e0;
}

.summary-row:last-child {
    margin-bottom: 0;
    font-weight: 600;
    border-top: 1px solid #1a1a2e;
    padding-top: 0.5rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: clamp(0.85rem, 2.5vw, 0.9rem);
}

input[type="radio"] {
    accent-color: #6B00D7;
}

.tx-link {
    color: #00ff88;
    text-decoration: none;
    font-weight: 600;
}

.tx-link:hover {
    text-decoration: underline;
}

.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }

    .balance-grid {
        grid-template-columns: 1fr 1fr;
    }

    .radio-group {
        flex-direction: row;
    }

    .log-section, .settings-section {
        max-width: 420px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    .container {
        padding: 1rem;
        border-radius: 0.75rem;
    }

    .icon-bar {
        top: 0.5rem;
        right: 0.5rem;
    }

    .log-section, .settings-section {
        top: 3rem;
        right: 0.5rem;
        width: calc(100% - 1rem);
    }

    .btn {
        padding: 0.6rem;
        font-size: clamp(0.8rem, 2.5vw, 0.85rem);
    }

    .form-group input,
    .form-group textarea {
        padding: 0.6rem;
        font-size: clamp(0.8rem, 2.5vw, 0.85rem);
    }
}