* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background-color: #667eea;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 450px;
    max-height: 650px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 15px;
    font-size: 28px;
    flex-shrink: 0;
}

.info-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 18px;
    margin-bottom: 12px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.voltage-display {
    display: flex;
    justify-content: center;
    margin: 15px 0;
    flex-shrink: 0;
}

.battery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.battery-horizontal {
    width: 260px;
    height: 75px;
    border: 3px solid #333;
    border-radius: 8px;
    padding: 5px;
    background: white;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
}

.battery-fill-horizontal {
    height: 100%;
    background: linear-gradient(to right, #4caf50, #8bc34a);
    border-radius: 5px;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.battery-terminal-horizontal {
    width: 8px;
    height: 50%;
    background: #333;
    border-radius: 0 4px 4px 0;
    position: absolute;
    right: -8px;
    top: 25%;
}

.voltage-text {
    text-align: center;
}

.voltage-value {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
}

.voltage-label {
    font-size: 14px;
    color: #999;
    margin-top: 3px;
}

.status-info {
    background: white;
    border-radius: 10px;
    padding: 5px 12px;
    overflow-y: auto;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    word-break: break-all;
    line-height: 15px;
}

.info-row:last-child {
    border-bottom: none;
}

.last-refresh-row {
    padding-top: 9px;
    font-weight: 600;
    color: #667eea;
}

.last-refresh-row .label {
    color: #667eea;
    font-weight: 600;
}

.last-refresh-row .value {
    color: #667eea;
    font-weight: 600;
}

.label {
    color: #999;
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 8px;
}

.value {
    color: #333;
    font-weight: 600;
    text-align: right;
    flex: 1;
}

.refresh-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
    margin-top: 10px;
    -webkit-user-select: none;
    user-select: none;
}

.refresh-btn:active {
    transform: scale(0.98);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 8px;
    display: none;
    font-size: 14px;
    word-break: break-all;
    flex-shrink: 0;
    margin-top: 10px;
}

.error-message.show {
    display: block;
}

@media (max-width: 600px) {
    .container {
        max-width: 95vw;
        max-height: 85vh;
        padding: 15px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .battery-horizontal {
        width: 230px;
        height: 65px;
    }

    .voltage-value {
        font-size: 28px;
    }

    .info-row {
        font-size: 14px;
        padding: 8px 0;
    }

    .refresh-btn {
        padding: 10px;
        font-size: 15px;
    }
}
